{"id":362,"date":"2011-04-10T12:35:45","date_gmt":"2011-04-10T16:35:45","guid":{"rendered":"https:\/\/www.tmurgent.com\/TmBlog\/?p=362"},"modified":"2013-04-06T11:51:45","modified_gmt":"2013-04-06T15:51:45","slug":"app-v-4-6-sp1-saga-of-the-duplicate-guid-continued","status":"publish","type":"post","link":"https:\/\/www.tmurgent.com\/TmBlog\/?p=362","title":{"rendered":"App-V 4.6 SP1: Saga of the duplicate GUID (continued)"},"content":{"rendered":"<p>We held our first training class on Microsoft App-V 4.6 SP1 last week in Malmo, Sweden.\u00a0 During the class, we ran into an &#8220;old friend&#8221; that entered the room using a new disguise.\u00a0 Although we thought he died, our friend the duplicate GUID still lives on.\u00a0 To explain&#8230;<\/p>\n<p>When application packages are sequenced with App-V, a package GUID (Globally Unique IDentifier) is generated.\u00a0 This package GUID can be seen in the XML files generated, but is also present in the SFT file and is really intended to be behind the scenes and away from the user.\u00a0 In fact, App-V liberally uses GUIDs for all sorts of behind the scenes identifications.\u00a0 But when it comes to the package GUID, the important thing to know is that the client requires each package GUID to really be unique.\u00a0<\/p>\n<p>Thanks to a combination of using virtual machines where we revert to old snapshots, and incorrect logic in when to create and assign this GUID in the sequencer, we have seen situations in prior versions of App-V whereby someone using the sequencer could create two or more packages and end up with the same GUID.<\/p>\n<p><strong>First Visitation<\/strong><\/p>\n<p>Ever since we started using VMs (originally we used Norton Ghost) to sequence with SoftGrid, we found that you could create packages with duplicate GUIDs by taking the VM snapshot after starting the sequencer.\u00a0 The sequencer would generate the GUID when you launched the sequencer executable, you took the snapshot, and every time you reverted the VM and generated a package it would end up with the same GUID.\u00a0 So we trained people to take the snapshot with the sequencer not running (yes, it&#8217;s OK to take it with the VM booted up and you logged in.\u00a0 Your security people will be calmed when you remind them that after reverting the VM you still need to log in to access it).<\/p>\n<p><strong>Second Visitation<\/strong><\/p>\n<p>In version 4.6, Microsoft changed the GUID generation, however we found our old friend <a href=\"https:\/\/www.tmurgent.com\/TmBlog\/?p=202\">show up in a different way<\/a>.\u00a0 With the 4.6 RTM, when you install the sequencer using the GUI installer, the final installer dialog has a checkbox that when selected will launch the sequencer.\u00a0 Stupidly, this checkbox is on by default leading countless people to suddenly see the launch the sequencer, which they dutifully close and then take their snapshot like we told them.\u00a0 Except that this scenario caused duplicate GUIDs to appear.\u00a0 So we started training them to make sure they uncheck that box and not start the sequencer before taking the snapshot.<\/p>\n<p>In 4.6 SP1, Microsoft solves this problem and even if you let the installer launch the sequencer, you can close it and take your snapshot without worry.\u00a0 But having been burned twice, I retained the caution in our training guides about ever running the sequencer prior to taking the snapshot.\u00a0\u00a0 I didn&#8217;t have any reason for doing so, but until I hear Microsoft explain that they moved the GUID generation to the package save phase of the sequencer (which I don&#8217;t believe they have done), I have an uneasy acceptance that I won&#8217;t see duplicate GUIDs again.<\/p>\n<p><strong>Third Visitation<\/strong><\/p>\n<p>One of the new and neat features in 4.6 SP1 of the App-V Sequencer is the Template feature.\u00a0 Many think of this as nothing more than the ability to save the sequencer configuration into an XML based file (which ends with the SPRT file extension), but at least in this release you can include <em>almost<\/em> all of the settings that you would like in the file.\u00a0 A registry setting (which you can set in the options settings dialog of the sequencer) tells the sequencer to use this file.<\/p>\n<p>If you start the sequencer and use the options dialog you can set many parameters, save off this file on the sequencer and register to use it.\u00a0 Shutdown the sequencer, take your snapshot.\u00a0 This process works reasonably well and <em>does not<\/em> seem to cause duplicate GUIDs.<\/p>\n<p>But that process includes default settings for some things that you might want in the file.\u00a0 So you either need to manually edit, or to create a dummy package in order to get to the &#8220;Sequence Editor&#8221; to set these options.\u00a0 As we will see, this can lead to issues if you are not careful.<\/p>\n<p>I believe that in the long run, you probably want a couple of these Template files for your environment.\u00a0 You will have a standard one that you use for most of your applications, and an alternate one or two as you see the need.\u00a0 Standardizing on a template is an important act.\u00a0 It will (help to) ensure that multiple packagers follow the same basic settings.\u00a0 If you outsource any sequencing, insisting that the outsourcer use your template will replace about 10 pages of documentation on how you want things packaged, and reduce errors where they don&#8217;t follow that documentation exactly.\u00a0 You probably end up with more than one in the long run because not every app will be right for that template.\u00a0 An obvious candidate will be a template that allows use of the Windows Update during sequencing.\u00a0 Windows Live applications, for example, need Windows Update to install (yes, there are ways around this, but why bother?).\u00a0 64-bit applications might be another candidate.<\/p>\n<p>Any way, what I recommend is creating these template files and copying them to the desktop of the sequencer before taking the snapshot.\u00a0 To be clear, what I recommend is making these template files and copying them off somewhere safe like a file share, reverting your VM with the sequencer, copying the files to the desktop and taking a snapshot.<\/p>\n<p>We had someone in the class run the sequencer to create a dummy package (no installation, for example), to get to the sequence editor, set the final options he wanted, which included which target OSs, and save this off.\u00a0 [Note: you can only specify these OS&#8217;s as a restriction, there remains no way for you to specify &#8220;any OS&#8221; using the template].\u00a0 This person then saved the template file directly to the desktop and took a snapshot.\u00a0 This was technically a dirty machine since a package was partially created, but it was a test lab and should be OK.<\/p>\n<p>And I think it would have been OK, as long as he started the sequencer from the start menu.\u00a0 But he did as I suggested, that is to start the sequencer by double clicking on the template file on the desktop.\u00a0 This launches the sequencer and skips a dialog since it already knows he wants to sequence a new app using this template.<\/p>\n<p>This person created a package (call it &#8220;Package A)&#8221; by double clicking the template and deployed it using SCCM.\u00a0 OK so far.\u00a0 He reverted his sequencer VM, created a different package (&#8220;Package B&#8221;) by launching from the start menu (because we were doing a middleware package for DSC), then deployed using SCCM.\u00a0 Still OK.\u00a0 He then revered his sequencer VM and created another package (&#8220;C&#8221;) by double clicking on the template file.\u00a0 When he tried to deploy using SCCM, the SCCM advertisement failed.\u00a0<\/p>\n<p>Whenever a problem like this crops up in one of our classes, we get everyone involved in the troubleshooting.\u00a0 I believe this is one of the really great things about our classes.\u00a0 To solve these issues, you really have to apply everything you learned about how things work in an unscripted way.\u00a0 By thinking through deployment issues you really reinforce the techniques we teach and all of that background about what is happening behind the scenes.<\/p>\n<p>The error code captured by SCCM wasn&#8217;t terribly helpful about why it failed.\u00a0\u00a0\u00a0 So we looked to the SCCM log files &#8211; the first place to look when an SCCM deployment fails.\u00a0 We could see that the sftmime command had been run and failed with an uninteresting failure code.\u00a0 Checking the App-V Client log, we were surprised to find it\u00a0contained no information about the sftmime failure at all.\u00a0 We checked the SCCM cache to ascertain if all of the files had been correctly copied down by BITS, and found that they were.\u00a0 So we copied the sftmime command from the SCCM log file and ran it by hand.<\/p>\n<p>We received an error from SFTMIME that the registration failed and a usable App-V error code.\u00a0\u00a0 This error led most of the people involved to guess\u00a0either that the App-V client was messed up and needed a reboot, or that the package was just bad.\u00a0 I smelled the stench of an old friend.<\/p>\n<p>We opened up the OSD of the package we wanted to deploy and located the package GUID (not to be confused with the package version GUID or the OSD GUID; this is the one on the CODEBASE line).\u00a0 Next, we went to the client Windows Registry.\u00a0 Looking at the local machine registry hive under the App-V client, there is a &#8220;Packages&#8221; key.\u00a0 Under this key will be a key with the GUID of every packaged added to the client.\u00a0 Here, we found a GUID that matched the package GUID that we were trying to add.\u00a0 Under that GUID, we could see that the OriginalURL registry item was pointing to a different SFT file, the one from &#8220;Package A&#8221;.\u00a0\u00a0 We had managed to create a second package using the same GUID!<\/p>\n<p>The cause appears not to be anything inside the SPRT file itself, but in what the sequencer is doing when we launch the sequencer using the template file.\u00a0 Therefore the advice remains:\u00a0 <strong><span style=\"color: #ff4040; font-size: large;\">Do NOT launch the sequencer before taking your snapshot<\/span><\/strong>.<\/p>\n<hr \/>\n<p><strong>Update:<\/strong><\/p>\n<p>Fellow MVP Nicke Kallen hosted and helped to teach the mentioned class.\u00a0 He reopened the VMs used and reconstructed the errors, which I did not have available to me back home.\u00a0 You can find these on his blog here:\u00a0 \u00a0<a href=\"https:\/\/www.viridisit.se\/eng\/blog\/?p=921\">https:\/\/www.viridisit.se\/eng\/blog\/?p=921<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We held our first training class on Microsoft App-V 4.6 SP1 last week in Malmo, Sweden.\u00a0 During the class, we ran into an &#8220;old friend&#8221; that entered the room using a new disguise.\u00a0 Although we thought he died, our friend the duplicate GUID still lives on.\u00a0 To explain&#8230; When application packages are sequenced with App-V,&hellip; <a class=\"more-link\" href=\"https:\/\/www.tmurgent.com\/TmBlog\/?p=362\">Continue reading <span class=\"screen-reader-text\">App-V 4.6 SP1: Saga of the duplicate GUID (continued)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[36,35,48],"tags":[4,17,13],"class_list":["post-362","post","type-post","status-publish","format-standard","hentry","category-all","category-appv4","category-sequencing","tag-app-v","tag-guid","tag-sequencing","entry"],"_links":{"self":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=362"}],"version-history":[{"count":8,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":1470,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions\/1470"}],"wp:attachment":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}