YuriyGuts / syno-plex-update

Automatically check for Plex Media Server updates on Synology NAS and install them. Compatible with DSM 6 and DSM 7.
BSD 3-Clause "New" or "Revised" License
46 stars 2 forks source link

spk might not exist or invalid format #10

Open enregistree opened 2 years ago

enregistree commented 2 years ago

Hi, scheduled task always runs, but it stops with an error with non-existing/invalid spk. At least I get notices that there is new update, and download manually.

Thanks for this little timesaver idea. I see you are from Ukraine: wishing succesful and early ending to the conflict! Cheers, Lukas

Below is the log (shortened the part with download progress.):

Task Scheduler has completed a scheduled task.

Task: syno-plex-update YuriyGuts Start time: Wed, 31 Aug 2022 03:03:03 GMT Stop time: Wed, 31 Aug 2022 03:03:52 GMT Current status: 1 (Interrupted) Standard output/error:

<13>Aug 31 03:03:05 lukasfrancl: [syno-plex-update] PlexMediaServer auto-update started <13>Aug 31 03:03:09 lukasfrancl: [syno-plex-update] Using update channel: Public <13>Aug 31 03:03:11 lukasfrancl: [syno-plex-update] Downloading Plex release metadata from 'https://plex.tv/api/downloads/5.json?X-Plex-Token=' <13>Aug 31 03:03:12 lukasfrancl: [syno-plex-update] Installed version: 1.28.2.6106 <13>Aug 31 03:03:14 lukasfrancl: [syno-plex-update] Latest available version: 1.28.2.6151 <13>Aug 31 03:03:15 lukasfrancl: [syno-plex-update] Update available. Trying to download and install <13>Aug 31 03:03:19 lukasfrancl: [syno-plex-update] Downloading latest version from https://downloads.plex.tv/plex-media-server-new/1.28.2.6151-914ddd2b3/synology-dsm7/PlexMediaServer-1.28.2.6151-914ddd2b3-aarch64_DSM7.spk --2022-08-31 03:03:21-- https://downloads.plex.tv/plex-media-server-new/1.28.2.6151-914ddd2b3/synology-dsm7/PlexMediaServer-1.28.2.6151-914ddd2b3-aarch64_DSM7.spk Resolving [downloads.plex.tv](http://downloads.plex.tv/)... 172.64.153.236, 104.18.34.20, 2606:4700:4400::6812:2214, ... Connecting to [downloads.plex.tv](http://downloads.plex.tv/)|172.64.153.236|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 97525760 (93M) [binary/octet-stream] Saving to: '/tmp/syno-plex-update/PlexMediaServer-1.28.2.6151-914ddd2b3-aarch64_DSM7.spk' 0K .......... .......... .......... .......... .......... 0% 5.12M 18s 95200K .......... .......... .......... .......... 100% 4.04M=27s 2022-08-31 03:03:49 (3.39 MB/s) - '/tmp/syno-plex-update/PlexMediaServer-1.28.2.6151-914ddd2b3-aarch64_DSM7.spk' saved [97525760/97525760] <13>Aug 31 03:03:49 lukasfrancl: [syno-plex-update] Installing SPK package from /tmp/syno-plex-update/PlexMediaServer-1.28.2.6151-914ddd2b3-aarch64_DSM7.spk {"error":{"code":263,"description":"failed to sort spks, the spk might not exist or invalid format"},"success":false} <13>Aug 31 03:03:51 lukasfrancl: [syno-plex-update] PlexMediaServer auto-update failed with exit code 1 From xoxosyn
YuriyGuts commented 2 years ago

Hi Lukas, Thank you for your words of support! 🇺🇦

It looks like your NAS uses an ARM CPU, and my suspicion is that the script might be choosing the wrong CPU architecture among the three options available on the website. Could you please share the model of your NAS and what kind of package you usually download manually from the website?

image
enregistree commented 2 years ago

Hi Yuriy,

yes definitely ARM: model DS218. It downloads ARMv8 package (64bit I believe). Right now, the update file name is "PlexMediaServer-1.28.2.6151-914ddd2b3-aarch64_DSM7.spk". It worked for me in the past – when manually downloaded and installed.

YuriyGuts commented 2 years ago

If installing an ARMv8 package manually works for you, then it looks like the script downloads the correct package and there must be something else going on during installation.

The error message (failed to sort spks, the spk might not exist or invalid format) must be coming from the DSM binaries, and, unfortunately, there's not a lot of troubleshooting information I can find about that error. In case I have any further ideas, I'll reach out in this thread. Sorry it's not working as expected, thanks for reporting!

YuriyGuts commented 2 years ago

One other thought: there might be useful diagnostic information in /var/log/synoscgi.log around the time the installation failures occurred.

enregistree commented 2 years ago

DSM log:

DSM log.docx

Is this what you mean by synoscgi.log? Thank you

YuriyGuts commented 2 years ago

No, it's a file in the NAS filesystem containing the diagnostic logs. One way to retrieve it would be to SSH into the NAS, then sudo -i, then cat /var/log/synoscgi.log (or grep -ir plex /var/log to retrieve all messages related to Plex in general). Some log records from the timeframe when the installation error occurred could help understand what's happening under the hood.

enregistree commented 2 years ago

Here you go:

grep.docx log - part.docx

Task was run at times: Task: syno-plex-update YuriyGuts Start time: Thu, 01 Sep 2022 03:03:02 GMT Start time: Wed, 31 Aug 2022 17:34:21 GMT Start time: Thu, 18 Aug 2022 03:03:01 GMT for example.

See, I am not software developer ;) so it gets complicated for me quickly. Scheduled task works (kind of) for me: at least I get notified by email and can run update manually.

YuriyGuts commented 2 years ago

Thanks for the logs!

error":{"code":289,"description":"spk is not from synology"} is interesting: it looks like the system is configured to trust only the packages published by Synology when installing them automatically. That might explain why the script fails yet a manual installation succeeds.

I've observed similar behavior on an older DSM version (DSM 6), and it required some configuration to work properly. DSM 7, however, doesn't seem to expose those settings anymore – at least on my DS918+. In case you do find any settings related to "Trust" in Package Center or Control Panel (something like those in the article linked above), you can experiment with them.