FSLogix - StaleSessionCleanup disconnecting active VHD profiles

AndrewEnsors 1 Reputation point
2022-11-17T12:23:53.113+00:00

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

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

FSLogix
FSLogix
A set of solutions that enhance, enable, and simplify non-persistent Windows computing environments and may also be used to create more portable computing sessions when using physical devices.
475 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dirk 1 Reputation point
    2022-12-06T14:55:02.677+00:00

    Hi,
    i have no solution , but a similar problem. We are running a RDS Host with Server 2019 and the User Desktops gettings blank during work. They have to logoff and logon and sometimes it works after this. But sometimes they have to repeat this several times.

    We have the same FSLogix 2.9.8228.50276 version running


  2. Brent Bishop 0 Reputation points Microsoft Employee
    2023-01-24T21:36:59.1966667+00:00

    If you are having this issue then turn off the CleanUpInvalidSessions key (i.e. set = 0). This key is only for extraordinary circumstances when for example the host machine has crashed. Normal operation does not need this key turned on. If the machine does crash and have issues, then turn the key on and leave it on for a day or two. Then turn it off again.

    Also note that when the key is set to off, you will probably need to reboot the machine OR log every FSLogix user off and restart the FSLogix service to get the CleanUpInvalidSessions feature to turn off.