Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script needs to be updated to support "Synology (DSM 7.2.2+)" #50

Closed
michealespinola opened this issue Aug 26, 2024 · 33 comments
Closed
Assignees
Labels
bug Something isn't working DSM722 DSM 7.2.2

Comments

@michealespinola
Copy link
Owner

michealespinola commented Aug 26, 2024

The script currently is unable to detect a new version type for PMS on Synology, specifically for supporting the new DSM 7.2.2. If you find yourself updated to the new version of Synology DSM before this is fixed in the script, you can manually install the new version type here:

https://www.plex.tv/media-server-downloads/?cat=nas&plat=synology-dsm72#plex-media-server

If anyone beats me to updating the code and wants to make a pull request, I welcome the assistance.


Functionality changes being tested:

  1. The JSON query for nas object will be changed to nas.id to prevent future descriptive name change failures (including for DSM6 that will be backported into the archived DSM6 script).
  2. Valid known id's for Synology:
    • synology for DSM 6
    • synology-dsm7 for DSM 7
    • synology-dsm72 for DSM 7.2.2+
@michealespinola michealespinola added the bug Something isn't working label Aug 26, 2024
@michealespinola michealespinola self-assigned this Aug 26, 2024
@michealespinola michealespinola pinned this issue Aug 26, 2024
@michealespinola michealespinola added DSM7 Synology DSM 7 DSM722 DSM 7.2.2 and removed DSM7 Synology DSM 7 labels Aug 26, 2024
@michealespinola michealespinola changed the title Script needs to be updated to support DSM 7.2.2+ Script needs to be updated to support DSM 7.2.2 Aug 26, 2024
@michealespinola michealespinola changed the title Script needs to be updated to support DSM 7.2.2 Script needs to be updated to support "Synology (DSM 7.2.2+)" Aug 27, 2024
michealespinola added a commit that referenced this issue Aug 29, 2024
1. Added new nas type detection for Plex's new coinciding PMS version types (issue #50) 
2. Replaced use of echo with process substitution
3. Added `-m` command line option for force script update from master branch
4. Adjusted script and terminal formatting
5. Adjusted other script elements for better shellcheck compatibility
@ytsejam1138
Copy link

Still having an issue updating Plex with the new v4.6.0 script. I updated manually to get to version 1.41.0.8930. Here's my output:

SYNO.PLEX UPDATE SCRIPT v4.6.0 for DSM 7

     Script: [syno.plexupdate.sh](http://syno.plexupdate.sh/)
 Script Dir: /volume1/stuff/scripts
Running Ver: 4.6.0
 Online Ver: 4.6.0 (59/60)
   Released: 2024-08-29 06:33:59-04:00 (0+ days old)
             * No new version found.

   Synology: DS918+ (x86_64), DSM 7.2.2-72803 Update 0
   Plex Dir: /volume1/PlexMediaServer/AppData/Plex Media Server
Running Ver: 1.41.0.8911
 Online Ver: 1.41.0.8930 (Beta Channel)
   Released: 2024-08-26 13:14:51-04:00 (3+ days old)
             * No new version found.

@michealespinola
Copy link
Owner Author

michealespinola commented Aug 29, 2024

I updated manually to get to version 1.41.0.8930

Updated the update script, or updated the Plex for Synology package? Can you email me your syno.plexupdate.sh.debug file?

@michealespinola
Copy link
Owner Author

In the meantime, I'll test rolling back to 1.41.0.8911 (DSM 7) to see if I can recreate what you are experiencing.

@michealespinola
Copy link
Owner Author

No can do. As I expected, I am unable to rollback to any versions previous to 7.2.2.

@michealespinola
Copy link
Owner Author

Thank you for the debug file. It looks like one of the version comparison values to kick off an update is coming back null. I'm still investigating the cause.

@michealespinola
Copy link
Owner Author

michealespinola commented Aug 30, 2024

I accidentally introduced duplicate code that prevented the Plex version comparison between the locally running version and the latest version found online. This should be fixed now in v4.6.3.

@ytsejam1138, if you could confirm, that would be appreciated. Thank you.

@ytsejam1138
Copy link

Script updated to v4.6.3 with no issues. I'm currently running the latest BETA PMS. I will confirm the script is working with the next PMS update.

@war59312
Copy link

ash-4.4# bash /volume1/homes/Will/scripts/bash/plex/syno.plexupdate/syno.plexupdate.sh

SYNO.PLEX UPDATE SCRIPT v4.6.3 for DSM 7

         Script: syno.plexupdate.sh
     Script Dir: /volume1/homes/Will/scripts/bash/plex/syno.plexupdate
    Running Ver: 4.6.3
     Online Ver: 4.6.3 (attempt 58/60)
       Released: 2024-08-29 22:38:54-04:00 (0+ days old)
                 * No new version found.

Unsupported DSM version: 7.1.1
       Synology: DS1815+-j (x86_64), DSM 7.1.1-42962 Update 6
       Plex Dir: /volume1/PlexMediaServer/AppData/Plex Media Server
    Running Ver: 1.40.5.8921
                 * No new version found.

On my DS1815+. Latest for it is 7.1.1.

And last time I ran it, a few days ago it updated itself and Plex just fine as expected.

@michealespinola
Copy link
Owner Author

@war59312 your log looks a bit unique! Are you running a customized version? Is there anything that I can incorporate into the script for you? I'm a bit concerned that in the Synology info section of the log you posted that you do not have a line for the "Online Ver" for Plex, similar to this:

     Online Ver: 1.41.0.8930 (Public Channel for synology-dsm7)

A full (non-updating) log should resemble the following with all lines intact:

SYNO.PLEX UPDATE SCRIPT v4.6.3 for DSM 7

         Script: syno.plexupdate.sh
     Script Dir: /volume1/homes/admin/scripts/bash/plex/syno.plexupdate
    Running Ver: 4.6.3
     Online Ver: 4.6.3 (attempt 59/60)
       Released: 2024-08-29 19:38:54-07:00 (0+ days old)
                 * No new version found.

       Synology: DS1019+ (x86_64), DSM 7.2.2-72803 Update 0
       Plex Dir: /volume4/PlexMediaServer/AppData/Plex Media Server
    Running Ver: 1.41.0.8930
     Online Ver: 1.41.0.8930 (Beta Channel for synology-dsm72)
       Released: 2024-08-26 10:14:51-07:00 (3+ days old)
                 * No new version found.

@war59312
Copy link

war59312 commented Aug 30, 2024

Nope just standard package.

Yea I see that, interesting.

See you plexinfo script, here is my output:

ash-4.4# bash /volume1/homes/Will/scripts/bash/plex/syno.plexupdate/tools/syno.plexinfo.sh

SYNO.PLEX INFO SCRIPT for DSM 7

SYNOLOGY NAS INFO:
---------------
       Nodename: nas
        DSM ver: 7.1.1-42962 Update 6
          Model: DS1815+-j
   Architecture: x86_64 (avoton)
         Kernel: Linux (3.10.108)
           Bash: 4.4.23(1)-release
      Time Zone: US/Eastern
  Admin account: Disabled
    Internal IP:
    External IP: 192.168.10.135

PLEX MEDIA SERVER INFO:
---------------
  Friendly Name:
        PMS ver: 1.40.5.8921-7000
 Update Channel: Public
    Empty Trash: Not Automatic
     Transcoder: ffmpeg (27d3929-731e70e17b964ba367f4016a)
      
[REDACTED]

PLEX DIRECTORY REFERENCE:
---------------
'/volume1/@appstore/PlexMediaServer'
'/volume1/PlexMediaServer/AppData/Plex Media Server'
  "  '/Codecs'
  "  '/Codecs/27d3929-731e70e17b964ba367f4016a-linux-x86_64'
  "  '/Logs'
  "  '/Plug-ins'
  "  '/Plug-in Support'
  "  '/Scanners'
---------------

Looks like Internal and External IP are backwards and can't get external anyways. See Friendly name missing.

@michealespinola
Copy link
Owner Author

Please be careful about posting identifiers for your Plex installation. You don't want to publicly post your ID's and especially not your 'Online Token'. I have removed those from your post for you.

@michealespinola
Copy link
Owner Author

michealespinola commented Aug 30, 2024

Perhaps I need to tailor the code for your specific NAS model (this wouldn't be the first outlier). I've never seen a "+-j" in the model name before. What is the model name/number printed on the unit?

If you would, please email me your syno.plexupdate.sh.debug file so I can see if something specific needs to be done for your model name variant or if possibly there is a bug in the code that is effecting you.

@michealespinola
Copy link
Owner Author

Online Tokens can allow authorized access to your Plex server. If you need to invalidate your existing token so it no longer works and get a new one, the easiest way to do so is to go to your Plex account profile, choose to change your password, and check the Sign out connected devices after password change option when entering the new password.

@war59312
Copy link

Thanks for that.

Email sent with the requested debug file.

As for "What is the model name/number printed on the unit?" that would be DS1815+.

Noticed another user has the DS1815+-j over @ 007revad/Synology_HDD_db#245

@michealespinola
Copy link
Owner Author

Thank you. This internal model naming is peculiar and unexpected. I'm surprised but thankful it apparently wasn't causing an issue.

I'll have a fix released shortly.

@war59312
Copy link

Nice, thank you.

@michealespinola
Copy link
Owner Author

@ytsejam1138, and others: After investigation, the problem was identified to the use of bad version comparison operators to match DSM version against Plex platform-types.

e.g. using 'equal to' (aka eq) instead of 'greater than of equal to' (aka ge).

@war59312: The oddity of DS1815+-j should not have any relevance on how the script works. This is a superficial naming oddity from Synology pulled directly from '/proc/sys/kernel/syno_hw_version'. I had figured that the script was adding the characters because of a coding issue, but its not. I have no knowledge as to why Synology is adding the -j to the designation, and I think this is a bug/mistake on their part. But its otherwise superficial to the script and is inconsequential to how it works. Thankfully, not the result of a bug.

Everything else should work as intended at this point. Along with these new Plex platform-type changes, I'm going back through the code to better trap for null values.

I'll keep this open until I hear back from everyone. Thanks for your patience.

@war59312
Copy link

Looking good. Thank you.

ash-4.4# bash /volume1/homes/Will/scripts/bash/plex/syno.plexupdate/syno.plexupdate.sh

SYNO.PLEX UPDATE SCRIPT v4.6.3 for DSM 7

         Script: syno.plexupdate.sh
     Script Dir: /volume1/homes/Will/scripts/bash/plex/syno.plexupdate
    Running Ver: 4.6.3
     Online Ver: 4.6.5 (attempt 59/60)
       Released: 2024-08-31 03:56:46-04:00 (0+ days old)
                 * Newer version found!

INSTALLING NEW SCRIPT:
----------------------------------------
2024-08-31 15:39:19 URL:https://raw.githubusercontent.com/michealespinola/syno.plexupdate/v4.6.5/syno.plexupdate.sh [19336/19336] -> "/volume1/homes/Will/scripts/bash/plex/syno.plexupdate/Archive/Scripts/syno.plexupdate.sh" [1]
'/volume1/homes/Will/scripts/bash/plex/syno.plexupdate/Archive/Scripts/syno.plexupdate.sh' -> '/volume1/homes/Will/scripts/bash/plex/syno.plexupdate/Archive/Scripts/syno.plexupdate.sh.cmp'
renamed '/volume1/homes/Will/scripts/bash/plex/syno.plexupdate/Archive/Scripts/syno.plexupdate.sh' -> '/volume1/homes/Will/scripts/bash/plex/syno.plexupdate/syno.plexupdate.sh'
----------------------------------------
                 * Script update succeeded!

RELEASE NOTES:
----------------------------------------
* Re-added v stripping from version tag
----------------------------------------
Report issues to: https://github.com/michealespinola/syno.plexupdate/issues

Unsupported DSM version: 7.1.1
       Synology: DS1815+-j (x86_64), DSM 7.1.1-42962 Update 6
       Plex Dir: /volume1/PlexMediaServer/AppData/Plex Media Server
    Running Ver: 1.40.5.8921
                 * No new version found.
ash-4.4# bash /volume1/homes/Will/scripts/bash/plex/syno.plexupdate/syno.plexupdate.sh

SYNO.PLEX UPDATE SCRIPT v4.6.5 for DSM 7

         Script: syno.plexupdate.sh
     Script Dir: /volume1/homes/Will/scripts/bash/plex/syno.plexupdate
    Running Ver: 4.6.5
     Online Ver: 4.6.5 (attempt 58/60)
       Released: 2024-08-31 03:56:46-04:00 (0+ days old)
                 * No new version found.

       Synology: DS1815+-j (x86_64), DSM 7.1.1-42962 Update 6
       Plex Dir: /volume1/PlexMediaServer/AppData/Plex Media Server
    Running Ver: 1.40.5.8921
     Online Ver: 1.40.5.8921 (Public Channel for synology-dsm7)
       Released: 2024-08-23 16:05:25-04:00 (7+ days old)
                 * No new version found.

@michealespinola
Copy link
Owner Author

michealespinola commented Aug 31, 2024 via email

@yauyauwind
Copy link

I run the latest script v4.6.5 got the issue, the online package didn't show up on my DS1618+

ash-4.4# bash syno.plexupdate.sh

SYNO.PLEX UPDATE SCRIPT v4.6.5 for DSM 7

         Script: syno.plexupdate.sh
     Script Dir: /volume1/homes/wind/Scripts/syno.plexupdate
    Running Ver: 4.6.5
     Online Ver: 4.6.5 (attempt 54/60)
       Released: 2024-08-31 15:56:46+08:00 (1+ days old)
                 * No new version found.

       Synology: DS1618+ (x86_64), DSM 7.2.2-72803 Update 0
       Plex Dir: /volume1/PlexMediaServer/AppData/Plex Media Server
    Running Ver: 1.41.0.8930
                 * No new version found.

@ytsejam1138
Copy link

I run the latest script v4.6.5 got the issue, the online package didn't show up on my DS1618+

ash-4.4# bash syno.plexupdate.sh

SYNO.PLEX UPDATE SCRIPT v4.6.5 for DSM 7

         Script: syno.plexupdate.sh
     Script Dir: /volume1/homes/wind/Scripts/syno.plexupdate
    Running Ver: 4.6.5
     Online Ver: 4.6.5 (attempt 54/60)
       Released: 2024-08-31 15:56:46+08:00 (1+ days old)
                 * No new version found.

       Synology: DS1618+ (x86_64), DSM 7.2.2-72803 Update 0
       Plex Dir: /volume1/PlexMediaServer/AppData/Plex Media Server
    Running Ver: 1.41.0.8930
                 * No new version found.

You are already running the latest version of Plex Media Server.

@michealespinola
Copy link
Owner Author

@ytsejam1138, @yauyauwind : Please send me a copy of your syno.plexupdate.sh.debug log file, to [email protected]. Thanks,

@yauyauwind
Copy link

yauyauwind commented Sep 2, 2024

Online Ver: 1.40.5.8921 (Public Channel for synology-dsm7)
Released: 2024-08-23 16:05:25-04:00 (7+ days old)

Oh, Sorry, I didn't make it clear, I mean I run the script, but haven't the online version displayed, missing the following lines

     Online Ver: 1.40.5.8921 (Public Channel for synology-dsm7)
       Released: 2024-08-23 16:05:25-04:00 (7+ days old)

Acutally, I use the previous plex version before, I just manual update to the plex latest version to see if there is a different or not

Thanks~

@michealespinola
Copy link
Owner Author

The issue involves Public channel update queries. I've been set to Beta so this wasn't happening to me. A fix will be released shortly.

@yauyauwind
Copy link

yauyauwind commented Sep 3, 2024 via email

@michealespinola
Copy link
Owner Author

michealespinola commented Sep 3, 2024

The underlying issue is that Plex has still not released a Public version of PMS for Synology DSM 7.2.2. Therefore, the script query to Plex's Public download API is returning null. The next release of the update script will indicate when these types of conditions happen. Ideally, this really should never happen, and has only been caused by Synology's release of 7.2.2 before allowing 3rd-party vendors to update their products.

The following quote is the official Synology statement and solution, which at this time requires a manual upgrade:

If you have updated your Synology to DSM 7.2.2 or higher there is a new package for install on that system on the downloads page. The DSM 7 package will not work.

If you do not have a Plex Pass you may not be able to see the download as 1.41.0 is still in beta. Below are links to download

This manual update is for 1.41.0.8911. If there is any confusion regarding which version you need to download, here is a chart to match your hardware architecture:

Architecture Download version
armv7neon ARM 7
aarch64 ARM 8
x86_64 Intel/AMD 64

If you are unfamiliar with your NAS hardware architecture, you can identify it in the script log, in parenthesis next the Synology model name, like in this example:

    Synology: DS1019+ (x86_64), DSM 7.2.2-72803 Update 0

The script is otherwise working properly, and there is currently no coinciding Public version of PMS to check availability for DSM 7.2.2. The next version of the update script will better indicate this kind of unique status in the log.

Sorry for any confusion.

@yauyauwind
Copy link

Hello Micheal,

Thank you for your explaination , so that I decided switch to Beta Channel, The script is work now
and Many thanks for your effort

Thanks~

@michealespinola
Copy link
Owner Author

michealespinola commented Sep 4, 2024

There's really no need to switch over to the Beta channel if you do not want to. Be aware that Beta updates come out more frequently, so you may want or need to alter your MinimumAge config setting to a shorter time frame.

That said, based on my experiences, the 1.41.0.8930 Beta channel release has been fine and has not introduced any new bugs that I am aware of.

@yauyauwind
Copy link

Hello Micheal,

Yes I know that, I can wait the package become Stable release, then I'll receive the plex update without switch to Beta channel
And thank you for your advise to modify the MinimumAge

Thanks~~

@michealespinola
Copy link
Owner Author

v4.6.9 has been released. It now includes an error-generating log section similar to:

   Synology: DS1019+ (x86_64), DSM 7.2.2-72803 Update 0
   Plex Dir: /volume4/PlexMediaServer/AppData/Plex Media Server
Running Ver: 1.41.0.8930
 Online Ver: Nonexistent (Public Channel for synology-dsm72)
             * No new version found.

This is a properly trapped error condition now, and will appropriately cause the DSM to send a notification email until Plex has an official Public channel update for DSM 7.2.2 added into their API mechanism. Even if you manually updated to the latest Public version as described in a previous reply, that update is still not a part of their release API mechanism, and cannot be verified by the script.

Hopefully this doesn't become a nuisance for many people while we wait for a proper Public channel release. In the meantime, the Beta channel has DSM 7.2.2 support and therefor will not return any errors - if you can and don't mind being on a Beta version for the time being.

There are now a growing selection of command line options and arguments that can be used, if helpful for your own troubleshooting purposes:

# bash syno.plexupdate.sh -h

SYNO.PLEX UPDATE SCRIPT v4.6.9 for DSM 7

         Script: syno.plexupdate.sh
     Script Dir: /volume1/homes/admin/scripts/bash/plex/syno.plexupdate

Usage: syno.plexupdate.sh [-a #] [-c p|b] [-m] [-h]

 -a: Override the minimum age in days
 -c: Override the update channel (p for Public, b for Beta)
 -m: Update from the master branch (non-release version)
 -h: Display this help message

@michealespinola
Copy link
Owner Author

PLEASE NOTE: DSM 7.2.2-72803 has been recalled. It has been replaced with DSM 7.2.2-72806. It is available through the Operating System direct download link, and not through the typical DSM version > DSM version update path.

@ytsejam1138
Copy link

Script v4.6.9 ran last night and updated PMS successfully;

Running Ver: 1.41.0.8930
Online Ver: 1.41.0.8976 (Beta Channel for synology-dsm72)

@michealespinola
Copy link
Owner Author

ICYMI: 1.41.0.8992 (Public Channel) became available for DSM 7.2.2 a day ago. This issue should be behind us now.

Thanks to everyone for their comments, debug logs, and patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DSM722 DSM 7.2.2
Projects
None yet
Development

No branches or pull requests

5 participants
@war59312 @ytsejam1138 @michealespinola @yauyauwind and others