Forum Discussion

GuidoRacamato's avatar
GuidoRacamato
Copper Contributor
Jun 25, 2024

Error copying profile (0x00000001): Incorrect function.

The latest version of FSLogix is experiencing problems with the  command: frx copy-profile

C:\Program Files\FSLogix\Apps>frx copy-profile -filename d:\temp\Profile_test.vhdx -username test -size-mbs=30720 -dynamic=1 label=profile-test-verbose
User test" SID is "S-1-5-21-2971068368-244597684-1576390238-2601"
Volume Label: profile-test
Session count: 6
Found user:
Found user: 
Found user: test
Found user:
Found user:
Found user:
VHD not found. Creating...
Create success. Attaching...
Attach success. Getting physical path...
Get physical path success. Opening device...
Open device success. Initializing disk...
Initialize disk success. Getting volume name...

.
Formatting volume: \\?\Volume{5bc41fa6-5d2b-4389-99de-f4306343069c}\
Format success
GetSecurityDescriptor success
GetDACL success
Set security success
Copying profile for user S-1-5-21-2971068368-244597684-1576390238-2601 to volume \\?\Volume{5bc41fa6-5d2b-4389-99de-f4306343069c}\
Looking for Profile Path in registry
CopyProfileToVolume SID: S-1-5-21-2971068368-244597684-1576390238-2601 Volume: \\?\Volume{5bc41fa6-5d2b-4389-99de-f4306343069c}\ profileImagePath: C:\Users\test
Exporting registry information
Export Profile registry data error: 0x00000001
Error copying profile (0x00000001): Incorrect function.

 

After downgrading to version 2.9.8612.60056, I was able to migrate the local profile. However, the command needed to be run twice because the first attempt resulted in an error:

Export Profile registry data error: 0x00000002
Error copying profile (0x00000002): The system cannot find the file specified.

 

 

    • GuidoRacamato's avatar
      GuidoRacamato
      Copper Contributor
      I've confirmed that there's no AV (antivirus) in place. I've also managed to reproduce this issue in at least three different environments.
      • thejohnpeachey's avatar
        thejohnpeachey
        Copper Contributor

        We are using Sophos, but I believe the issue is that when the registry file is created the file is not written/closed when it tries to back it up and copy it. The reason I believe this is because when you run it the second time, it backs up the one that did get written (you can remove some entries in order to change the file and this is the one that gets backed up), then a new file like the original is written. So the logic at this stage needs reviewing. I could spend more time running some tools to confirm this, but really after giving Microsoft this much information you should be able to go and fix it. We believe in the community and would very much appreciate you looking into this issue and ideally fixing it and rolling out an update 5 version of FS Logix. What we are having to do right now is perform the migration with version 2, then upgrade to version 4 post migration. Thanks to Gonzalo Reyna for looking further into this and to Guido Racamato for providing further information. Best wishes to everyone 🙂

  • thejohnpeachey's avatar
    thejohnpeachey
    Copper Contributor
    Thanks Guido. I was also suffering this problem. After further investigation what happens is that on the first run a folder is created in the users localappdata\FSLogix\ profile containing a registry file. It looks like there may be some race condition for the exporting of this file. On the second run, with this file present, the file is successfuly exported and a .bak file is also created containing the same file size. If you change the contents of the registry file in LocalAppdata\FSLogix,, it recreates the original registry file and leaves a backup of the wrong file size. I don't know what is exported. Thanks for being part of the community 🙂