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

Can't upgrade, plexupdate thinks someone is using the server #81

Closed
didyouexpectthat opened this issue Jul 30, 2016 · 10 comments
Closed

Comments

@didyouexpectthat
Copy link
Contributor

didyouexpectthat commented Jul 30, 2016

Debian 8
plexupdate says my server is in use so it can't bother to AUTOINSTALL.

root@plex-cinema:/opt/plexupdate# ./plexupdate.sh
Authenticating...OK
Finding download URL to download...OK
File already exists (plexmediaserver_1.0.3.2461-35f0caa_amd64.deb), won't download.
Server 127.0.0.1 is currently being used by one or more users, skipping installation. Please run again later

I confirm it is not in use.
plexupdate runs a wget to my PLEXSERVER, but the server is rejecting the request due to invalid credentials.

root@plex-cinema:/opt/plexupdate# ./plexupdate.sh
Authenticating...OK
Finding download URL to download...OK
File already exists (plexmediaserver_1.0.3.2461-35f0caa_amd64.deb), won't download.
--2016-07-29 21:31:06--  https://127.0.0.1:32400/status/sessions
Connecting to 127.0.0.1:32400... connected.
The certificate's owner does not match hostname ‘127.0.0.1’
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.
Server 127.0.0.1 is currently being used by one or more users, skipping installation. Please run again later

From Plex

Jul 29, 2016 21:38:05.927 [0x7fc1167ff700] DEBUG - Request: [::ffff:127.0.0.1:50380] GET /status/sessions (12 live) TLS
Jul 29, 2016 21:38:05.930 [0x7fc1237ff700] DEBUG - Completed: [::ffff:127.0.0.1:50380] 401 GET /status/sessions (12 live) TLS 2ms 260 bytes

I have: PlexPass, 127.0.0.1 and LAN subnet entered in "List of networks that are allowed without auth", I have Home setup.
It could very well be because Home is setup; and if that's the case, maybe do a RESULTCODE for 401 and warn about Home; if it is Home, then I will just disable the check and do it live 👍 I'm unwilling to disable Home right now to confirm though.

I also found these when I was making the output more verbose, but probably resulted from making some commands more verbose.

./plexupdate.sh: line 373: [: -eq: unary operator expected
./plexupdate.sh: line 376: [: -ne: unary operator expected
@mrworf
Copy link
Owner

mrworf commented Aug 3, 2016

For now, don't specify your server and I'll have a look at this as soon as I can, in a crunch at work, so limited time right now to troubleshoot :(

@mscreations
Copy link
Contributor

mscreations commented Aug 25, 2016

On line 498, when you fetch "https://${PLEXSERVER}:32400/status/sessions" you need to add "?X-Plex-Token=${TOKEN}"

mrworf added a commit that referenced this issue Aug 27, 2016
Add X-Plex-Token to correct Issue #81
@mrworf
Copy link
Owner

mrworf commented Aug 27, 2016

Also added better handling to errors from wget which should make it more stable. Please try it and close the issue if resolved.

@didyouexpectthat
Copy link
Contributor Author

Thanks for the update! I'd try it out but I seemingly have another issue. Let me work on figuring out why it thinks the package is corrupt.

root@plex-tv:/opt/plexupdate# ./plexupdate.sh -f
Auto updating...OK
Authenticating...OK
Finding download URL to download...OK
**sha1sum: plexmediaserver_1.1.2.2680-09e98fb_amd64.deb: No such file or directory
Note! File exists but fails checksum. Redownloading.
Downloading release "plexmediaserver_1.1.2.2680-09e98fb_amd64.deb"...OK
sha1sum: plexmediaserver_1.1.2.2680-09e98fb_amd64.deb: No such file or directory**
Downloaded file corrupt. Try again.
root@plex-tv:/opt/plexupdate#

@mrworf
Copy link
Owner

mrworf commented Aug 27, 2016

This was caused by another merge which happened at the same time (sha1 checksum), but I fixed it and if you update again, it should work fine now.

@didyouexpectthat
Copy link
Contributor Author

Oh okay. I reported that other bug here: #95
I think it was just missing the ${DOWNLOADDIR} when checking the checksum.

Anyway, I will stash and retry.

@mrworf
Copy link
Owner

mrworf commented Aug 27, 2016

Let me know how it goes, sorry for the inconvenience

@didyouexpectthat
Copy link
Contributor Author

No worries.

This seems to work alright now. I'll close this -- but the script is a lot more verbose now; Is that just me?

root@plex-tv:/opt/plexupdate# ./plexupdate.sh  -f
Auto updating...OK
Authenticating...OK
Finding download URL to download...OK
File exists and checksum passes, won't redownload.
DATA: '<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="1">
<Video addedAt="1469758621" art="/library/metadata/158030/art/1469759712" chapterSource="" contentRating="TV-PG" duration="2614281" grandparentArt="/library/metadata/158030/art/1469759712" grandparentKey="/library/metadata/158030" grandparentRatingKey="158030" grandparentTheme="/library/metadata/158030/theme/1469759712" grandparentThumb="/library/metadata/158030/thumb/1469759712" grandparentTitle="Stargate Atlantis" guid="com.plexapp.agents.thetvdb://70851/3/15?lang=en" index="15" key="/library/metadata/158095" lastViewedAt="1472322188" librarySectionID="7" originallyAvailableAt="2007-05-11" parentIndex="3" parentKey="/library/metadata/158042" parentRatingKey="158042" parentThumb="/library/metadata/158042/thumb/1469759711" rating="7.3" ratingKey="158095" sessionKey="1" summary="Sheppard and McKay discover that their competitive video game has been controlling a planet of real people, who now stand on the brink of war." thumb="/library/metadata/158095/thumb/1471002127" title="The Game" titleSort="Game" type="episode" updatedAt="1471002127" viewOffset="1308900" year="2007">
<Media aspectRatio="1.78" audioChannels="2" audioCodec="mp3" bitrate="1119" container="avi" duration="2614281" height="336" id="182891" videoCodec="mpeg4" videoFrameRate="24p" videoProfile="advanced simple" videoResolution="sd" width="608">
<Part container="avi" duration="2614281" file="/media/scifi/Stargate Atlantis/s03e15 - The Game.avi" id="188298" key="/library/parts/188298/1322573571/file.avi" size="365529200" videoProfile="advanced simple">
<Stream bitDepth="8" bitrate="987" chromaSubsampling="4:2:0" codec="mpeg4" codecID="XVID" duration="2614278" frameRate="23.976" gmc="0" height="336" id="448781" index="0" level="5" pixelFormat="yuv420p" profile="asp" qpel="0" refFrames="1" scanType="progressive" streamType="1" width="608" />
<Stream bitrate="119" bitrateMode="vbr" channels="2" codec="mp3" codecID="55" duration="2614248" id="448782" index="1" samplingRate="48000" selected="1" streamIdentifier="1" streamType="2" />
<Stream codec="srt" format="srt" id="448995" key="/library/streams/448995" language="English" languageCode="eng" selected="1" streamType="3" />
<Stream codec="srt" format="srt" id="448996" key="/library/streams/448996" language="Espa&#241;ol" languageCode="spa" streamType="3" />
<Stream codec="srt" format="srt" id="448993" key="/library/streams/448993" language="&#1088;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1103;&#1079;&#1099;&#1082;" languageCode="rus" streamType="3" />
<Stream codec="sub" format="microdvd" id="448994" key="/library/streams/448994" streamType="3" />
</Part>
</Media>
<Director id="11181" tag="William Waring" />
<Writer id="14780" tag="Carl Binder" />
<User id="1" thumb="https://plex.tv/users/xxx/avatar" title="xxx" />
<Player address="::ffff:172.31.5.201" device="Windows" machineIdentifier="xxx" model="10" platform="Konvergo" platformVersion="1.1.4.393-12c41f9f" product="Plex Media Player" profile="Konvergo" state="playing" title="xxx-i7" vendor="" version="2.7.5" />
</Video>
</MediaContainer>'
Server 127.0.0.1 is currently being used by one or more users, skipping installation. Please run again later

@mrworf
Copy link
Owner

mrworf commented Aug 27, 2016

That's because I was testing the plexserver comms and forgot to remove the debug printout, should be fixed now.

@didyouexpectthat
Copy link
Contributor Author

Cool. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants