trompamusic / trompace-client

A python library to read from and write to the Trompa CE
Apache License 2.0
1 stars 0 forks source link

config.py _set_jwt_token() decoding issue #40

Closed aggelosgkiokas closed 4 years ago

aggelosgkiokas commented 4 years ago

Although it returns a token from the CE it crashes on the decoding (see attached) jtw_decode.tar.gz

alastair commented 4 years ago

try and change the scopes configuration value to just * as in the sample config file: https://github.com/trompamusic/trompa-ce-client/blob/2fcad51a59d0337f2d824ee24a64acf42c0666fb/trompace.ini

It would be helpful to include the output of any errors in a bug report to make it easier to give feedback.

aggelosgkiokas commented 4 years ago

Same error with * in the scopes. I get the following:

Traceback (most recent call last): File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/usr/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete return future.result() File "/home/aggelos/PycharmProjects/processing_library/application.py", line 39, in test_query response = await trompace.connection.submit_query(qry, auth_required=True) File "/home/aggelos/envs/tpl/lib/python3.7/site-packages/trompace/connection.py", line 42, in submit_query token = config.jwt_token File "/home/aggelos/envs/tpl/lib/python3.7/site-packages/trompace/config.py", line 117, in jwt_token self._set_jwt_token(token) File "/home/aggelos/envs/tpl/lib/python3.7/site-packages/trompace/config.py", line 100, in _set_jwt_token except jwt.DecodeError: AttributeError: module 'jwt' has no attribute 'DecodeError'

alastair commented 4 years ago

by any chance did you run pip install jwt, or use pycharm to install the 'jwt' package? It seems like you may have an incorrect jwt library installed - we use one called pyjwt. I recommend that you delete your current virtual environment, or project interpreter in pycharm and recreate it, installing the dependencies again from requirements.txt