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

History not updating #484

Closed
bjay1404 opened this issue Jan 25, 2016 · 49 comments
Closed

History not updating #484

bjay1404 opened this issue Jan 25, 2016 · 49 comments
Labels

Comments

@bjay1404
Copy link

Hello,

I'm using the latest git version 0ba5012 and the shows / movies have stopped writing to the history. Plexpy is running on Ubuntu 14.04 and Version 0.9.15.2 of Plex. It looks like massive changes were made on 1/23/2016. Maybe it's because it can't read my plex directory for some reason?

2016-01-24 22:48:44 ERROR Unable to open Plex Log file. [Errno 2] No such file or directory: '/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log'

@bjay1404
Copy link
Author

Actually I don't think it has anything to do with the media server logs. I realized that the vm running plexpy is not the same vm that is running plex. Calling /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log is really on a remote file system. I'm setting up a symlink and an nfs share to get this in place, but everything working perfectly before 1/23/2016.

@JonnyWong16
Copy link
Contributor

Is the library updating? (The message on the libraries page)

Logging is disabled during the update.

@bjay1404
Copy link
Author

No, it's not up to date, at least in terms of what I've actually watched.
It says this " PlexPy is updating library IDs in the database. This could
take a few minutes to hours depending on the size of your database.
You may leave this page and come back later. Note: All monitoring has been
disabled while this update is in progress."

On Mon, Jan 25, 2016 at 12:14 AM, JonnyWong16 notifications@github.com
wrote:

Is the library updating? (The message on the libraries page)

Logging is disabled during the update.


Reply to this email directly or view it on GitHub
#484 (comment)
.

@bjay1404
Copy link
Author

I did try an earlier commit. That database had at least 24 hours to update. It's probably updating now because I tried an earlier commit just to test and then got back to master.
/plexpy$ git checkout 651b57a

@phobiac
Copy link

phobiac commented Jan 25, 2016

Git hash: 0ba5012

I'm experiencing exactly the same. Based on my logs I haven't had anything written to history since 01/18. I've dropped a pastebin of plexpy.log here because it's pretty long. I'm pretty sure the relevant bits though are these messages, which keep coming up

25-Jan-2016 01:15:56 - WARNING :: Thread-13 : PlexPy Users :: Unable to retrieve user from local database. Requesting user list refresh.
25-Jan-2016 01:15:56 - WARNING :: Thread-14 : PlexPy Users :: Unable to retrieve user from local database. Requesting user list refresh.
25-Jan-2016 01:15:56 - WARNING :: Thread-13 : PlexPy Libraries :: Unable to retrieve library from local database. Requesting library list refresh.
25-Jan-2016 01:15:56 - WARNING :: Thread-14 : PlexPy Libraries :: Unable to retrieve library from local database. Requesting library list refresh.

and then

25-Jan-2016 01:22:25 - INFO    :: Thread-29 : PlexPy Pmsconnect :: Requesting libraries list refresh...
25-Jan-2016 01:22:25 - DEBUG   :: Thread-29 : PlexPy Pmsconnect :: No library data.
25-Jan-2016 01:22:26 - INFO    :: Thread-29 : PlexPy Pmsconnect :: Libraries list refreshed.

@monsieurlatte
Copy link

Same thing here, I updated a few days ago, and ever since history is not updating. I see activity posting on the dashboard. I have tried everything, I deleted the DB and started from scratch, resetup the perm tokens and paths etc, but still nothing happening.

@JonnyWong16
Copy link
Contributor

I pushed a update to master. Try updating PlexPy again.

@RevitXman
Copy link

Updated to the latest version, but the History for users/graphs are no longer updating. The Library has been updating since yesterday

@crazybadger
Copy link

I have a similar problem with the history not updating, but running 1.3.2 within a FreeNAS jail. Recently added items on the homepage is updating as I downloaded the new X-Files episode, which I also watched this afternoon but it'd not showing in the history.

I'm also getting this message when I click on the User page, although when I click the close button it displays a list of users:

DataTables warning: table id=users_list_table - Requested unknown parameter 'last_watched' for row 0. For more information about this error, please see http://datatables.net/tn/4

@JonnyWong16
Copy link
Contributor

@crazybadger Force refresh the Users page (Ctrl+F5)

@Hellowlol
Copy link
Contributor

Every update in htpc manager invalidate cache for 3 days after a update :p I remember why I did it now xD

@bjay1404
Copy link
Author

So it looks like my Library is done updating after I stopped the service,
git pull -f, and started the service. I got a notification from pushover
that something was being watched. Let's see if it makes it to the history.

On Mon, Jan 25, 2016 at 2:31 PM, Hellowlol notifications@github.com wrote:

Every update in htpc manager invalidate cache for 3 days after a update :p
I remember why I did it now xD


Reply to this email directly or view it on GitHub
#484 (comment)
.

@riemers
Copy link

riemers commented Jan 25, 2016

I had the exact same issues, i was about to post and did one last restart.... And now all of a sudden it works. It was stuck all the time at updating for history. Only did a manual git pull, but it said "nothing to update" but cant think of anything else i did in between.

@bjay1404
Copy link
Author

Everything is working smoothly for me again. Thanks!
On Jan 25, 2016 5:52 PM, "Erik-jan Riemers" notifications@github.com
wrote:

I had the exact same issues, i was about to post and did one last
restart.... And now all of a sudden it works. It was stuck all the time at
updating for history. Only did a manual git pull, but it said "nothing to
update" but cant think of anything else i did in between.


Reply to this email directly or view it on GitHub
#484 (comment)
.

@RevitXman
Copy link

I rebuilt my VM and pulled the plexpy.db into my new VM, now my history is working.

@phobiac
Copy link

phobiac commented Jan 26, 2016

Git hash: 35965a8

I updated. Unfortunately this doesn't seem to be mysteriously resolving for me. My libraries are updating, as far as I can tell, but still nothing is being logged. I get this in the logs still.

2016-01-25 22:28:08 DEBUG   PlexPy ActivityProcessor :: ratingKey None not logged. Does not meet logging criteria. Media type is 'None'
2016-01-25 22:28:08 WARNING PlexPy Libraries :: Unable to retrieve library from local database. Requesting library list refresh.
2016-01-25 22:28:08 WARNING PlexPy Libraries :: Unable to retrieve library from local database. Requesting library list refresh.
2016-01-25 22:28:08 WARNING PlexPy Users :: Unable to retrieve user from local database. Requesting user list refresh.
2016-01-25 22:28:08 WARNING PlexPy Users :: Unable to retrieve user from local database. Requesting user list refresh.

Any suggestions on how to go about fixing this short of wiping everything and starting all over? I've only got a few months of stats collected but I'd rather not lose them.

@JonnyWong16
Copy link
Contributor

Websockets enabled or disabled?

@JonnyWong16
Copy link
Contributor

I need everyone to post full logs when a stream is in session, and after a stream has stopped. Also, if possible, PM me your plexpy.db file on the forums while a stream is in session.

@JonnyWong16
Copy link
Contributor

This might sound crazy, but try this: Go to the settings change the "Monitoring Interval", click save, change it back, click save.

Look in the logs for

Re-scheduled background task: Check for active sessions

@riemers
Copy link

riemers commented Jan 26, 2016

Btw, i had websockets enabled.

@crazybadger
Copy link

The Crtl-F5 fixed my User issue and updating to 1.3.3 appears to have resolved the History problem.

@Mawuena
Copy link

Mawuena commented Jan 26, 2016

Hello,
My "history" is also not updating but just for "TV shows". The "movies" and "music" are working fine but "tv shows" (hence "all" as well) keep saying "fetching rows" and nothing else.

One more weird thing is that it shows a datatables warning (see attached).
I've restarted, uninstall/reinstall but still nothing.

Anyone has any idea as to how to fix this please ?

Sincerely,

Mawuena
screenshot from 2016-01-26 20-04-31

@JonnyWong16
Copy link
Contributor

Someone else on the forum had the same problem with one TV show. See if you can figure out which TV show/Episode that's causing the problem. You can navigate to it from the library, and find the one episode page which also gives the datatable warning.

@Mawuena
Copy link

Mawuena commented Jan 26, 2016

Holy cow, you're right.
I've find a specific show where it's been happening.
How can I fix it (or delete the show from the PlexPy library or something) ?

@JonnyWong16
Copy link
Contributor

  1. First, back up your plexpy.db file.
  2. Then you need to open your plexpy.db file using SQLite Browser and find the row in the database for that corrupted session. I think it's easiest if you look through the session_history_metadata table.
  3. Once you find the row, get the id number for that row (in the id column).
  4. Navigate to http://localhost:8181/delete_history_rows?row_id=<row_id>, where <row_id> is the id from step 3. That will remove the entry cleanly.

@Mawuena
Copy link

Mawuena commented Jan 26, 2016

Daaaamn ! Worked perfectly.
Will definitely keep this handy as I'm sure it'll happen again.
Basically sickbeard downloaded a fake episode which I deleted from plex but plexpy didn't take it well apparently.

Anyway thank you very much for your help

@lokenx
Copy link

lokenx commented Jan 26, 2016

My history stopped updating a few days ago for both PMS installs and both PlexPy installs. While watching a stream for a few minutes and then stopping the logs show the below. However it does pick up that's somethings being watched actively.

2016-01-26 18:13:30 DEBUG   PlexPy ActivityProcessor :: Fetching metadata for item ratingKey 200283
2016-01-26 18:13:30 DEBUG   PlexPy Monitor :: Removing sessionKey 2 ratingKey 200283 from session queue
2016-01-26 18:11:30 WARNING PlexPy Libraries :: Unable to retrieve library from local database. Requesting library list refresh.
2016-01-26 18:11:30 DEBUG   PlexPy ActivityProcessor :: History logging for library 'Local' is disabled.
2016-01-26 18:11:30 WARNING PlexPy Libraries :: Unable to retrieve library from local database. Requesting library list refresh.
2016-01-26 18:11:30 DEBUG   PlexPy Monitor :: Removing sessionKey 631 ratingKey 201204 from session queue

@JonnyWong16
Copy link
Contributor

Either you're not logged in to your Plex account, or you're using the "Local" user and logging is disabled.

2016-01-26 18:11:30 DEBUG   PlexPy ActivityProcessor :: History logging for library 'Local' is disabled.

@lokenx
Copy link

lokenx commented Jan 26, 2016

You mean from the web app or within PlexPy? The web is through https://app.plex.tv/web/app and logged in with the same account that is the server user. Which is also in PlexPy with a token that I just refreshed.

My update_section_ids was 0, should it be or -1. I've never manually changed it.

@JonnyWong16
Copy link
Contributor

Web app. Try logging out and logging back in.

@jamiehd
Copy link

jamiehd commented Jan 26, 2016

I have had the same issue as lokenx for the past few days. I can see what is currently being played, but no history is saved.

@lokenx
Copy link

lokenx commented Jan 26, 2016

Hmm seems fine now. Odd! Just have a 3 day block of missing history data for both servers (which I know where actively used during that time). Thanks for help! I changed my update_setion_ids to -1 because it was hanging for me after a restart I just did. Not sure if that shook things loose?

@jamiehd
Copy link

jamiehd commented Jan 26, 2016

Logging out and back in has fixed it for me too. Thanks for the help Jonny.

@JonnyWong16
Copy link
Contributor

update_setion_ids should be 0 once the library update finishes. Setting it back to 1 or -1 would just trigger an update (of nothing) and it will set itself back to 0.

@ghost
Copy link

ghost commented Jan 27, 2016

I can confirm this is still a problem and is NOT fixed by any of the solutions included here. CentOS7, Plex Media Server 0.9.14 or 0.9.15, and PlexPy's latest.

@JonnyWong16
Copy link
Contributor

Just posting that something doesn't work won't help me fix it. I need the logs.

EDIT: And complete logs, not just the lines you think are related the problem. Lines that are missing from the logs are just as useful as lines that show up in the logs.

@ghost
Copy link

ghost commented Jan 27, 2016

I have no idea what log entries might be relevant to this discussion. If you would like whole logs, please let us know where these can be privately sent to relevant authors. Publicly posting logs is a strict no.

I see nothing unusual/different/notable in the logs. It simply stopped working across several servers immediately after the upgrade and hasn't worked since. If I had kept a copy of the old source code, I would blow all the databases and installs away and rebuild it. As it is, I have no clue where to start.

Every single install just immediately stopped populating History entirely after shutting down, updating from GIT, and starting again. No solution posted here has had any effect.

The only possibly relevant entry is this on every start:

Altering database. Removing unique constraint on section_id from library_sections table.

but I'm hardly the first to report that.

@JonnyWong16
Copy link
Contributor

Just post your entire log to pastebin or something. Like I said above:

Lines that are missing from the logs are just as useful as lines that show up in the logs.

As for

Altering database. Removing unique constraint on section_id from library_sections table.

PM your plexpy.db file on the forum.

@Hellowlol
Copy link
Contributor

@linhub the reason to post the full log is because you don't know what relevant or not.
Since your using git and is bitching like a little girl I suggest you reset to the version that did work for you...

@ghost
Copy link

ghost commented Jan 27, 2016

@JonnyWong16 Thank you for your help. Unfortunately, the problem seems to be with something besides my plexpy.db or specific install.

I started with a fresh pull from GIT, no database, no logs, and nothing to send to anyone. After starting it once, I see the "Altering database" line. Upon restart, it does it again.

27-Jan-2016 14:16:35 - INFO :: MainThread : PlexPy is restarting...
27-Jan-2016 14:16:35 - INFO :: MainThread : Restarting PlexPy with ['/usr/local/bin/python', '/home/holder/plexpy/PlexPy.py', '--nolaunch']
27-Jan-2016 14:16:36 - INFO :: MainThread : Checking to see if the database has all tables....
27-Jan-2016 14:16:36 - DEBUG :: MainThread : Altering database. Removing unique constraint on section_id from library_sections table.

If PlexPy is showing this on databases that it is creating on first run, the problem is not in the existing DBs.

@JonnyWong16
Copy link
Contributor

Holy Jesus...the stuff you're posting is not helping me solve your problem.

  1. Open the plexpy.log file in the logs folder.
  2. Copy and paste the contents to http://pastebin.com/
  3. Post the link to your logs on pastebin.
  4. PM me your plexpy.db file on the forum.

@Hellowlol
Copy link
Contributor

@JonnyWong I hope you got your crystal ball ready!

@ghost
Copy link

ghost commented Jan 27, 2016

@JonnyWong16 I won't take up any more of your time as the reports are obviously not helping as they are. Good luck!

@JonnyWong16
Copy link
Contributor

@Hellowlol My crystal ball just facepalmed

@Hellowlol
Copy link
Contributor

@linhub you haven't reported anything useful. Your just waisting the dev time. Remember that people does this in there spare time without getting paid, at the expanse other realize duties. Its impossible to guess what might be wrong a 10k lines of code project. Bye

@JonnyWong16 yeah you failed so hard... :P

@bjay1404
Copy link
Author

Well the updates worked great for me. Thank you!

On Wed, Jan 27, 2016 at 2:18 PM, Hellowlol notifications@github.com wrote:

@linhub https://github.com/Linhub you haven't reported anything useful.
Your just waisting the dev time. Remember that people does this in there
spare time without getting paid, but impossible to guess what might be
wrong a 10k lines of code project. Bye

@JonnyWong16 https://github.com/Jonnywong16 yeah you failed so hard...
:P


Reply to this email directly or view it on GitHub
#484 (comment)
.

@ryanrdetzel
Copy link

Mine is still no update. I can post logs, what would help solve this? It seems random, some things are in history but not everything. Things are playing right now that are not in there.

@JonnyWong16
Copy link
Contributor

Sure post your logs.

History is only recorded once a stream is stopped.

@JonnyWong16
Copy link
Contributor

I think this issue has been fixed. Open a new issue if this problem occurs again.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests