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

[BUG] Cannot decode JSON on Jellyfin Users #97

Closed
1 task done
tquizzle opened this issue Sep 15, 2023 · 19 comments
Closed
1 task done

[BUG] Cannot decode JSON on Jellyfin Users #97

tquizzle opened this issue Sep 15, 2023 · 19 comments

Comments

@tquizzle
Copy link

tquizzle commented Sep 15, 2023

Cannot decode JSON
Unable to use the tool, as it fails in opening the URI to Jellyfin.

To Reproduce
Steps to reproduce the behavior:

  1. Configure .env or docker runtime vars
  2. Start container
  3. See error

Expected behavior
I expect it to sync the way it's described (and the way I've used it before)

Logs

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/app/src/main.py", line 382, in main
    main_loop()
  File "/app/src/main.py", line 298, in main_loop
    servers = generate_server_connections()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/main.py", line 146, in generate_server_connections
    Jellyfin(baseurl=baseurl, token=jellyfin_token[i].strip()),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/jellyfin.py", line 80, in __init__
    self.users = asyncio.run(self.get_users())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/app/src/jellyfin.py", line 144, in get_users
    raise Exception(e)
Exception: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('http://10.0.1.150:8096/Users')

Type:

  • Docker
@tquizzle tquizzle changed the title [BUG] Unable to [BUG] Unable to Run Sep 15, 2023
@tquizzle tquizzle changed the title [BUG] Unable to Run [BUG] Cannot decode JSON on Jellyfin Users Sep 15, 2023
@angrycuban13
Copy link

angrycuban13 commented Sep 16, 2023

I am having the same issue. Here's my docker compose

  jellyplexwatched:
    container_name: jellyplexwatched
    environment:
      - BLACKLIST_LIBRARY_TYPE=
      - BLACKLIST_LIBRARY=
      - BLACKLIST_USERS=
      - DEBUG_LEVEL=debug
      - DEBUG=True
      - DRYRUN=True
      - 'JELLYFIN_BASEURL=http://jellyfin:8096'
      - JELLYFIN_TOKEN=myAPIKey
      - LIBRARY_MAPPING=
      - LOGFILE=/tmp/log.log
      - 'PLEX_BASEURL=http://plex:32400'
      - PLEX_TOKEN=myPlexTOKEN
      - RUN_ONLY_ONCE=False
      - SLEEP_DURATION=3600
      - SSL_BYPASS=True
      - SYNC_FROM_JELLYFIN_TO_JELLYFIN=True
      - SYNC_FROM_JELLYFIN_TO_PLEX=False
      - SYNC_FROM_PLEX_TO_JELLYFIN=True
      - SYNC_FROM_PLEX_TO_PLEX=True
      - USER_MAPPING=
      - WHITELIST_LIBRARY_TYPE=
      - WHITELIST_LIBRARY=
      - WHITELIST_USERS=
    hostname: ${DOCKERHOSTNAME}
    image: luigi311/jellyplex-watched
    labels: *ref_0
    logging: *ref_1
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DOCKERWASTEDATA}/logs/jellyplexwatched:/tmp

I added the single quotes around those vars in case it was having issues escaping some characters but nothing has changed.

I also verified my API key has valid access by running http://myHost:8096/Users?api_key=myAPIKey and seeing the JSON response

I think this might be a Jellyfin issue because even Autoscan is throwing errors for me. I am on version 10.8.10 of Jellyfin if that helps

@tquizzle
Copy link
Author

I am having the same issue. Here's my docker compose

  jellyplexwatched:
    container_name: jellyplexwatched
    environment:
      - BLACKLIST_LIBRARY_TYPE=
      - BLACKLIST_LIBRARY=
      - BLACKLIST_USERS=
      - DEBUG_LEVEL=debug
      - DEBUG=True
      - DRYRUN=True
      - 'JELLYFIN_BASEURL=http://jellyfin:8096'
      - JELLYFIN_TOKEN=myAPIKey
      - LIBRARY_MAPPING=
      - LOGFILE=/tmp/log.log
      - 'PLEX_BASEURL=http://plex:32400'
      - PLEX_TOKEN=myPlexTOKEN
      - RUN_ONLY_ONCE=False
      - SLEEP_DURATION=3600
      - SSL_BYPASS=True
      - SYNC_FROM_JELLYFIN_TO_JELLYFIN=True
      - SYNC_FROM_JELLYFIN_TO_PLEX=False
      - SYNC_FROM_PLEX_TO_JELLYFIN=True
      - SYNC_FROM_PLEX_TO_PLEX=True
      - USER_MAPPING=
      - WHITELIST_LIBRARY_TYPE=
      - WHITELIST_LIBRARY=
      - WHITELIST_USERS=
    hostname: ${DOCKERHOSTNAME}
    image: luigi311/jellyplex-watched
    labels: *ref_0
    logging: *ref_1
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DOCKERWASTEDATA}/logs/jellyplexwatched:/tmp

I added the single quotes around those vars in case it was having issues escaping some characters but nothing has changed.

I also verified my API key has valid access by running http://myHost:8096/Users?api_key=myAPIKey and seeing the JSON response

I think this might be a Jellyfin issue because even Autoscan is throwing errors for me. I am on version 10.8.10 of Jellyfin if that helps

Thanks @angrycuban13
I do think it's Jellyfin as another tool tried produces similar errors while Plex's endpoint works fine.

@luigi311
Copy link
Owner

luigi311 commented Sep 17, 2023

I don’t think this is related to a jellyfin update since im also running 10.8.10 and it’s running fine on my side. I’m assuming you guys are using server api keys and not user api keys right?

mean you guys try running it via docker directly or native to see if it works that way. It will rule out any issues with the docker compose setup since i dont use docker compose for this.

@angrycuban13
Copy link

It definitely seems to be a docker-compose issue. Running it from a virtual python environment works.

@angrycuban13
Copy link

FWIW, I can curl from jellyplexwatched to jellyfin (container to container) just fine

image

@luigi311
Copy link
Owner

Im testing docker compose and it seems to be working on my side
I did it without any quotes anywhere for the baseurl and tokens and it seems to be working with the dev tag for me so it makes it hard for me to debug an issue like this.

@luigi311
Copy link
Owner

@angrycuban13 can you try doing your baseurl and token without any quotes at all and see if it works and recreate your container with the dev branch or just point to luigi311/jellyplex-watched:dev

@angrycuban13
Copy link

@luigi311 ill give it a try on the dev branch

@angrycuban13
Copy link

For some reason, on the dev tag, I get file permission errors for the log file but it seems to work fine on master. When I remove the LOGFILE environment variable, the container starts up but I get the same error

@ageisen2000
Copy link

This is also not working for me via the docker run commands or docker compose

@ageisen2000
Copy link

ageisen2000 commented Nov 23, 2023

I changed my internal subnet settings on jellyfin and added the docker subnet as internal ip addresses. Now the tool is running correctly.

Could this be the issue? Or is this just randomly working now because I saved settings in jellyfin or something?

image

@luigi311
Copy link
Owner

luigi311 commented Dec 6, 2023

Ohh thats interesting yeah thats probably it then. I disabled the remote access setting and set the lan network and i now get the exact same error

@angrycuban13
Copy link

angrycuban13 commented Dec 7, 2023

I do have remote access disabled and I didn't even think to enable it.

@luigi311
Copy link
Owner

luigi311 commented Dec 7, 2023

just locked myself out of my jellyfin instance, guess its time to figure out how to reverse what i changed lol.

@ageisen2000
Copy link

ageisen2000 commented Dec 7, 2023 via email

@luigi311
Copy link
Owner

luigi311 commented Dec 7, 2023

ayy im back in lol thanks looks like i just had to edit the network.xml

@luigi311
Copy link
Owner

luigi311 commented Dec 8, 2023

I think we can go ahead and close it since both of you seem to have resolved the issue

@luigi311 luigi311 closed this as completed Dec 8, 2023
@angrycuban13
Copy link

angrycuban13 commented Dec 8, 2023

Was there a code commit to fix it? Is the fix to enable remote access?

@ageisen2000
Copy link

I think we can go ahead and close it since both of you seem to have resolved the issue

Do you think you could update the documentation to outline the fix for this issue? Would probably save more tickets down the line

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

4 participants