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

No JSON object could be decoded #15

Open
vixfix opened this issue Oct 9, 2018 · 3 comments
Open

No JSON object could be decoded #15

vixfix opened this issue Oct 9, 2018 · 3 comments

Comments

@vixfix
Copy link

vixfix commented Oct 9, 2018

getting a return of No JSON object could be decoded
i know im missing something simple

@Twiggy-GH
Copy link

I'm also getting this issue after using the script without issue for over a year.

@Twiggy-GH
Copy link

Is this script abandoned? I'm once again getting this error and having difficulty troubleshooting it.

@bobarune
Copy link

bobarune commented Feb 20, 2021

@Twiggy-GH Is there any stack trace with that error? Or line number?

Based on the "No JSON object could be decoded", I suspect it could be one of the calls to the Tautulli API is returning invalid JSON. Maybe it's partially valid and the default parser of the requests module is possibly more strict. Another possibility is the tautulli API is erroring in some way eg. returning a 500 and the returned text isn't json.

Could you try running the following calls and running a JSON validator on each return results? No need to post the JSON return results here as it's full of information you would want to remove. I'm making an assumption that you might be using http. Default port should be 8181. You can just throw these in your browser since it is a GET request.

http://<tautulli ip or hostname>:<tautulli port>/api/v2?apikey=<tautulli API Key>&cmd=get_users
http://<tautulli ip or hostname>:<tautulli port>/api/v2?apikey=<tautulli API Key>&cmd=get_activity
http://<tautulli ip or hostname>:<tautulli port>/api/v2?apikey=<tautulli API Key>&cmd=get_libraries

Edit: As an example, one of mine would be http://monitor-pi:8181/api/v2?apikey=SuperSecretApiKey&cmd=get_users . In this case, my hostname is monitor-pi and my port is 8181 and my API key is SuperSecretApiKey (Not actually)

Another thing you could try is to fully test the JSON decoding calls with your setup using the following python script:

#!/usr/bin/python

import os
import time
import requests

def main():
    data1 = requests.get('http://<tautulli ip or hostname>:<tautulli port>/api/v2?apikey=<tautulli API Key>&cmd=get_users', verify=False).json()
    data2 = requests.get('http://<tautulli ip or hostname>:<tautulli port>/api/v2?apikey=<tautulli API Key>&cmd=get_activity', verify=False).json()
    data3 = requests.get('http://<tautulli ip or hostname>:<tautulli port>/api/v2?apikey=<tautulli API Key>&cmd=get_libraries', verify=False).json()
    print(data1)
    print(data2)
    print(data3)

if __name__ == '__main__':
    main()

You will have to pip install 'requests' since it is a third party module.

And to get you Tautulli API Key, go to Settings -> Web Interface and scroll to the bottom. However you are running this exporter, make sure you have the right Tautulli API Key.

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

3 participants