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

Traktarr crashes on oauth #128

Open
ghost opened this issue Apr 26, 2020 · 4 comments
Open

Traktarr crashes on oauth #128

ghost opened this issue Apr 26, 2020 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 26, 2020

Describe the bug
Fresh install of Traktarr crashes when trying to run due to oauth error but I can't run "[sudo] traktarr trakt_authentication"

Expected behavior
create an activation key and link to trakt.com/activate
Logs
Link to debug or trace log files.
2020-04-26 03:26:07,988 - INFO - media.trakt - __oauth_request_device_code - We're talking to Trakt to get your verification code. Please wait a moment...
2020-04-26 03:26:08,308 - ERROR - media.trakt - oauth_authentication - Exception occurred when authenticating user
Traceback (most recent call last):
File "/opt/traktarr/media/trakt.py", line 359, in oauth_authentication
device_code_response = self.__oauth_request_device_code()
File "/opt/traktarr/media/trakt.py", line 270, in __oauth_request_device_code
device_code_response = req.json()
File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

System Information

  • Traktarr Version: [e.g. Master (latest)]
  • Operating System: [e.g. Ubuntu Server 18.04 minimum]
@ghost ghost added the Bug label Apr 26, 2020
@WildBrian
Copy link

I'm having the same problem on latest unraid version.

@WildBrian
Copy link

/traktarr # ./traktarr.py trakt_authentication

2020-04-27 21:04:46,457 - INFO - media.trakt - __oauth_request_device_code - We're talking to Trakt to get your verification code. Please wait a moment...
{'Content-Type': 'application/json', 'trakt-api-version': '2', 'trakt-api-key': ''}
2020-04-27 21:04:46,990 - ERROR - media.trakt - oauth_authentication - Exception occurred when authenticating user
Traceback (most recent call last):
File "/traktarr/media/trakt.py", line 359, in oauth_authentication
device_code_response = self.__oauth_request_device_code()
File "/traktarr/media/trakt.py", line 270, in __oauth_request_device_code
device_code_response = req.json()
File "/usr/lib/python3.8/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@retracronnoc
Copy link

Unraid 6.8.3 and having same issue

2020-05-18 09:58:27,918 - INFO - media.trakt - __oauth_request_device_code - We're talking to Trakt to get your verification code. Please wait a moment...
{'Content-Type': 'application/json', 'trakt-api-version': '2', 'trakt-api-key': ''}
2020-05-18 09:58:28,108 - ERROR - media.trakt - oauth_authentication - Exception occurred when authenticating user
Traceback (most recent call last):
File "/traktarr/media/trakt.py", line 359, in oauth_authentication
device_code_response = self.__oauth_request_device_code()
File "/traktarr/media/trakt.py", line 270, in __oauth_request_device_code
device_code_response = req.json()
File "/usr/lib/python3.8/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@nickyhuyskens
Copy link

I had exactly the same error, also unraid.
So I decided to print out the request that the stacktrace is telling us that it can't decode and I saw that the response from trakt gave a http status code 403 back.
So I went back to the readme file and saw that in the previous step, we had to create an app in trakt.tv and give it the clientId and clientSecret which I did not enter in my config on my new install.
So probably you guys missed that step too.
After filling in the clientId and clientSecret I was able to succesfuly run traktarr trakt_authentication

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

No branches or pull requests

3 participants