1 2 Previous Next 15 Replies Latest reply: Nov 8, 2013 8:53 AM by joebaggadonuts RSS

    Windows could not parse or process unattend answer file

    Rookie

      I am using OSD to deploy Windows 7 Enterprise (captured following Best Known Method guidelines fo Windows 7) I'm using ImageW v2.

       

      The problem I'm having is odd and is really frustrating as it is intermittent.

       

      After the image has copied down and C:\windows\System32\sysprep\sysprep.exe /oobe /generalize /reboot has run from the auditUser pass, I get a message saying "Windows could not parse or process unattend answer file [C:\Windows\Panther\Unattend.xml]. The answer file is invalid."

       

      When I boot into WinPE and open a command prompt (to look at the drive) I can see the Unattend.xml file present at C:\Unattend.xml however there is also a 0 byte Unattend.xml file at C:\Windows\Panther.

       

      Some times the file in C:\Windows\Panther is only 40-50 bytes and when I open it with Notepad only the first three or so lines are present (partial copy).

       

      The odd part is I can successfully build the computer a handful of times and then the next time get the error and then the next time have it work without making any changes... NOTE: When I get it to build successfully, the correct Unattend.xml file exists in C:\Windows\Panther

       

      The only workaround I have is to re-create the OSD task (therefore generating a new XML file) and make the neccessary modifications I need to it e.g. CopyProfile setting, WindowsFeatures setting etc... I can deploy the image ok a handful of times and then the problem returns...

       

      Is it possible for an XML file to become corrupted? Is there a log file I can review to see why it isn't downloading properly?

       

      Any suggestions are much appreciated.

        • 1. Re: Windows could not parse or process unattend answer file
          EMiranda Expert

          I have seen in other posts, that the default LANDesk .xml that gets created when doing it through the console was having some issues with certain passes.  To remedy they created their own .xml from the Windows System Image Manager (from WAIK) and point to that one instead of having one created by LANDesk.

          • 2. Re: Windows could not parse or process unattend answer file
            Rookie

            This is something I've been curious about as there are several differences between a LANDesk generated Unattend.xml and one created using WISM...

             

            1. unattend xmlns="urn:schemas-microsoft-com:unattend" is replaced in LANDesk with simply unattend

            2. xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" is inconsistently left off the end of the component name tag

            3. Catalog info is not present in LANDesk unattend file: cpi:offlineImage cpi:source="catalog:e:/waik 2.0/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi"

             

            These differences prevent WISM from being able to open an XML file created by LANDesk. I haven't taken an unattend created with WISM and used it in LANDesk as wasn't sure if this was supported.

             

            In any case my unattend file is valid and does successfully process all passes (if it is copied to down to the pc in full).

             

            I've tried the Background Intelligent Transfer Service (BITS) enabled and disabled, however this didn't make any difference. My core server is Windows 2008 R2 64-bit.

             

            I've also tried modifying the entries in the imagename.ini file:

             

            RemoteSysPrepCopyPath=c:\unattend.xml (to be C:\WINDOWS\Panther\Unattend.xml)

            REMEXEC32=ldrun sdclient /f /o /dest="C:\unattend.xml" /p="http://%CUSTJOBHOSTIP%/landesk/files/ImageName.xml", STATUS (to be C:\WINDOWS\Panther\Unattend.xml)

             

            This also did not work.

             

            I'm keen to get some logging to understand what's happening in the background...

            • 3. Re: Windows could not parse or process unattend answer file
              EMiranda Expert

              Your sysprep logs are here:

               

              Generalize - %WINDIR%\System32\Sysprep\Panther

              Specialize - %WINDIR%\Panther

              Setup actions - %WINDIR%\Panther\Unattendgc

               

               

              you might be able to find out why you are getting the error "Windows could not parse or process unattend answer file [C:\Windows\Panther\Unattend.xml]. The answer file is invalid."

              • 4. Re: Windows could not parse or process unattend answer file
                Rookie

                I'm sorry for the confusion, this is not a problem with Sysprep parsing the unattend file but rather LANDesk not copying Unattend.xml file from the core server down to the pc.

                 

                The error occurs because Unattend.xml is 0 bytes in size i.e. an empty file

                • 5. Re: Windows could not parse or process unattend answer file
                  steve49423 Apprentice

                  OSD will be using an http file download to copy the xml file onto the device you're imaging while its in Winpe.  Have a look at your IIS log file and find the entry in there for the xml - it should show a status of 200 0 0.  If the status is anything else it the problem could be IIS related...

                   

                  Steve

                  • 6. Re: Windows could not parse or process unattend answer file
                    Rookie

                    Here are the relevant lines from the IIS log file from last Friday... they are all 200 0 0 but the last number changes. Do you know what it is?

                     

                    2011-01-14 09:43:43 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 792-LANDeskDownloader 200 0 0 203
                    2011-01-14 09:43:45 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 792-LANDeskDownloader 200 0 0 8
                    2011-01-14 10:07:05 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 1016-LANDeskDownloader 200 0 0 202
                    2011-01-14 10:07:06 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 1016-LANDeskDownloader 200 0 0 8
                    2011-01-14 12:34:01 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 1832-LANDeskDownloader 200 0 0 196
                    2011-01-14 12:34:03 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 1832-LANDeskDownloader 200 0 0 7
                    2011-01-14 13:01:00 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 872-LANDeskDownloader 200 0 0 196
                    2011-01-14 13:01:02 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 872-LANDeskDownloader 200 0 0 7
                    2011-01-14 14:04:38 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 940-LANDeskDownloader 200 0 0 196
                    2011-01-14 14:04:40 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 940-LANDeskDownloader 200 0 0 7
                    2011-01-14 14:56:38 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 892-LANDeskDownloader 200 0 0 203
                    2011-01-14 14:56:39 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 892-LANDeskDownloader 200 0 0 7
                    2011-01-14 16:27:03 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 324-LANDeskDownloader 200 0 0 202
                    2011-01-14 16:27:04 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 324-LANDeskDownloader 200 0 0 7
                    2011-01-14 16:57:37 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 556-LANDeskDownloader 200 0 0 198
                    2011-01-14 16:57:38 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 556-LANDeskDownloader 200 0 0 7
                    2011-01-14 17:20:54 10.4.2.43 HEAD /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 644-LANDeskDownloader 200 0 0 202
                    2011-01-14 17:20:56 10.4.2.43 GET /landesk/files/External+Laptop+Dell+E4310.xml - 80 - 10.4.30.43 644-LANDeskDownloader 200 0 0 9

                    • 7. Re: Windows could not parse or process unattend answer file
                      Rookie

                      Just to add to this I've also restarted the core server (as it has been up for 2 months without a restart) and I've re-created the OSD task with no spaces in the name (not sure if this is relevant or not but noticed that the HTTP download adds the %20 character for spacing).

                      • 8. Re: Windows could not parse or process unattend answer file
                        Rookie

                        Unfortunately the OSD task name is irrelevant. No change after the core server restart either...

                        • 9. Re: Windows could not parse or process unattend answer file
                          EMiranda Expert

                          it seems you are having a problem with IIS for the http download.  As a temporary solution, you could not use http at all.  Just put your xml file on the share where your image or imaging tool is.  You already map to them during the process and just do a good ole copy or move command

                           

                           

                          REMEXEC42=cmd /c move /y i:\imagedirectory\Unattend.xml c:\windows\panther
                          
                          • 10. Re: Windows could not parse or process unattend answer file
                            Rookie

                            I've added this to the OSD script as suggested and the reliability is a lot better. Can you advise which lines I should remove if any?

                             

                            REMEXEC31=ldrun x:\cba8\FixWindows.exe
                            REMEXEC32=cmd /c copy /y i:\laptop\E4310\SYSPREPD\Unattend.xml c:\windows\panther
                            REMEXEC33=ldrun sdclient /f /o /dest="C:\unattend.xml" /p="http://%CUSTJOBHOSTIP%/landesk/files/ImageNameUnattend.xml", STATUS
                            REMEXEC34=ldrun sdclient /f /o /dest="C:\ldsleep.exe" /p="http://%CUSTJOBHOSTIP%/landesk/files/ldsleep.exe", STATUS
                            REMEXEC35=ldrun tokreplw C:\unattend.xml COMPUTERNAME=%Computer - Device Name%

                             

                            I've only seen the problem occur twice since adding this copy command.

                            • 11. Re: Windows could not parse or process unattend answer file
                              EMiranda Expert

                              seems as if REMEXEC32 and 33 are redundant and 33 is not needed. I would also change the path to the tokreplw with the unattend.xml that you are actually using.

                               

                              If you are using your own sysprep, really no need to copy down another one.

                               

                              REMEXEC31=ldrun x:\cba8\FixWindows.exe
                              REMEXEC32=cmd /c copy /y i:\laptop\E4310\SYSPREPD\Unattend.xml c:\windows\panther
                              REMEXEC33=ldrun sdclient /f /o /dest="C:\ldsleep.exe" /p="http://%CUSTJOBHOSTIP%/landesk/files/ldsleep.exe", STATUS
                              REMEXEC34=ldrun tokreplw C:\windows\panther\unattend.xml COMPUTERNAME=%Computer - Device Name%

                              • 12. Re: Windows could not parse or process unattend answer file
                                Apprentice

                                I was having this issue yesterday and I found this thread. I saw it wasn't answered so I wanted to share with you how [I think] I fixed this.

                                 

                                In my Image deployment script, I filled out all of this sysprep stuff so that landesk would create the unattend.xml file.

                                I took the deployment-script-name.xml, copied it to the share where my images are stored and renamed it unattend.xml

                                Then, in the Pre-Boot Commands section or the deployment script, in the "Enter commands to run before the device is rebooted and imaged" section I entered in: copy "I:\HII\unattend.xml" "c:\windows\panther"

                                 

                                This copies the unattend.xml file from my image share to the panther directory in c:\windows. The next time I tried to deploy the image it worked. Maybe this will help someone else out.

                                 

                                EDIT: nvm, apparently this doesn't work 100% of the time either. oh well. it was worth a shot

                                • 13. Re: Windows could not parse or process unattend answer file
                                  Rookie

                                  I was getting this same error but it turned out that the computer name I had chosen was to long for the Unattend File.

                                  • 14. Re: Windows could not parse or process unattend answer file
                                    dbozic Rookie

                                    Could you check your encoding of working/not working unattend.xml files ?

                                    unattended_bom_problem.PNG

                                     

                                    The shown image is the same Unattend.xml content ! One (left side) saved with no BOM, the right side saved with BOM (in many editors regrettably the default). Left side works, right side not. For BOM just check http://en.wikipedia.org/wiki/UTF-8#cite_note-26 .

                                    At the beginning it was also to me "a bit strange" that the same file with the same content sometimes works and sometimes not...... I hope that this point helps to solve your problem.

                                     

                                    Damir

                                    1 2 Previous Next