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

Buggy server selection logic #4

Closed
ddurdle opened this issue Mar 4, 2019 · 2 comments
Closed

Buggy server selection logic #4

ddurdle opened this issue Mar 4, 2019 · 2 comments

Comments

@ddurdle
Copy link

ddurdle commented Mar 4, 2019

Seems there is some server selection buggy logic.

Out of 3 tested plex accounts, only works with 1. On another, it seems to get hung up parsing the server list with this error: 2019-03-04 13:51:27 - INFO :: MainThread : Tautulli WebStart :: Starting Tautulli web server on http://0.0.0.0:8181/
2019-03-04 13:51:29 - ERROR :: Thread-3 : Uncaught exception: Traceback (most recent call last):
File "/opt/Tautulli.2/plexpy/logger.py", line 341, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/Tautulli.2/plexpy/servers.py", line 149, in refresh_users
result = users.refresh_users()
File "/opt/Tautulli.2/plexpy/users.py", line 54, in refresh_users
shared_libraries = user.pop('shared_libraries')
KeyError: 'shared_libraries'

Traceback (most recent call last):
File "/opt/Tautulli.2/plexpy/logger.py", line 341, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/Tautulli.2/plexpy/servers.py", line 149, in refresh_users
result = users.refresh_users()
File "/opt/Tautulli.2/plexpy/users.py", line 54, in refresh_users
shared_libraries = user.pop('shared_libraries')
KeyError: 'shared_libraries'

Then on the third, it gets past this but it is using the wrong API token against the wrong server so it is not able to retrieve the user list. The code is thinking it is talking to server 3 but it is talking to server 2 and vice-versa.

2019-03-04 13:51:56 - INFO :: WebSocket-ad : Tautulli Users :: Requesting users list refresh...
2019-03-04 13:52:01 - WARNING :: WebSocket-ad : Failed to access uriendpoint /api/servers/XXXX/shared_servers. Status code 404
2019-03-04 13:52:01 - WARNING :: WebSocket-ad : Tautulli PlexTV :: Local: Unable to parse shared server list XML for get_full_users_list:'NoneType' object has no attribute 'getElementsByTagName'.
2019-03-04 13:52:01 - WARNING :: WebSocket-ad : Tautulli Users :: Unable to refresh users list.

The official documentation from Tautulli indicates that error will occur if the identify number is wrong. I checked in the Settings and the numbers line up, so it must be using the wrong numbers for the API calls.

Version:
latest
Branch:
v3.00

Commit hash:

Operating system:
Linux Debian
Python version:
2.7

What you did?
Tried to
What happened?

What you expected?

How can we reproduce your issue?

What are your (relevant) settings?

Link to logs:

@ddurdle
Copy link
Author

ddurdle commented Mar 4, 2019

Found the issue. Apparently on some accounts, certain variables are not defined ('') and by casting to an int in the parameter fetching, this causes an issue and prevents the server list from populating properly.

I have made these return an appropriate value if not defined so that the server list will correctly populate.

See #5

@zSeriesGuy
Copy link
Owner

Thanks a bunch for catching and correcting this.

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

No branches or pull requests

2 participants