TechieGuy12 / PlexServerAutoUpdater

Automatically update Plex when running the Plex service.
MIT License
118 stars 9 forks source link

v02.0.0 - Restarts Plex Service without applying downloaded update. #51

Closed MrMase closed 3 years ago

MrMase commented 3 years ago

Hi, I had my server offline for a couple weeks so ran the scheduled task to update Plex as part of the process to restore services.

It would seem that the update process using the command below is not installing the downloaded update before restarting the plex service. "D:\Plex Auto Update\psupdate.exe" -silent -log "D:\Plex Auto Update\Logs\plex-updater.txt"

In the end I ran the update manually to resolve the issue.

I created 3 separate log files for the process to try and track down the issue. The most recent working on the assumption Plex Service Tray may be restarting the process had stopped the service in advance of running the task.

plex-updater.old2.txt plex-updater.old.txt plex-updater.txt

TechieGuy12 commented 3 years ago

Does the Plex install log exist: D:\Plex Auto Update\Logs\PlexMediaServerInstall.log? Is it empty, or does it contain information about the Plex installation?

MrMase commented 3 years ago

Unfortunately no that log file does not exist, interestingly I have just watched the process run and after manually creating D:\Plex Auto Update\Logs\PlexMediaServerInstall.log watched it get deleted as part of the following log but no new file takes it's place.

2021-08-13 03:47:35 Starting Plex installation. 2021-08-13 03:47:35 Setting the installation log path. 2021-08-13 03:47:35 Installation log path: D:\Plex Auto Update\Logs\PlexMediaServerInstall.log. 2021-08-13 03:47:35 Delete any previous installation logs. 2021-08-13 03:47:35 Run Plex installation.

One would assume at this point the issue could be permission based but I have confirmed that the account the scheduled task is being ran from (with highest privileges enabled in task) has Full control over the D:\Plex Auto Update folder and sub directories.

TechieGuy12 commented 3 years ago

Unfortunately, any error happens when the installation process is running. Can you try version 0.2.1.0-beta.1? Additional logging has been added to see if there is an exception that isn't being reported.

It is a beta version, so make sure you backup the current version, or you can redownload it.

MrMase commented 3 years ago

Using 0.2.1.0-beta.1 now generates an error code: Task Scheduler successfully completed task "\Plex Auto Update" , instance "{aa153203-21b9-4557-a40c-84864c866864}" , action "D:\Plex Auto Update\psupdate.exe" with return code 2148734720.

The scheduled task uses the command: "D:\Plex Auto Update\psupdate.exe" -silent -log "D:\Plex Auto Update\Logs\plex-updater.txt"

I am assuming (perhaps incorrectly) that the error code is related to the new config file, if so can I get some supporting documentation on setting the relevant entries to my system as there was nothing in the develop tree ReadMe.md in regards to this?

TechieGuy12 commented 3 years ago

Do you have. Net Framework 4.8 installed?

MrMase commented 3 years ago

Ah good shout on 4.8, forgot that Server 2016 is 4.6.2 out the box so upgraded it scheduled task runs again.

Still same issue though and log file does not get created despite reference in log attached. plex-updater.txt

TechieGuy12 commented 3 years ago

No worries about the 4.8 version. I forgot to mention the latest version was updated to that one.

Can you try release 0.2.1.0-beta.2?

MrMase commented 3 years ago

0.2.1.0-beta.2 Seems to have solved it, log files get created for Plex install and can confirm Plex updated to the later version.

TechieGuy12 commented 3 years ago

Great. The issue was the Plex installation log path had a space - which confused the installer thinking that there were invalid arguments passed in. The error was probably written to the error output, but couldn't be seen since I don't write the output to the log file (I will look at doing so).

All that was needed was to surround the log file path in quotes to treat the path as one argument value. After performing thousands of installs in my lifetime, I should have seen that from the beginning.