tfabris / CrowCam

A set of Bash scripts to control and maintain a YouTube live cam from a Synology NAS.
GNU General Public License v3.0
3 stars 3 forks source link

The call to the Synology Web API failed. Exiting program. Error code 105 (Insufficient user privilege) #90

Closed tfabris closed 3 months ago

tfabris commented 3 months ago

CrowCam youtube stream was down for a couple of days and this error message repeats in the log for every CrowCam run: The call to the Synology Web API failed. Exiting program

Digging deeper, I see that the error message from the API was this: {"error":{"code":105},"success":false}

Googling tells me that error 105 is "Insufficient user privilege" - yet I made no changes to the NAS or its users or any privileges. However, the Surveillance Station software indeed had been automatically updated immediately prior to this error message appearing. I see in the log:

Info  2024-04-23 22:29:59 Package [Surveillance Station] has been successfully updated.
Error 2024-04-23 22:30:07 CrowCam Controller - The call to the Synology Web API failed. Exiting program.

So this is definitely the result of a Surveillance Station update. Investigating.

tfabris commented 3 months ago

Root cause:

This was caused by some sort of permissions change in the Synology Surveillance Station API which was induced on approximately 2024-04-23. This appears to be a newly-introduced regression bug caused by Synology on that date. The user account that I was using to access the API originally had the privilege level of "All-Object Manager" in the Surveillance Station. Prior to 2024-04-23, this privilege level was sufficient to do the necessary tasks of starting and stopping the YouTube stream. Unfortunately, since this update, now the privilege level of "Administrator" is required to control the YouTube stream.

Note: The API user account doesn't need full Synology admin privileges, it does not need to be a Synology "administrator" account. It only needs admin permission inside the Surveillance Station. The Surveillance Station has its own additional level of user permissions granularity inside it. To access it, follow the steps below.

Workaround:

To work around this new bug, I had to change the permissions of my API user account in the Surveillance Station. Steps:

One other note: I also had tried changing the user to Administrator and then changing it back to All-Object Manager. (This kind of thing is sometimes needed when permissions get changed.) However this did not solve the problem. Only permanently changing the user to Administrator solved the problem.