zSeriesGuy / Tautulli

A Python based monitoring and tracking tool for Plex Media Server.
http://tautulli.com
GNU General Public License v3.0
27 stars 9 forks source link

History tab says media is still playing, but it actually stopped hours ago. #2

Closed hobesman closed 5 years ago

hobesman commented 5 years ago

Version: 3.0.00 Branch: 3.0.00 Commit hash:

Operating system: Windows Python version: 2.7 What you did? Played media on roku and monitored remotely with Tautulli What happened? Tautulli properly showed that it started, but even now (12 hours later) still says it is playing. One says "currently playing" in the history, and one says "currently stopped" on the same device. But the "stopped" time on the stopped one always says the current time when I refresh, and the "duration" is continually growing. The one that says it's "Currently playing" says "n/a" in the "stopped" time but the duration also keeps growing. On the "Activity" portion of the Tautulli home screen, neither shows as playing, and in reality neither is actually still playing. I restarted the plex server, started and stopped other media on the same device as the same user, exited and restarted the Plex Roku app, restarted Tautulli. Nothing seems to get these two entries to update properly. I also can't delete them because they don't have a "delete" button when I enter delete mode. What you expected? Tautulli would recognize that the media is no longer playing and log it accordingly. How can we reproduce your issue?

What are your (relevant) settings?

Link to logs:

capture1

hobesman commented 5 years ago

I "fixed" the problem but I haven't identified what caused it. I shut down Tautulli, renamed tautulli.db to tautulli2.db, started Tautulli again, imported the renamed tautulli2.db, and then eventually restarted tautulli again. The "broken" entries were simply gone, and everything else seemed to continue functioning normally.

zSeriesGuy commented 5 years ago

Do you have DB Browser for SQLite where you can browse the database? If so, could you look at the sessions table to see if those two entries that were stuck are in your tautulli2.db? I'm trying to figure out where the problem might be.

hobesman commented 5 years ago

Just checked. Yes, they are there in "sessions"

zSeriesGuy commented 5 years ago

@hobesman I made some changes that may correct this issue. There was the possibility that multiple servers could use the same session key. I made changes to add server id as part of the key. BTW, in case this branch never makes it into the official repo, I would recommend you leave your server running with the official tautulli code and set up a new server with this code. That way you can continue to collect history on the official code, just in case.

hobesman commented 5 years ago

Not sure if that was the cause but it's good to prevent that scenario either way.

That would be very disappointing if this (or something like it) didn't end up in the official version. This does everything I imagined when I pictured multi-server support, and adds a few nice features I hadn't thought of.

That said, I took your advice and set up a parallel instance of the official Tautulli version in case this particular dream never comes true.

zSeriesGuy commented 5 years ago

@hobesman Have you seen any more issues like this or anything else not working correctly?

zSeriesGuy commented 5 years ago

Closing this issue. I have not seen this issue anymore and believe it to be resolved.

hobesman commented 5 years ago

I hadn't updated to apply the changes you made and I came across some more neverending entries today. I closed Tautulli, deleted those sessions from the DB, updated with your latest changes, and started it up again. Hopefully that prevents it from happening again... I haven't come across any other troubles.