tehkillerbee / mopidy-tidal

Tidal Backend plugin for Mopidy
Apache License 2.0
91 stars 28 forks source link

Another Unhandled exception in TidalBackend #177

Open honza-1 opened 6 days ago

honza-1 commented 6 days ago

I am using mopidy 3.3.0 on raspberry pi. After updating mopidy-tidal and deleting oauth json file I run in the problem described several times under issues.

Sep 15 20:59:25 hifi mopidy[489]: INFO [TidalBackend-7] mopidy_tidal.backend Visit link.tidal.com/NUEXM to log in, the code will expi Sep 15 21:04:26 hifi mopidy[489]: ERROR [TidalBackend-7] pykka Unhandled exception in TidalBackend (urn:uuid:cb2df7c9-b076-419a-be63-1 Sep 15 21:04:26 hifi mopidy[489]: Traceback (most recent call last): Sep 15 21:04:26 hifi mopidy[489]: File "/usr/local/lib/python3.7/dist-packages/pykka/_actor.py", line 179, in _actor_loop Sep 15 21:04:26 hifi mopidy[489]: self.on_start() Sep 15 21:04:26 hifi mopidy[489]: File "/usr/local/lib/python3.7/dist-packages/mopidy_tidal/backend.py", line 83, in on_start Sep 15 21:04:26 hifi mopidy[489]: self.oauth_login_new_session(oauth_file) Sep 15 21:04:26 hifi mopidy[489]: File "/usr/local/lib/python3.7/dist-packages/mopidy_tidal/backend.py", line 29, in oauth_login_new_se Sep 15 21:04:26 hifi mopidy[489]: self._session.login_oauth_simple(function=logger.info) Sep 15 21:04:26 hifi mopidy[489]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/session.py", line 323, in login_oauth_simple Sep 15 21:04:26 hifi mopidy[489]: future.result() Sep 15 21:04:26 hifi mopidy[489]: File "/usr/lib/python3.7/concurrent/futures/_base.py", line 432, in result Sep 15 21:04:26 hifi mopidy[489]: return self.get_result() Sep 15 21:04:26 hifi mopidy[489]: File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in get_result Sep 15 21:04:26 hifi mopidy[489]: raise self._exception Sep 15 21:04:26 hifi mopidy[489]: File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run Sep 15 21:04:26 hifi mopidy[489]: result = self.fn(*self.args, **self.kwargs) Sep 15 21:04:26 hifi mopidy[489]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/session.py", line 355, in _process_link_login Sep 15 21:04:26 hifi mopidy[489]: json = self._wait_for_link_login(json) Sep 15 21:04:26 hifi mopidy[489]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/session.py", line 389, in _wait_for_link_login Sep 15 21:04:26 hifi mopidy[489]: raise TimeoutError('You took too long to log in') Sep 15 21:04:26 hifi mopidy[489]: TimeoutError: You took too long to log in

No oauth json file is created I checked access permissions on mopidy data directory, which were ok. Nevertheless I changed to 777 for testing without positive result. I tried to install from master, which failed with message about missing setup.py. After installing from https://github.com/BlackLight/mopidy-tidal I did not get a better result as well. Have I overseen a relevant information ?

Thanks for any help !

My reaction time was surely under 300 seconds.

honza-1 commented 16 hours ago

I remove mopidy-tidal and installed freshly from sudo pip3 install git+https://github.com/BlackLight/mopidy-tidal

The output from journalctl -f -u mopidy:

Sep 21 21:19:46 hifi mopidy[11627]: INFO [TidalBackend-7] mopidy_tidal.backend Connecting to TIDAL.. Quality = LOSSLESS Sep 21 21:19:46 hifi mopidy[11627]: WARNING [TidalBackend-7] mopidy_tidal.backend Connecting to TIDAL.. always provide client_id and client_secret together Sep 21 21:19:46 hifi mopidy[11627]: INFO [TidalBackend-7] mopidy_tidal.backend Connecting to TIDAL.. using default client id & client secret from python-tidal Sep 21 21:19:46 hifi mopidy[11627]: INFO [TidalBackend-7] mopidy_tidal.backend Loading OAuth session from /var/lib/mopidy/tidal/tidal-oauth.json... Sep 21 21:19:46 hifi mopidy[11627]: INFO [TidalBackend-7] mopidy_tidal.backend Could not load OAuth session from /var/lib/mopidy/tidal/tidal-oauth.json: Expecting value: line 1 column 1 (char 0) Sep 21 21:19:46 hifi mopidy[11627]: INFO [TidalBackend-7] mopidy_tidal.backend Creating new OAuth session... Sep 21 21:19:46 hifi mopidy[11627]: INFO [TidalBackend-7] mopidy_tidal.backend Visit link.tidal.com/VXGGW to log in, the code will expire in 300 seconds Sep 21 21:20:13 hifi mopidy[11627]: ERROR [TidalBackend-7] pykka Unhandled exception in TidalBackend (urn:uuid:54393c45-f0ce-4362-bd30-09cfd73b16e6): Sep 21 21:20:13 hifi mopidy[11627]: Traceback (most recent call last): Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/pykka/_actor.py", line 179, in _actor_loop Sep 21 21:20:13 hifi mopidy[11627]: self.on_start() Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/mopidy_tidal/backend.py", line 83, in on_start Sep 21 21:20:13 hifi mopidy[11627]: self.oauth_login_new_session(oauth_file) Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/mopidy_tidal/backend.py", line 29, in oauth_login_new_session Sep 21 21:20:13 hifi mopidy[11627]: self._session.login_oauth_simple(function=logger.info) Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/session.py", line 323, in login_oauth_simple Sep 21 21:20:13 hifi mopidy[11627]: future.result() Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/lib/python3.7/concurrent/futures/_base.py", line 432, in result Sep 21 21:20:13 hifi mopidy[11627]: return self.get_result() Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in get_result Sep 21 21:20:13 hifi mopidy[11627]: raise self._exception Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run Sep 21 21:20:13 hifi mopidy[11627]: result = self.fn(*self.args, **self.kwargs) Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/session.py", line 364, in _process_link_login Sep 21 21:20:13 hifi mopidy[11627]: self.user = tidalapi.User(self, user_id=json['userId']).factory() Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/user.py", line 49, in factory Sep 21 21:20:13 hifi mopidy[11627]: return self.request.map_request("users/%s" % self.id, parse=self.parse) Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/request.py", line 118, in map_request Sep 21 21:20:13 hifi mopidy[11627]: return self.map_json(json_obj, parse=parse) Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/request.py", line 125, in map_json Sep 21 21:20:13 hifi mopidy[11627]: return parse(json_obj) Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/user.py", line 65, in parse Sep 21 21:20:13 hifi mopidy[11627]: return user.parse(json_obj) Sep 21 21:20:13 hifi mopidy[11627]: File "/usr/local/lib/python3.7/dist-packages/tidalapi/user.py", line 114, in parse Sep 21 21:20:13 hifi mopidy[11627]: self.gender = json_obj["gender"] Sep 21 21:20:13 hifi mopidy[11627]: KeyError: 'gender' Sep 21 21:20:13 hifi mopidy[11627]: ERROR [MainThread] mopidy.commands Actor died: TidalBackend (urn:uuid:54393c45-f0ce-4362-bd30-09cfd73b16e6) stopped before handling the message

There was no file created under /var/lib/mopidy/tidal/tidal-oauth.json.

For testing I created it with sudo -u mopidy touch with success and changes permissions with chown 777

Next try of starting mopidy had the same result.

If I try to install from master sudo pip3 install git+https://github.com/thekillerbee/mopidy-tidal I am asked for authentication, which I cannot provide on command prompt.

If I try to install from downloaded tar.gz with sudo pip3 install mopidy-tidal-0.3.6.tar.gz I receive FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-22k_3qr3/setup.py'

Please help.

tehkillerbee commented 15 hours ago

FYI, only the releases on PyPi or from this repository are supported. The repo from BlackLight is not up to date.

Make sure to remove both mopidy-tidal and tidalapi before continuing. Try installing the latest mopidy-tidal from PyPi, paired with the latest tidalapi from PyPi and see if this solves the problem. Installing mopidy-tidal from PyPi should be enough.

I am asked for authentication, which I cannot provide on command prompt.

What authentication are you talking about here? PKCE authentication requires you to visit a separate (local) Web page to authenticate tidal. For OAUTH, it should be adequate to visit the link for authentication to complete.