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

Failed to obtain Plex libraries #894

Closed
Safemode opened this issue Jan 6, 2017 · 19 comments
Closed

Failed to obtain Plex libraries #894

Safemode opened this issue Jan 6, 2017 · 19 comments

Comments

@Safemode
Copy link

Safemode commented Jan 6, 2017

Ombi Version:

V 1.10.1

Update Branch:

Stable

Operating System:

Windows 8.1 Professional x64

Mono Version (only if your not on windows)

Applicable Logs (from /logs/ directory or the Admin page):

Snippet from logs below. Pastebin of whole log - http://pastebin.com/bXF9xhPM


2017/01/05 18:20:20.831 PlexRequests.Services.Jobs.PlexContentCacher Error: Failed to obtain Plex libraries Mono.Data.Sqlite.SqliteException (0x80004005): Abort due to constraint violation
NOT NULL constraint failed: PlexContent.ProviderId
   at Mono.Data.Sqlite.SQLite3.Reset(SqliteStatement stmt)
   at Mono.Data.Sqlite.SQLite3.Step(SqliteStatement stmt)
   at Mono.Data.Sqlite.SqliteDataReader.NextResult()
   at Mono.Data.Sqlite.SqliteDataReader..ctor(SqliteCommand cmd, CommandBehavior behave)
   at Mono.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Mono.Data.Sqlite.SqliteCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command)
   at SQLiteAdapter.Insert(IDbConnection connection, IDbTransaction transaction, Nullable`1 commandTimeout, String tableName, String columnList, String parameterList, IEnumerable`1 keyProperties, Object entityToInsert)
   at Dapper.Contrib.Extensions.SqlMapperExtensions.Insert[T](IDbConnection connection, T entityToInsert, IDbTransaction transaction, Nullable`1 commandTimeout)
   at PlexRequests.Store.Repository.BaseGenericRepository`1.Insert(T entity) in C:\projects\requestplex\PlexRequests.Store\Repository\BaseGenericRepository.cs:line 86
   at PlexRequests.Services.Jobs.PlexContentCacher.CachedLibraries(PlexSettings plexSettings) in C:\projects\requestplex\PlexRequests.Services\Jobs\PlexContentCacher.cs:line 253

Problem Description:

When saving the Plex Authorization Token and restarting the service, Ombi will "usually" obtain the Plex libraries the initial run. But subsequent runs of the scheduled task end up failing to obtain the libraries, and so requests no longer show if an item is already in Plex. I've tried the 3 different Tokens I know of (1. Automatically generated within Ombi 2. Token at the end of the URL of XML when using Internal IP of server 3. Token at the end of the URL of XML when using plex.tv) and all end up experiencing the same problem.

From logs, note the times 11:54:31.343 and 12:04:49.441. Both are times I'd restarted the service and then let run for a few to make sure the Plex Cacher was able to finish, and requests showed if they were already in Plex or not. Following the restart of the service at 12:12:39.247, the initial Plex Cacher was unable to obtain the Plex libraries. And a snippet of the Log page from when I was messaging Tidusjar, http://i.imgur.com/xo2Rolr.png

Also of note, when the libraries are detected and loaded in, and it sees an item that was requested, it attempts to notify the user, and then says that there is no email address for that user. It's a Plex Account, and one I created, so I know the email is valid and exists, and it shows up in the User Management page and is unable to even be edited there. Screenshot - http://i.imgur.com/FFOm5Pf.png

Reproduction Steps:

Setting the token and then restarting the service, then waiting for the initial Plex Cacher to finish. Generally occurs in subsequent Plex Cacher runs Does not matter if "Enable Episode Searching" is enabled or disabled

Also set up a fresh install on Server 2012 R2, Getting same error of failing to obtain Plex Libraries. logs here -> http://pastebin.com/mSrTaAhW

Other Notes:

So I set up both computers with a request for the movie Jason Bourne (2016). Ombi Install 1 on the Win8.1 computer detected the movie, and was unable to notify user Jasper because according to it, "There is no email address for this Plex user, cannot send notification". But on my Win2012R2 box, while it took a few hours to detect, due to failing to obtain Plex Libraries, when it did eventually get the library information, it was able to send the email successfully to user Jasper and I confirm the email was received. Both have the same SMTP settings, but the Server2012R2 box is using the automatically generated Plex Authorization Token, while the Win8.1 computer is using the token from Plex.tv XML. (Side note, didn't realize until now my 2012R2 server had the wrong date, which has now been corrected)

Server2012R2 - http://i.imgur.com/xANGyFz.png

Win8.1 - http://i.imgur.com/HDiACmg.png

@Ombi-robot
Copy link

Hi!
Thanks for the issue report. Before a real human comes by, please make sure you used our bug report format.
Before posting make sure you also read our FAQ and known issues.
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.
Cheers!
Ombi Support Team

@heartisall
Copy link

I'm having the exact same issue. Getting a lot of requests for movies I already have.

@tidusjar
Copy link
Member

tidusjar commented Jan 9, 2017

@heartisall are you having the same error in the logs regarding to it cannot find the Plex Libraries?

@heartisall
Copy link

Yep, exact same error

@tidusjar
Copy link
Member

tidusjar commented Jan 9, 2017

Have you always had this issue using this version, or has it just happened?

Trying to figure out if it's a change I made or Plex has changed their API.

In the latest EAP (I'm releasing today/tomorrow) I have made some changes around this so it might make a difference

@heartisall
Copy link

Well I did notice getting the duplicate movies for the past month or so, but didn't look in the logs till now. I would guess it's been around for the last version or two at least.

@Safemode
Copy link
Author

Safemode commented Jan 9, 2017

This is the only version I've had the issue with, last time I'd tried the .net version was when it first released, but my setup wasn't fully in place so I didn't dive deep to see if it obtained the plex libraries or not. I can set up a test install of EAP to see if it still runs into the same issue or not. From my own experience, it seems like being active at all on the plex page will respond and get the libraries over to PR V 1.10.1. But if Plex is left alone, it goes into some sort of idle/sleep mode with requests and PR V 1.10.1 times out and is unable to get the libraries

@tidusjar
Copy link
Member

tidusjar commented Jan 9, 2017

If you could give the latest EAP a go that would be great: https://ci.appveyor.com/project/tidusjar/requestplex/build/2.0.1193/artifacts

@Safemode
Copy link
Author

Safemode commented Jan 9, 2017

Sure. Downloaded and setting up now. Just going to copy settings over from PR to Ombi to prevent any potential issues using the PR database itself

@Safemode
Copy link
Author

Safemode commented Jan 9, 2017

So I downloaded and set up Ombi EAP, and it seems that it's detecting the library because items are showing up as available. But now when the Plex Cacher goes through, now it gives an error for every movie saying "Provider Id on movie blahblah is null", but the items are still showing at least, and I didn't see the unable to pull plex libraries error. and also with Ombi it's also giving the error that it's unable to send the email that an item is available because the email doesn't exist. I'll be able to pull the log file shortly once I'm at a computer.

Ombi logs for the build you linked me - http://pastebin.com/USDVq3zV

@tidusjar
Copy link
Member

That's interesting @DblTapZ

What Plex Version are you running?

Also the users that it's trying to send the email to e.g. Jasper, are they a managed user?

@Safemode
Copy link
Author

Running Plex Version 1.3.3.3148, newest available in Public Release Channel

Any users I'm trying to send to are Plex accounts that I've shared my library with. I don't have any manually created users via Ombi interface

@Safemode
Copy link
Author

If needed, I could set up an Ombi local account and give you access to my Ombi page, if that would help at all on your end

@tidusjar
Copy link
Member

The Provider Id on movie blahblah is null error is that for some reason that the key guid in the metadata for a movie/tv show is empty or we are now not parsing it correctly.

Can you post the XML for the movie 10 Cloverfield Lane please?
Press Info on the movie and then View XML

image

@Safemode
Copy link
Author

See attached for XML document
10CloverfieldLane.zip

@Safemode
Copy link
Author

Safemode commented Jan 10, 2017

Actually I think I just figured out the Provider ID is null issue, don't believe it's an issue on your end. Currently restoring data to a drive and set Plex to not automatically empty trash so that I wouldn't lose the metadata and have to re-match items. All the titles it's listing in the log are things that haven't finished restoring yet that are at the bottom of the restore list. So those errors should start disappearing as titles are put back on the drive. Just tested by doing a Ctrl+F for a title that was missing yesterday but there today, and it doesn't show an error in the log for today. My bad on not noticing that sooner, I guess Ombi goes a bit more in depth with the checking since I hadn't seen those errors and when you mentioned info could be empty, it made me think of this possibility. So it seems upgrading to the Ombi EAP has resolved the failure to obtain library issue, doing a Ctrl+F on both yesterday's and today's log I'm unable to find "failed to obtain" anywhere in the logs

@tidusjar
Copy link
Member

Ok, so it's just the email issue? Or are you still having the library issue?

@Safemode
Copy link
Author

Safemode commented Jan 10, 2017

At this point yeah, it looks like the email issue is the only other thing. Want a new issue opened up for that?

And for the sake of just having more logs in case anyone else runs into this issue,
1-9-17 - http://pastebin.com/AhkPxwT0
1-10-17 - http://pastebin.com/A9c2yhmc
Note that "Tomorrow Never Dies" as an example is showing Provider ID is null for 1-9-17 but is missing on 1-10-17, now that the item is back in the library

@tidusjar
Copy link
Member

Yes that would be good, makes it more clear what to focus on. It seems that this issue has been fixed with the EAP build. Soon to go out.

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

No branches or pull requests

5 participants