We are currently running FSLogix 2.9.8228.50276 and we are experiencing an issue where users will be working in our Citrix environment when their FSLogix VHD will be disconnected from their session on the server and the screens will go black. The user is unable to log back into our environment until I have logged off their session. It appears that the profile is being marked as Stale when it is still in use and causing users to lose work. Has anyone experienced this and is there anyway we can stop this happening?
I have investigated in Event Viewer and often we will see events such as the one below.
![261444-image.png](https://learn-attachment.microsoft.com/api/attachments/261444-image.png?platform=QnA)
When I look into the FSLogix logs we can see entries like this to coincide with the user’s profile being disconnected.
[16:24:51.275][tid:00000d44.00006960][INFO] ===== Begin Session: Finding stale sessions that required cleanup
[16:24:51.321][tid:00000d44.0000f728][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\LogonSyncMutexTimeout. Using default: 60000
[16:24:51.321][tid:00000d44.0000f728][INFO] Acquired check session lock for user firstname.surname (SID=S-1-5-21-868630427-296683619-1714775081-2546) (Elapsed time: 0)
[16:24:51.321][tid:00000d44.0000f728][INFO] Session configuration read (DWORD): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\WindowsSessionID = '23'
[16:24:51.336][tid:00000d44.0000f728][INFO] ===== End Session: Finding stale sessions that required cleanup
[16:24:51.397][tid:00000d44.00006960][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\LogonSyncMutexTimeout. Using default: 60000
[16:24:51.397][tid:00000d44.00006960][INFO] Acquired check session lock for user firstname.surname (SID=S-1-5-21-868630427-296683619-1714775081-2546) (Elapsed time: 0)
[16:24:51.397][tid:00000d44.00006960][INFO] Session configuration read (DWORD): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\WindowsSessionID = '23'
[16:24:51.402][tid:00000d44.00006960][INFO] Session configuration read (DWORD): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\LogonStage = '5'(Logon_Complete)
[16:24:51.402][tid:00000d44.00006960][INFO] Session configuration read (REG_SZ): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\ActivityId = '03cae63b-1483-4895-b8cb-8dd9364c3c56'
[16:24:51.402][tid:00000d44.00006960][INFO] ===== Begin Session: Stale Session Cleanup, Logoff for: S-1-5-21-868630427-296683619-1714775081-2546
[16:24:51.403][tid:00000d44.00006960][INFO] Session configuration read (REG_SZ): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\Volume = '\?\Volume{08b698d4-3a84-435c-89a5-406470051202}\'
[16:24:51.403][tid:00000d44.00006960][INFO] Session configuration read (DWORD): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\RefCount = '1'
[16:24:51.404][tid:00000d44.00006960][INFO] Outlook cached mode policy rule removed
[16:24:51.404][tid:00000d44.00006960][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\ProfileType. Using default: 0
[16:24:51.573][tid:00000d44.00006960][INFO] Export profile registry info complete
[16:24:51.597][tid:00000d44.00006960][INFO] Session configuration wrote (REG_SZ): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\Volume = ''
[16:24:51.794][tid:00000d44.00006960][INFO] Detached vhd(x)
[16:24:51.794][tid:00000d44.00006960][INFO] VHD(x) Detach request returning after 203 milliseconds
[16:24:51.799][tid:00000d44.00006960][INFO] Session configuration read (REG_SZ): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\Volume = ''
[16:24:51.799][tid:00000d44.00006960][INFO] Session configuration read (REG_SZ): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\Volume = ''
[16:24:51.857][tid:00000d44.00000d48][INFO] Configuration Read (DWORD): SOFTWARE\FSLogix\Profiles\ReAttachRetryCount. Data: 12
[16:24:51.857][tid:00000d44.00000d48][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\ReAttachIntervalSeconds. Using default: 10
Once I log the session off it shows in the logs as below.
[16:54:51.674][tid:00000d44.0000394c][INFO] ===== Begin Session: Profile Directory Changed: S-1-5-21-868630427-296683619-1714775081-2546
[16:54:51.675][tid:00000d44.0000394c][INFO] New Profile Directory: C:\Users\firstname.surname
[16:54:51.675][tid:00000d44.0000394c][INFO] No configuration found for this user
[16:54:51.677][tid:00000d44.0000394c][INFO] ===== End Session: Profile Directory Changed: S-1-5-21-868630427-296683619-1714775081-2546
[16:55:53.374][tid:00000d44.0000ef88][INFO] ===== Begin Session: EndShell
[16:55:53.375][tid:00000d44.0000ef88][INFO] User: S-1-5-21-868630427-296683619-1714775081-2546 (firstname.surname)
[16:55:53.375][tid:00000d44.0000ef88][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\LogonSyncMutexTimeout. Using default: 60000
[16:55:53.375][tid:00000d44.0000ef88][INFO] Acquired end shell lock for user firstname.surname (SID=S-1-5-21-868630427-296683619-1714775081-2546) (Elapsed time: 0)
[16:55:53.376][tid:00000d44.0000ef88][INFO] Session configuration read (DWORD): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\LogonStage = '3'(EndShell)
[16:55:53.591][tid:00000d44.0000ef88][INFO] ===== End Session: EndShell
[16:55:53.711][tid:00000d44.0000ef88][INFO] ===== Begin Session: Logoff
[16:55:53.711][tid:00000d44.0000ef88][INFO] User: S-1-5-21-868630427-296683619-1714775081-2546 (firstname.surname)
[16:55:53.711][tid:00000d44.0000ef88][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\LogonSyncMutexTimeout. Using default: 60000
[16:55:53.711][tid:00000d44.0000ef88][INFO] Acquired logoff lock for user firstname.surname (SID=S-1-5-21-868630427-296683619-1714775081-2546) (Elapsed time: 0)
[16:55:53.711][tid:00000d44.0000ef88][INFO] Session configuration read (DWORD): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\LogonStage = '4'(Logoff)
[16:55:53.711][tid:00000d44.0000ef88][INFO] ===== Begin Session: Unload profile: firstname.surname
[16:55:53.711][tid:00000d44.0000ef88][INFO] User: firstname.surname. SID: S-1-5-21-868630427-296683619-1714775081-2546.
[16:55:53.711][tid:00000d44.0000ef88][INFO] Configuration Read (DWORD): SOFTWARE\FSLogix\Profiles\Enabled. Data: 1
[16:55:53.712][tid:00000d44.0000ef88][INFO] Include group SID: S-1-5-21-1409101879-1675529888-736375463-1000
[16:55:53.712][tid:00000d44.0000ef88][INFO] Exclude group SID: S-1-5-21-1409101879-1675529888-736375463-1001
[16:55:53.712][tid:00000d44.0000ef88][INFO] User is a member of the include group
[16:55:53.712][tid:00000d44.0000ef88][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\IgnoreNonWVD. Using default: 0
[16:55:53.712][tid:00000d44.0000ef88][INFO] Configuration Read (DWORD): SOFTWARE\FSLogix\Profiles\Enabled. Data: 1
[16:55:53.713][tid:00000d44.0000ef88][INFO] Status set to 1: Cannot load user's profile
[16:55:53.713][tid:00000d44.0000ef88][INFO] ErrorCode set to 2 - Message: N/A
[16:55:53.713][tid:00000d44.0000ef88][ERROR:00000002] Settings.cpp(630): [WCODE: 0x00000002] static_read_session_dword: Session configuration setting not found (DWORD): RefCount (The system cannot find the file specified.)
[16:55:53.713][tid:00000d44.0000ef88][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\ShutdownOnUserLogoff. Using default: 0
[16:55:53.713][tid:00000d44.0000ef88][INFO] Configuration setting not found: SOFTWARE\FSLogix\Profiles\RebootOnUserLogoff. Using default: 0
[16:55:53.713][tid:00000d44.0000ef88][ERROR:00000002] UnloadProfile failed. Version: 2.9.8228.50276. User: firstname.surname. SID: S-1-5-21-868630427-296683619-1714775081-2546. SessionId: 23. FrxStatus: 2 (The system cannot find the file specified.)
[16:55:53.713][tid:00000d44.0000ef88][INFO] unloadProfile time: 0 milliseconds
[16:55:53.714][tid:00000d44.0000ef88][INFO] ===== End Session: Unload profile: firstname.surname
[16:55:53.714][tid:00000d44.0000ef88][INFO] Session configuration read (DWORD): SOFTWARE\FSLogix\Profiles\Sessions\S-1-5-21-868630427-296683619-1714775081-2546\LogonStage = '6'(Logoff_Complete)
[16:55:53.714][tid:00000d44.0000ef88][INFO] ===== End Session: Logoff