I was testing a python script that adds EXCLUDE LABELS to users’ restrictions. (Manage Library Access > any user > ‘Restrictions’.
It worked fine and successfully added or removed the exclude labels, but at one point it seems to have ‘broken’ something.
When I now go to any user’s Restrictions tab, I get “Something went wrong
An unexpected error occurred.”
Everything else is working fine.
I was on the previous server version. Meanwhile I upgraded to 1.41.4.9463 but that didn’t fix it. I did an integrity_check which returns OK. I also tried the other steps found in this support article on repairing corrupted database without luck.
Any idea on how to fix it? And secondly, is it a bad idea to use the API to add/remove these labels? I got the idea from dane22’s comment in This thread on Reddit
EDIT: The labels I entered still work. My kids’ account is still working as intended with the correct label exclusion. I can also still use the API to add or remove labels, I can check this by using https://plex.tv/api/users?X-Plex-Token=xxx. I just can no longer see or edit the restriction pages for any user in my web ui settings.
Ok. My thought was that your database might have something regarding restrictions that is invalid. I have seen where the web interface will not generate a page of it contains something unexpected. If you only have your account and a managed account, the bad data could be under your account.
Do you have an old database you can restore? That should fix it. Otherwise you might have to go digging through your database to look for that invalid entry.
I have tried restoring database backups. one from two days ago (so one day before the page became corrupted) and I tried again just now with a backup from three days before that.
The issue persists unfortunately.
PS:
If you only have your account and a managed account
Just to be clear: I have about 10 external users too, but those are not my accounts so I can’t ‘switch’ to them. They report no issues.
I seem to have found, and fixed the issue!
Using an old snapshot I had of my users .xml I noticed that the problem occurs because I applied multiple labels with the script and it did so in a bad manner.
So instead of using a comma (%2C) to separate multiple labels, it was posting a whole new entry somehow. To clarify; I never applied multiple labels at once with the script. But when a label already existed and I posted a new one, it was appended in this way…
I was able to remove the labels with the api and now it’s working fine again.
Thanks for brainstorming and replying!
Lesson learned…