TechieGuy12 / PlexServerAutoUpdater

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

"An Error Occurred while sending the request" #42

Closed theg1nger closed 3 years ago

theg1nger commented 3 years ago

Plex install folder: C:\Program Files (x86)\Plex\Plex Media Server. Plex local data folder: C:\Users\XXXX\AppData\Local. Updates folder: C:\Users\XXXX\AppData\Local\Plex Media Server\Updates. Update channel: Plex Pass. Verify the updates folder is specified. Verify the updates folder, C:\Users\XXXX\AppData\Local\Plex Media Server\Updates exists. Getting ready to download the latest package. Checking for the latest version from Plex. The update channel is set for Plex Pass. Could not get Plex package information. Message: An error occurred while sending the request.. Could not get the latest version information from Plex. The latest Windows version has not been specified. The latest available installation could not be downloaded. Current version: 1.20.2.3370. Lastest version: 1.20.2.3370.

Plex Pass has a new update 1.20.2.3402 but ps update is not able to find it. Using 0.2.0.0 Beta 1 W10 20H2 (19042.546)

theg1nger commented 3 years ago

0.2.0.0 b1 was working fine until the last Plex Server update. Wonder what changed that broke it.

Neither one seem to download the update. Have to do it manually. 0.2.0.0 doesn't recognize that it is downloaded while 0.1.9.0 does.

Get the local data folder for Plex. Couldn't find the local data folder in the registry, so defaulting to the logged in user's local application data folder. Plex local data folder: C:\Users\XXXX\AppData\Local Verify the updates folder is specified. Getting ready to download the latest package. Checking for the latest version from Plex. The update channel is set for Plex Pass. Could not get Plex package information. Message: An error occurred while sending the request.. Could not get the latest version information from Plex. The latest Windows version has not been specified. The latest available installation could not be downloaded. Verify the updates folder, C:\Users\XXXX\AppData\Local\Plex Media Server\Updates exists. Checking to see if updates folder exists. Getting the latest update folder. Checking for the latest Plex packages folder. Get the latest packages file. Latest packages file: C:\Users\XXXX\AppData\Local\Plex Media Server\Updates\1.20.2.3402-0fec14d92\packages\PlexMediaServer-1.20.2.3402-0fec14d92-x86.exe Waiting for the server to be free has been enabled. Server update can begin. Waiting for all media and/or in progress recordings to be stopped.Waiting for the server to be free has been enabled. Server update can begin. Waiting for all media and/or in progress recordings to be stopped.

TechieGuy12 commented 3 years ago

I can reproduce the issue on my server. Let me have a look and see what the issue is.

TechieGuy12 commented 3 years ago

On the next update, try this release: 0.2.0.0-beta.2.

AnthonyBe commented 3 years ago

Interesting. I started seeing this exact same issue and error using psupdate 0.1.9.0 on my Windows Server 2012 R2 server with the 1.20.2.3402 PMS update.

I just updated to psupdate 0.2.0.0 beta 2 and it successfully updated.

Thanks @TechieGuy12 !

TechieGuy12 commented 3 years ago

The issue will probably appear with 0.1.9.0. I will need to update that one too.

TechieGuy12 commented 3 years ago

Release 0.1.9.1 contains the fix for the release version.

AnthonyBe commented 3 years ago

I noticed in that commit of LatestAvailableVersion.cs what looks to be hardcoding of the TLS protocol in line 358 to TLS 1.2?

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

If I'm correct, while that will work, it prevents the use of TLS 1.3 where available which is faster and more secure. Better to let the OS auto-determine the security protocol to use (https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls)

If I've misunderstood that bit of code, apologies, and I'll crawl back into my box! :)

TechieGuy12 commented 3 years ago

You are correct. I have specifically set the protocol to 1.2. With version 0.1.9.x, the targetted version of .Net Framework is 4.5. This means that I can't use the protocol specified by the OS as it isn't available in .Net 4.5. In that case, I specifically set it to TLS 1.2. I didn't want to update the .Net version to 4.7+ to keep the compatibility with all 0.1.9.x versions.

With version 0.2.0.0, I have changed the targetted .Net Framework version to 4.7.2, which now allows me to use the OS-specified protocol. I have since updated 0.2.0.0 to remove the hard-coded TLS 1.2, but have yet to compile the version. I am waiting to first test it on my server, but feel free to compile and run the latest code in the Restructure branch.

theg1nger commented 3 years ago

@TechieGuy12 Yup. Looks like that fixed it. 0.2.0.0-beta.2

2020-10-07 18:50:46 Current version: 1.20.2.3402.
2020-10-07 18:50:46 Latest version: 1.20.3.3401.

Didn't have to download the update manually via myplex. Updated successfully. Thanks!