The USMT team blog

Tips and tricks on using the User State Migration Tool

How to debug a USMT log like a Pro

How to debug a USMT log like a Pro

  • Comments 2
  • Likes

The Scanstate and Loadstate logs contain a wealth of information on each problem that is encountered, however it does take a little bit of work to root cause a problem.  For example, lets take a look at an example.  A few weeks ago our team got an email from someone who was finding that Scanstate would fail every time they tried to create a migration store to an external hard drive.  At the end of the log, the following lines appeared:

> Error                 [0x000000] Unable to Complete Migration. MigDoMigration Failed= 0x4
> Error                 [0x000000] Migration failed to complete successfully

Not particularly helpful, right?  I imagine that the person running Scanstate already knew that the migration failed since they were bothering to look at the log in the first place.  However, if you scroll up a few lines in the log, the real cause of the migration failure can be found:

> Error                 [0x000000] Unable to process object C:\Documents and Settings\userA\Desktop\dvd.iso -> 733, aborting...
> Error                 [0x000000] USMT is shutting down due to errors. If the error is non-fatal, you can use /c to ignore these errors and continue migration.
> Error                 [0x0802e9] CopyStream: Can't copy streams from {"C:\Documents and Settings\userA\Desktop\dvd.iso"} to {"733"} object. Error 112. Exception class UnBCL::IOException: unable to write to FileStream.
enum Mig::SendObjectResult __thiscall Mig::CMediaManager::SendObjectInternal(class UnBCL::Stream *,const unsigned short *,const unsigned short *,int)
void __thiscall UnBCL::FileStream::Write(const unsigned char *,int,int)

These lines are much more helpful that the first two that we looked at.  The first line in this section lets us know that the problem was encountered while trying to process the dvd.iso file.  This narrows the problem space greatly.  The next line lets us know that we might be able to skip this error if it is non-fatal.  Although the last line contains a great deal of information only really relevant to a developer, it also contains the final hint we need to root cause this problem.  Lets take this step by step and break the final line into to five pieces:

    1. Error                 [0x0802e9]
    2. CopyStream: Can't copy streams from {"C:\Documents and Settings\userA\Desktop\dvd.iso"} to {"733"} object.
    3. Error 112.
    4. Exception class UnBCL::IOException: unable to write to FileStream.
    5. enum Mig::SendObjectResult __thiscall Mig::CMediaManager::SendObjectInternal(class UnBCL::Stream *,const unsigned short *,const unsigned short *,int)
      void __thiscall UnBCL::FileStream::Write(const unsigned char *,int,int)

We can immediately discard parts1, 2, and 5 as they either contain information that we already know or that is far to detailed to help us.  However, parts 3 and 4 are really telling.  Part 4 lets us know that the problem wasn't while accessing dvd.iso, but rather while trying to write dvd.iso to the migration store.  Part 3 contains the immediate reason why dvd.iso couldn't be written, however the reason is encoded in the form of a numerical error message.  Thankfully, the command line application net can translate the numerical error message into a textual error message for us:

C:\>net helpmsg 112

There is not enough space on the disk.

Piecing this all together we can surmise that dvd.iso couldn't be written to the migration store because there wasn't enough space on the external hard drive it was being written to.  Although this would typically be the end of a USMT log root cause exercise, there happened to be one final twist to this particular problem.  The external hard drive showed that it had many, many, gigabytes of free space.

How can this be?  Doesn't this contradict the message above?  Some quick thinking on the part of my test colleague got to the actual root cause which dealt with the filesystem used on the external hard disk.  Every storage device utilizes a filesystem to organize the data that it contains.  Currently, the two most commonly used filesystems developed by Microsoft are FAT32 and NTFS.  Every filesystem has limits in regards to the number of files and size of files that it can support, but FAT32, developed for Windows 95 OSR2 in August 1996, has some antiquated limits.  Namely, FAT32 cannot support any single file being larger than 4 GB.  In this case, adding dvd.iso to the migration store pushed the migration store up against the 4 GB limit of FAT32 and triggered the sequence of errors that we just walked through.  The user reformatted the external drive to be NTFS and the migration completed successfully.

The key thing to take away from this post is to always look for "Error ##" in a Scanstate or Loadstate log when a problem is encountered, and feed that number through "net helpmsg."  Note, it may be necessary to turn the logging verbosity all the way up for the best debugging experience (/v:13 on the Scanstate and Loadstate command line).

Comments
  • This post stimulated an idea which will hopefully solve a problem we've had on a specific user migration (Vista to Vista). The Loadstate log ended with a "USMT error Code (status) = 41" but unfortunately that number is not included in NET HELPMSG:

    ("C:\>net helpmsg 41

    41 is not a valid Windows network message number.")

    The Loadstate log showed a warning early on that the NTUSER.DAT file for the specified user was "incomplete" and so it was skipped. I'm wondering if there's some way to verify stuff like this during Scanstate? And would using the /c switch have helped any in this situation?

  • I have a list of error codes that are custom to USMT for return codes.

    ERROR_USMT_SUCCESS 0

    ERROR_USMT_DISPLAY_HELP 1

    ERROR_USMT_MEMORY_FAIL 2

    ERROR_USMT_INVALID_PARAMETERS 3 // (Bad command line)

    ERROR_USMT_INVALID_STORE_LOCATION 4

    ERROR_USMT_NO_MORE_TOKEN 5

    ERROR_USMT_UNABLE_SET_SCRIPTFILES 6

    ERROR_USMT_UNABLE_GET_SCRIPTFILES   7 // (Can’t find XML file(s) specified in the command-line)

    #define ERROR_USMT_UNABLE_SET_STOREPATH 8

    ERROR_USMT_UNABLE_SET_USERS 9

    ERROR_USMT_UNABLE_FINDMIGUNITS 10

    ERROR_USMT_UNABLE_DOMIGRATION   11 // (A file is in use)

    ERROR_USMT_FAILED_MIGSTARTUP   12 // (Error in XML file ‘Bad XML’)

    ERROR_USMT_FAILED_SETMIGRATIONTYPE 13

    ERROR_USMT_FAILED_LOCALONLY 14

    ERROR_USMT_UNABLE_GET_WORKINGDIR 15

    ERROR_USMT_UNABLE_SETKEY 16

    ERROR_USMT_UNABLE_READKEY 17

    ERROR_USMT_TOO_LONG_KEYSTRING 18

    ERROR_USMT_UNABLE_SETCOMPRESSION 19

    ERROR_USMT_ERROR_INSUFFICIENT_RIGHTS 20

    ERROR_USMT_UNABLE_DELETE_STORE 21

    ERROR_USMT_UNABLE_SET_BENONADMIN 22

    ERROR_USMT_ERROR_INSUFFICIENT_STRINGBUFFER 23

    ERROR_USMT_ERROR_UNSUPPORTED_PLATFORM 24

    ERROR_USMT_ERROR_UNABLE_TOVERIFY_PLATFORM 25

    ERROR_USMT_UNABLE_SET_EFSMODE 26

    ERROR_USMT_INIT_ERROR 27

    ERROR_USMT_UNABLE_SET_LAC_LAE 28

    ERROR_USMT_ERROR_CORRUPTED_ENCRYPTED_STORE   29 // (Store is encrypted and no or invalid key has been specified)

    ERROR_USMT_ERROR_NO_INVALID_KEY                       30 // (Store is only compressed but a key has been specified)

    ERROR_USMT_ERROR_CORRUPTED_NOTENCRYPTED_STORE 31

    ERROR_USMT_ERROR_LOGFILES_INSIDESTORE 32

    ERROR_USMT_INVALID_PLATFORM_FOR_TARGETXP 33

    ERROR_USMT_STORE_VALID_ONLY_FOR_XP 34

    ERROR_USMT_UNABLE_TO_READ_CONFIG_FILE 35

    ERROR_USMT_INVALID_CONFIG_FILE_FORMAT 36

    ERROR_USMT_ERROR_UNABLE_CREATE_LOGS 37

    ERROR_USMT_ERROR_USE_LAC 38

    ERROR_USMT_FAILED_TO_EXCLUDE_FOLDERS 39

    ERROR_USMT_ERROR_UNABLE_CREATE_PROGRESS_LOG 40

    ERROR_USMT_STATUS_CANCELLED 41

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment