ViewStateSync process does not run properly

Server Version#: 1.41.0.8994
Version: Docker, arm64
Hardware: Raspberry Pi 4

Hello,
My Plex instance refuse to sync any content since Aug 21st 2024. Scrobbles are not registered to my Plex profile, and it won’t sync watch states between server (it will not receive watched status if I watch from another server, it will not set watched on the other server if I watch on line).

If I watch content on somebody else’s server it will appear in my profile.
Sync Watch State is ON in settings.

My logs (Plex Media Server.log) shows (This is the only instance of ViewStateSync appearing over the 5 log files):

Oct 17, 2024 13:39:34.199 [547586707680] DEBUG - [ViewStateSync] Starting
Oct 17, 2024 13:39:34.199 [547586707680] DEBUG - [ViewStateSync] Fetching user tokens
Oct 17, 2024 13:39:34.200 [547586707680] DEBUG - [ViewStateSync/HCl#4f] HTTP requesting GET https://plex.tv/api/v2/server/users/services?auth_token=xxxxxxxxxxxxxxxxxxxx
Oct 17, 2024 13:39:34.477 [547584557280] DEBUG - [HttpClient/HCl#4f] HTTP/1.1 (0.3s) 200 response from GET https://plex.tv/api/v2/server/users/services?auth_token=xxxxxxxxxxxxxxxxxxxx
Oct 17, 2024 13:39:34.481 [547575509216] DEBUG - [ViewStateSync] Got token for user 1 (jean_francois)
Oct 17, 2024 13:39:34.481 [547575509216] DEBUG - [ViewStateSync] Got token for user 26346633 (FRIEND1)
Oct 17, 2024 13:39:34.481 [547575509216] DEBUG - [ViewStateSync] Got token for user 70378230 (PARTNER)
Oct 17, 2024 13:39:34.481 [547575509216] DEBUG - [ViewStateSync/HCl#50] HTTP requesting GET https://plex.tv/api/v2/server/users/15458/view_state_sync
Oct 17, 2024 13:39:34.520 [547584557280] DEBUG - [HttpClient/HCl#50] HTTP/1.1 (0.0s) 200 response from GET https://plex.tv/api/v2/server/users/15458/view_state_sync (reused)
Oct 17, 2024 13:39:34.521 [547575509216] ERROR - Promise destroyed without handling exception: %s

In comparison, my partner’s server (on M1 Mac, latest Plex version) shows:

Oct 17, 2024 09:38:34.721 [0x16baf3000] DEBUG - [Req#6b825/ViewStateSync] Starting
Oct 17, 2024 09:38:34.721 [0x16baf3000] DEBUG - [Req#6b825/ViewStateSync] Fetching user tokens
Oct 17, 2024 09:38:34.722 [0x16baf3000] DEBUG - [Req#6b825/ViewStateSync/HCl#1f60] HTTP requesting GET https://plex.tv/api/v2/server/users/services?auth_token=xxxxxxxxxxxxxxxxxxxx
Oct 17, 2024 09:38:34.878 [0x16c29b000] DEBUG - [HttpClient/HCl#1f60] HTTP/1.1 (0.2s) 200 response from GET https://plex.tv/api/v2/server/users/services?auth_token=xxxxxxxxxxxxxxxxxxxx
Oct 17, 2024 09:38:34.886 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Got token for user 1 (PARTNER)
Oct 17, 2024 09:38:34.886 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Got token for user 15458 (ME)
Oct 17, 2024 09:38:34.886 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync/HCl#1f61] HTTP requesting GET https://plex.tv/api/v2/server/users/70378230/view_state_sync
Oct 17, 2024 09:38:34.993 [0x16c29b000] DEBUG - [HttpClient/HCl#1f61] HTTP/1.1 (0.1s) 200 response from GET https://plex.tv/api/v2/server/users/70378230/view_state_sync (reused)
Oct 17, 2024 09:38:34.993 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Starting for user 1
Oct 17, 2024 09:38:34.993 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Sending state
Oct 17, 2024 09:38:34.993 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] All state sent
Oct 17, 2024 09:38:34.994 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Getting state
Oct 17, 2024 09:38:34.994 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync/HCl#1f62] HTTP requesting GET https://scrobbles.plex.tv/state/70378230?after=MTcyOTAzODAxMDA5My02NzBmMDZiYTdiZDA0ZGE1YmUyZGUzNzU%3D&count=100
Oct 17, 2024 09:38:35.166 [0x16c29b000] DEBUG - [HttpClient/HCl#1f62] HTTP/2.0 (0.2s) 200 response from GET https://scrobbles.plex.tv/state/70378230?after=MTcyOTAzODAxMDA5My02NzBmMDZiYTdiZDA0ZGE1YmUyZGUzNzU%3D&count=100
Oct 17, 2024 09:38:35.166 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Reading 0 states
Oct 17, 2024 09:38:35.166 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Done getting states
Oct 17, 2024 09:38:35.167 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync/HCl#1f63] HTTP requesting GET https://plex.tv/api/v2/server/users/15458/view_state_sync
Oct 17, 2024 09:38:35.213 [0x16c29b000] DEBUG - [HttpClient/HCl#1f63] HTTP/1.1 (0.0s) 200 response from GET https://plex.tv/api/v2/server/users/15458/view_state_sync (reused)
Oct 17, 2024 09:38:35.213 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Starting for user 15458
Oct 17, 2024 09:38:35.213 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Sending state
Oct 17, 2024 09:38:35.213 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] All state sent
Oct 17, 2024 09:38:35.214 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Getting state
Oct 17, 2024 09:38:35.214 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync/HCl#1f64] HTTP requesting GET https://scrobbles.plex.tv/state/15458?after=MTcyOTAxODg3MjczNS02NzBlYmFmZTdiZDA0ZGE1YmUxNDk5Mjk%3D&count=100
Oct 17, 2024 09:38:35.268 [0x16c29b000] DEBUG - [HttpClient/HCl#1f64] HTTP/2.0 (0.1s) 200 response from GET https://scrobbles.plex.tv/state/15458?after=MTcyOTAxODg3MjczNS02NzBlYmFmZTdiZDA0ZGE1YmUxNDk5Mjk%3D&count=100 (reused)
Oct 17, 2024 09:38:35.268 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Reading 0 states
Oct 17, 2024 09:38:35.268 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Done getting states
Oct 17, 2024 09:38:35.268 [0x16bb7f000] DEBUG - [Req#6b825/ViewStateSync] Finished

Looks like the code doesn’t handle exceptions properly and when it encounters one it’ll not run VSS again until PMS is restarted. I’ll correct this in a future version. Unfortunately it doesn’t indicate what the exception actually is in the current state.

Thank you for getting back to me! Is there anything more you want me to do? Send verbose logs, database etc? I will be keeping an eye on the changes and forward anything that is needed.

Just updated to 1.41.2.9134, and that exception string still isn’t rendering

Nov 04, 2024 16:22:03.118 DEBUG - [ViewStateSync/HCl#7e] HTTP requesting GET https://p
lex.tv/api/v2/server/users/(redacted)/view_state_sync
Nov 04, 2024 16:22:03.290 DEBUG - [HttpClient/HCl#7e] HTTP/1.1 (0.2s) 200 response fro
m GET https://plex.tv/api/v2/server/users/(redacted)/view_state_sync (reused)
Nov 04, 2024 16:22:03.291 ERROR - Promise destroyed without handling exception: %s

Still seeing the same issue in 1.41.2.9200

1 Like

Yes. I’ve spun up another container to run some tests and playback does register on my profile using the newly created server, so there is something wrong in our current Plex database or something similar that is not account based.

Hey there, I’m having constant crashes on my NVIDIA Shield.
The last log line is almost always related to the ViewStateSync.
Could this be related as you say that the code doesn’t handle exceptions properly?

I’ve added the 6 latest log files from the rotation and they always end with ViewStateSync stuff.

Logs.zip (98.5 KB)

@gbooker02 any way you can prioritize fixing the logs for the next release? Would be helpful to know what’s causing the exception

1 Like

This is still broken on 1.41.3.9232, and while the logs now print the exception class, they are still unfortunately not useful

Nov 28, 2024 19:22:45.634 DEBUG - [ViewStateSync] Encountered exception: std::exception

@gbooker02 I went through past PMS versions, and the last version where ViewStateSync worked was 1.40.5.8854-f36c552fd.

I also confirmed that the exception started happening on 1.40.5.8897-e5987a19d: Plex Media Server - #638 by gbooker02

Maybe something to do with

(View State Sync) Item plays could be duplicated when state synced from service.
(ViewStateSync) Fewer requests to plex.tv endpoints (PM-1958

A new beta PMS version has been released:

Items fixed: * (ViewStateSync) An exception could cause VSS to stop working

I moved machines a week ago and did a clean install of my Plex library so I don’t have the issue anymore, and am unable to run my old broken library to test this patch as it has been erased, but does that fix the problem for you?

Nice, yeah looks like it’s fixed in 1.41.3.9276-8f15273fb:

Dec 05, 2024 18:13:20.929 DEBUG - [ViewStateSync] Reading 0 states
Dec 05, 2024 18:13:20.929 DEBUG - [ViewStateSync] Done getting states
Dec 05, 2024 18:13:20.930 DEBUG - [ViewStateSync] Finished

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.