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

Plex Widget API Error #656

Closed
nackerr opened this issue Dec 9, 2022 · 22 comments · Fixed by #658
Closed

Plex Widget API Error #656

nackerr opened this issue Dec 9, 2022 · 22 comments · Fixed by #658
Assignees
Labels
bug Something isn't working

Comments

@nackerr
Copy link

nackerr commented Dec 9, 2022

I've setup the plex widget, and have confirmed the token is correct. I can visit the API url in my personal browser, and from curling in the container with the token and get a response, but the widget does not work.

Just says:
API Error: The string did not match the expected pattern.

Here's my setup:

@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

Can you post the curl output (from inside the container)?

At 401 is unauthorized so I’m still guessing there’s an issue reaching your Plex instance, or with the token, etc.

@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

Hey there, it has no issues curling the page from inside the container.

Output here, GitHub cutting it off: https://haste.ryann.gg/bcadfbgljd.phptemp

@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

You didnt use the issue form, is there anything in the logs?

And thats just the index page, how about the actual API endpoints

  • curl -L -k 'http://192.168.4.206:32400/library/sections?X-Plex-Token=TOKEN'
  • /status/sessions
  • /library/sections/${library._attributes.key}/all (key comes from one of the 'sections' above with type 'movie' or 'show')

@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

My apologies, I missed that! I was tired when I made the issue.

Installed through Docker, latest version. Homepage is also latest, everything is fresh installed Yesterday.

homepage logs just contain a bunch of spam of the following lines:

[2022-12-10T04:51:57.259Z] error: undefined
[2022-12-10T04:58:17.276Z] error: undefined
[2022-12-10T05:02:02.043Z] error: undefined
[2022-12-10T05:07:57.291Z] error: undefined

I've also enabled debug logging method through the ENV variables.

Library curl results:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="1" allowSync="0" title1="Plex Library">
<Directory allowSync="1" art="/:/resources/movie-fanart.jpg" composite="/library/sections/1/composite/1670647514" filters="1" refreshing="0" thumb="/:/resources/movie.png" key="1" type="movie" title="Movies" agent="tv.plex.agents.movie" scanner="Plex Movie" language="en-US" uuid="0adca2c9-83fc-46f8-beb0-a9b1ccfb2863" updatedAt="1670647569" createdAt="1670549748" scannedAt="1670647514" content="1" directory="1" contentChangedAt="246" hidden="0">
<Location id="1" path="/home/ryan/plex/movies" />
</Directory>
</MediaContainer>

Sessions:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="0">
</MediaContainer>

Output of last request:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="4" allowSync="1" art="/:/resources/movie-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="1" librarySectionTitle="Movies" librarySectionUUID="0adca2c9-83fc-46f8-beb0-a9b1ccfb2863" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1667296136" thumb="/:/resources/movie.png" title1="Movies" title2="All Movies" viewGroup="movie" viewMode="65592">
<Video ratingKey="2" key="/library/metadata/2" guid="plex://movie/5ef5ee195d76fa003a8c6342" studio="Columbia Pictures" type="movie" title="Bullet Train" contentRating="R" summary="Unlucky assassin Ladybug (Brad Pitt) is determined to do his job peacefully after one too many gigs has gone off the rails. Fate has other plans, however: Ladybug&#39;s latest mission puts him on a collision course with lethal adversaries from around the globe--all with connected, yet conflicting, objectives--on the world&#39;s fastest train. The end of the line is just the beginning in this non-stop thrill-ride through modern-day Japan." rating="5.3" audienceRating="7.6" year="2022" tagline="The end of the line is just the beginning." thumb="/library/metadata/2/thumb/1670555723" art="/library/metadata/2/art/1670555723" duration="7589952" originallyAvailableAt="2022-08-03" addedAt="1670555595" updatedAt="1670555723" audienceRatingImage="rottentomatoes://image.rating.upright" primaryExtraKey="/library/metadata/6" ratingImage="rottentomatoes://image.rating.rotten">
<Media id="1" duration="7589952" bitrate="1490" width="720" height="302" aspectRatio="2.35" audioChannels="6" audioCodec="ac3" videoCodec="h264" videoResolution="sd" container="mkv" videoFrameRate="24p" videoProfile="high">
<Part id="1" key="/library/parts/1/1670554365/file.avi" duration="7589952" file="/home/ryan/plex/movies/Bullet Train.avi" size="1416464255" container="mkv" videoProfile="high" />
</Media>
<Genre tag="Action" />
<Genre tag="Thriller" />
<Director tag="David Leitch" />
<Writer tag="Kotaro Isaka" />
<Writer tag="Zak Olkewicz" />
<Country tag="United States of America" />
<Role tag="Brad Pitt" />
<Role tag="Joey King" />
<Role tag="Aaron Taylor-Johnson" />
</Video>
<Video ratingKey="3" key="/library/metadata/3" guid="plex://movie/5e16333f188587003d049ef5" studio="Metro-Goldwyn-Mayer" type="movie" title="Dog" contentRating="PG-13" summary="Two former Army Rangers are paired against their will on the road trip of a lifetime. Briggs (Channing Tatum) and Lulu (a Belgian Malinois) race down the Pacific Coast to get to a fellow soldier&#39;s funeral on time." rating="7.7" audienceRating="8.9" year="2022" tagline="filthy animal unfit for human company and a...DOG" thumb="/library/metadata/3/thumb/1670555723" art="/library/metadata/3/art/1670555723" duration="6111882" originallyAvailableAt="2022-02-17" addedAt="1670555595" updatedAt="1670555723" audienceRatingImage="rottentomatoes://image.rating.upright" primaryExtraKey="/library/metadata/22" ratingImage="rottentomatoes://image.rating.ripe">
<Media id="2" duration="6111882" bitrate="2723" width="1920" height="800" aspectRatio="2.35" audioChannels="6" audioCodec="aac" videoCodec="h264" videoResolution="1080" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" audioProfile="lc" has64bitOffsets="0" videoProfile="high">
<Part id="2" key="/library/parts/2/1670554399/file.mp4" duration="6111882" file="/home/ryan/plex/movies/Dog (2022) - Channing Tatum.mp4" size="2084605533" audioProfile="lc" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" videoProfile="high" />
</Media>
<Genre tag="Comedy" />
<Genre tag="Drama" />
<Director tag="Channing Tatum" />
<Director tag="Reid Carolin" />
<Writer tag="Reid Carolin" />
<Writer tag="Brett Rodriguez" />
<Country tag="United States of America" />
<Role tag="Channing Tatum" />
<Role tag="Jane Adams" />
<Role tag="Kevin Nash" />
</Video>
<Video ratingKey="4" key="/library/metadata/4" guid="plex://movie/6075c220fb34990036168ad3" studio="Happy Madison Productions" type="movie" title="Home Team" contentRating="PG" summary="The story about New Orleans Saints head coach Sean Payton coaching his son&#39;s 6th grade football team, when Payton was suspended for the entire 2012 season as a result of his role in the Saints&#39; Bountygate scandal." rating="1.9" audienceRating="4.8" viewCount="1" lastViewedAt="1668279972" year="2022" tagline="Life doesn&#39;t have a playbook." thumb="/library/metadata/4/thumb/1670555723" art="/library/metadata/4/art/1670555723" duration="5830794" originallyAvailableAt="2022-01-28" addedAt="1670555595" updatedAt="1670555723" audienceRatingImage="rottentomatoes://image.rating.spilled" primaryExtraKey="/library/metadata/35" ratingImage="rottentomatoes://image.rating.rotten">
<Media id="3" duration="5830794" bitrate="2724" width="1920" height="804" aspectRatio="2.35" audioChannels="6" audioCodec="aac" videoCodec="h264" videoResolution="1080" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" audioProfile="lc" has64bitOffsets="0" videoProfile="high">
<Part id="3" key="/library/parts/3/1670554636/file.mp4" duration="5830794" file="/home/ryan/plex/movies/Home Team.mp4" size="1988966062" audioProfile="lc" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" videoProfile="high" />
</Media>
<Genre tag="Comedy" />
<Genre tag="Family" />
<Director tag="Charles Kinnane" />
<Director tag="Daniel Kinnane" />
<Writer tag="Chris Titone" />
<Writer tag="Keith Blum" />
<Country tag="United States of America" />
<Role tag="Kevin James" />
<Role tag="Taylor Lautner" />
<Role tag="Rob Schneider" />
</Video>
<Video ratingKey="5" key="/library/metadata/5" guid="plex://movie/5d776be17a53e9001e732ab9" studio="Paramount" type="movie" title="Top Gun: Maverick" contentRating="PG-13" summary="After thirty years, Maverick is still pushing the envelope as a top naval aviator, but must confront ghosts of his past when he leads TOP GUN&#39;s elite graduates on a mission that demands the ultimate sacrifice from those chosen to fly it." rating="9.6" audienceRating="9.9" viewCount="1" lastViewedAt="1666570550" year="2022" tagline="Feel the need... The need for speed." thumb="/library/metadata/5/thumb/1670555724" art="/library/metadata/5/art/1670555724" duration="7814634" originallyAvailableAt="2022-05-21" addedAt="1670555595" updatedAt="1670555724" audienceRatingImage="rottentomatoes://image.rating.upright" primaryExtraKey="/library/metadata/36" ratingImage="rottentomatoes://image.rating.ripe">
<Media id="4" duration="7814634" bitrate="2722" width="1920" height="1040" aspectRatio="1.85" audioChannels="6" audioCodec="aac" videoCodec="h264" videoResolution="1080" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" audioProfile="lc" has64bitOffsets="0" videoProfile="high">
<Part id="4" key="/library/parts/4/1670554664/file.mp4" duration="7814634" file="/home/ryan/plex/movies/Top Gun - Maverick.mp4" size="2664487989" audioProfile="lc" container="mp4" has64bitOffsets="0" optimizedForStreaming="0" videoProfile="high" />
</Media>
<Genre tag="Action" />
<Genre tag="Drama" />
<Director tag="Joseph Kosinski" />
<Writer tag="Ehren Kruger" />
<Writer tag="Christopher McQuarrie" />
<Country tag="United States of America" />
<Role tag="Tom Cruise" />
<Role tag="Miles Teller" />
<Role tag="Jennifer Connelly" />
</Video>
</MediaContainer>

@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

took me a sec, i think it just came down to the fact that you have 1 library which causes a runtime error. If youre interested please test out main once its done building ~10 minutes

@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

This appears to have fixed it, but I'm thinking there might be other parts referencing this same thing - just don't have time to look.

It appears on refresh it loses count, as my movies goes back from 4 to 0 after it does its periodic refresh. On first load of the page it's correct.

@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

@shamoon would you like me to open a new issue?

@shamoon shamoon added bug Something isn't working and removed cant reproduce labels Dec 10, 2022
@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

Hmm, I cant reproduce that (with your data). Perhaps try re-creating the container?

@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

Edit: I see it now, lemme investigate...

@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

Awesome, was just about to let you know :)

https://rzr.bz/077kjgkq7.png

@shamoon shamoon reopened this Dec 10, 2022
@shamoon shamoon self-assigned this Dec 10, 2022
@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

ok, think I've got it (wasn't the same bug, youre just eagle-eyed for noticing)
again, building main https://github.com/benphelps/homepage/actions/runs/3665051121

@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

Ps. Where did you get a 401? that still doesnt make sense to me

@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

So, in my tiredness, I made a mistake. I had a "ping" set for the widget, but the ping was set to the incorrect domain. So I had the 401 from that, but the error for the library also at the same time and combined them. You can see this here.

The error I actually had in regards to this issue was a 500 proxy error in the network console.

@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

Ah thanks, yea thats what threw me off initially =)

@shamoon shamoon changed the title Plex Widget 401 Error Plex Widget API Error Dec 10, 2022
@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

Your latest commit to main appears to be working great now, thank you!

@nackerr
Copy link
Author

nackerr commented Dec 10, 2022

Hey there, hate to be the bearer of bad news but it's still happening after some time. @shamoon

https://rzr.bz/wmpsddv2y.png

@shamoon
Copy link
Collaborator

shamoon commented Dec 10, 2022

Hmm, now I really cant reproduce. This has been running for > 1h (I changed all the cache times to be very low to make sure). I will leave it running.

At the risk of being annoying, I would ask the same questions:

  • Can you try hard recreate of the container
  • Any relevant logs?

Screen Shot 2022-12-10 at 2 07 26 PM

@nackerr
Copy link
Author

nackerr commented Dec 11, 2022

No logs with anything relevant. I did a docker stop, a docker pull (to get latest main), and then I ran the following:

docker run --restart=always -p 3000:3000 -d -v /homepage/config:/app/config -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/benphelps/homepage:main

Just did it again, we shall see.

@nackerr
Copy link
Author

nackerr commented Dec 11, 2022

Yeah, just happened again. Not sure :(

@shamoon shamoon reopened this Dec 11, 2022
@shamoon
Copy link
Collaborator

shamoon commented Dec 11, 2022

I can re-create it only in docker, think I have an idea...

@shamoon
Copy link
Collaborator

shamoon commented Dec 11, 2022

Alright mate, really hoping to finally have this Its still the second issue from above, it just wasn't fixed by that change.

Closed by 146326f

@shamoon shamoon closed this as completed Dec 11, 2022
Copy link
Contributor

github-actions bot commented Feb 6, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants