-
-
Notifications
You must be signed in to change notification settings - Fork 411
Closed
Description
Describe the bug
Whenever I/Users try to login into Ombi (on a web page, works fine on computer/ IOS app) using plex authentication it says "you have successfully signed in. You may now close the window. The window, doesn't auto close and it doesn't log into ombi.
To Reproduce
Steps to reproduce the behavior:
- "sign in with Plex"
- Sign in
- Wait for autoclose, which doesnt.
- "cannot log you in"
Expected behavior
The Plex window auto closes and logs me in
Screenshots
Logs (Logs directory where Ombi is located)
If applicable, a snippet of the logs that seems relevant to the bug if present.
Desktop (please complete the following information):
- OS: Windows 10
Ombi Version (please complete the following information):
- Version 4.0.1425
- Media Server Plex
- Database Type: SQLite (Please change if using MySQL)
Additional context
Love Ombi, but please help|!
Activity
ombi-bot commentedon Jun 22, 2021
Hi!
Thanks for the issue report. Before a real human comes by, please make sure you used our bug report format.
Have you looked at the wiki yet? https://docs.ombi.app/
Before posting make sure you also read our FAQ.
Make the title describe your issue. Having 'not working' or 'I get this bug' for 100 issues, isn't really helpful.
If we need more information or there is some progress we tag the issue or update the tag and keep you updated.
Thanks!
Ombi Bot.
tidusjar commentedon Jun 22, 2021
On the user management page, with the user guy are trying to login, does it state the user is a Plex user or local user?
abendel commentedon Jun 22, 2021
pyarmak commentedon Jun 24, 2021
My plex oauth also broke after updating to V4. I tried a clean config (using docker) and even in the wizard, the oauth login with plex does not work while the request token button worked great. Seems to be an issue with oauth. I checked the logs and there was nothing useful there.
baemien commentedon Jun 25, 2021
Same exact issue here, tried on mobile and PC with the same results. Thought it may have been a cache issue so followed this commenters advice but it did not resolve the issue.
tidusjar commentedon Jun 25, 2021
So when the Plex OAuth window pops up and it states "You can now close this window" are you closing it?
Because Ombi will trigger once that window is closed
pyarmak commentedon Jun 25, 2021
@tidusjar Yes, window closes, button does a spinner, notification pops up saying auth failed.
Logs (turned up logging to Information):
tidusjar commentedon Jun 25, 2021
Can you open the dev tools? F12.
If so can you press the network tab and then refresh the page and attempt to log in.
You should see a call to
/api/v1/token/YOURPIN, what is the response on that call?pyarmak commentedon Jun 25, 2021
No problem, it posts some data (let me know if you want that as well) and the response is:
tidusjar commentedon Jun 25, 2021
There should be another call once you close the window a GET
pyarmak commentedon Jun 25, 2021
My apologies, here is the response to the GET request:
{"errorMessage":"Could not authenticate with Plex"}Not very descriptive, unfortunately.
EDIT: I should also mention that this also happens in incognito (no pre-existing cookies or any other nonsense).
@tidusjar I'd be happy to chat/help over google hangouts or what have you if you want to keep this issue from getting cluttered.
tidusjar commentedon Jun 25, 2021
Would discord be fine?
Out of curiosity what timezone is your ombi server in? Also is the time correctly set?
pyarmak commentedon Jun 25, 2021
@tidusjar Discord works for me (Nooblazor#7778).
As for your question, I use linuxserver/ombi docker container and set ENV TZ America/Winnipeg (my timezone). I'm not sure where to check the timezone in Ombi's UI.
Using the
datecommand in the container terminal yields:Fri Jun 25 12:49:25 CDT 2021While inspecting the PIN response in the devtools shows:
expiresAt: "2021-06-25T18:16:45Z"So this leads me to believe that the date is set properly and shouldn't be rejected by:
Ombi/src/Ombi.Core/Authentication/PlexOAuthManager.cs
Line 26 in 9c0d8f9
tidusjar commentedon Jun 25, 2021
@pyarmak That was my theory, so nice investigation there.
Can you grab a new PIN Id and call
GET https://plex.tv/api/v2/pins/PINIDand does it contain the correctexpiresAtand also theauthTokenproperty?Because the only time we would get that message is if Ombi things the Pin has expired OR the authToken returned from the above API call is null/empty
shawnbarton commentedon Jun 26, 2021
I have also been experiencing this issue for a few days now with the latest docker container (which reports as
4.0.1430 in the UI). Different users are affected on a rotating basis. A container restart temporarily resolves the issue - at least for the single reporting user. The logs do not always show an error when it happens.
but I have some errors like this:
And indeed when watching the developer tools during the login process, eventually, the
GET https://url/ombi/api/v1/token/xxxxxreturns witherror: "SQLite Error 5: 'database is locked'.".tidusjar commentedon Jun 26, 2021
That's a different issue, I'd suggest you change the database to use MySql, check the docs on how to do this
Added some more logging and resilience around the Plex OAuth login #4232
tidusjar commentedon Jun 28, 2021
I've made some changes relating to this issue in the develop branch, more information is now outputted to the logs when there's a OAuth Pin failure, it would be amazing if someone could try the new build and let me know the results.
Also when you close the Plex OAuth window, how long does it take until Ombi tells you that it could not log in? Under or over 10 seconds?
pyarmak commentedon Jun 29, 2021
I can confirm that, at least on my end, the update you pushed seemed to have fixed the issue!
I can login with plex oauth without issue on my setup now XD
stevenpall commentedon Jun 29, 2021
Also seems to have fixed the issue for me. Thanks!
tidusjar commentedon Jun 30, 2021
Awesome, so the issue was basically I was checking if the token had expired. The token issues is in local time, but I was checking against UTC