Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)
MIT License
1.62k stars 106 forks source link

Plex and Trakt settings won't save #1996

Closed BelgianMonster closed 5 months ago

BelgianMonster commented 5 months ago

Confirmation

The problem

I checked all permissions, write permissions are okay but everytime I connected to Plex and Trakt and the console says settings are saved I go check the file and it is still on default so it doesnt write to file. I deleted the container, made new folders, ... don't know what I am doing wrong because other docker containers with the same permissions don't have issues.

I'm on Synology with docker

Steps to reproduce the behavior

after creation of the container running with login, going through all the steps of authentication, get confirmation that everything went well and it is saved to servers and env file, but it isnt

Error trace / logs

2024-06-18 21:35:43,754 INFO[plextraktsync.commands.sync]:PlexTraktSync [0.31.1]
2024-06-18 21:35:43,760 WARNING[plextraktsync]:Added default server to /app/config/servers.yml
2024-06-18 21:35:56,511 INFO[plextraktsync.commands.sync]:PlexTraktSync [0.31.1]
2024-06-18 21:36:09,550 INFO[plextraktsync.commands.sync]:PlexTraktSync [0.31.1]
2024-06-18 21:41:05,806 INFO[plextraktsync.commands.sync]:PlexTraktSync [0.31.1]
2024-06-18 21:41:20,286 INFO[plextraktsync.commands.sync]:PlexTraktSync [0.31.1]
2024-06-18 21:41:34,739 INFO[plextraktsync.commands.sync]:PlexTraktSync [0.31.1]

Expected behavior

Plex and Trakt settings saved to file

Inspect of problematic items

PlexTraktSync [0.31.1]
ERROR    Unable to create PlexId: ID
         ╭───────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────╮
         │ /app/plextraktsync/cli.py:26 in wrap                                                                        │
         │                                                                                                             │
         │    23 │   │   │   cmd = getattr(module, name)                                                               │
         │    24 │   │   │                                                                                             │
         │    25 │   │   │   try:                                                                                      │
         │ ❱  26 │   │   │   │   cmd(*args, **kwargs)                                                                  │
         │    27 │   │   │   except EOFError as e:                                                                     │
         │    28 │   │   │   │   raise ClickException(                                                                 │
         │    29 │   │   │   │   │   f"Program requested terminal, No terminal is connected: {e}"                      │
         │                                                                                                             │
         │ /app/plextraktsync/commands/inspect.py:118 in inspect                                                       │
         │                                                                                                             │
         │   115 │   print = factory.print                                                                             │
         │   116 │   print(f"PlexTraktSync [{factory.version.full_version}]")                                          │
         │   117 │                                                                                                     │
         │ ❱ 118 │   for plex_id in expand_plexid(inputs):                                                             │
         │   119 │   │   inspect_media(plex_id)                                                                        │
         │   120                                                                                                       │
         │                                                                                                             │
         │ /app/plextraktsync/util/expand_id.py:6 in expand_plexid                                                     │
         │                                                                                                             │
         │   3                                                                                                         │
         │   4 def expand_plexid(input):                                                                               │
         │   5 │   for id in input:                                                                                    │
         │ ❱ 6 │   │   yield PlexIdFactory.create(id)                                                                  │
         │   7                                                                                                         │
         │                                                                                                             │
         │ /app/plextraktsync/plex/PlexIdFactory.py:20 in create                                                       │
         │                                                                                                             │
         │   17 │   │   elif key.startswith("plex://"):                                                                │
         │   18 │   │   │   return cls.from_plex_guid(key)                                                             │
         │   19 │   │                                                                                                  │
         │ ❱ 20 │   │   raise RuntimeError(f"Unable to create PlexId: {key}")                                          │
         │   21 │                                                                                                      │
         │   22 │   @classmethod                                                                                       │
         │   23 │   def from_plex_guid(cls, id):                                                                       │
         ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
         RuntimeError: Unable to create PlexId: ID
Error: Error running inspect command: Unable to create PlexId: ID

Workarounds

No response

Config file contents

No response

Install method

docker-compose

Version

0.31.1

Python Version

3.12.4

Plex Server Version

4.132.2

Operating System and Version

DSM 7.2.1-69057 Update 5

glensc commented 5 months ago
  1. Config save path /app/config needs to be in volume to persist. This has nothing to do with permissions.
  2. ERROR Unable to create PlexId: ID read project README what is expected in place of ID
BelgianMonster commented 4 months ago

It is in volume, but as soon as I run the login it says successfull but it's not fillig it in in the files in the folder. I read the instructions and followed them, the it just won't save the login info

glensc commented 4 months ago

No idea what are you doing, but the logs you shared indicate the volume is not present.

BelgianMonster commented 4 months ago

Then I would like some suggestions to solve this because I have the volume 100% linked. It's showing in the yaml config and in docker app in Synology and in Portainer. The files get created in the volume, but don't get edited with the server info even tho the terminal says so "Plex Media Server Authentication Token and base URL have been added to servers.yml".

The fact that the files get created in the volume proves it's linked.

volumes:
  - /volume3/data/docker/plextraktsync:/app/config
glensc commented 4 months ago

Not really place to ask Synology or Portainer help (I don't have neither of them, also both listed as Unsupported in readme).

But some generic instructions would be:

  1. do docker inspect CONTAINER_ID, see the Volumes info, and try listing contents. the container need to be running.
  2. enter the container docker exec -it CONTAINER_ID sh, list /app/config contents
  3. what is in /volume3/data/docker/plextraktsync? is it seen in container under /app/config?

show some proofs of what you see (copy and paste commands you ran and their outcome)

alternatively you could start the container with some "sleep forever" command, and run commands inside container. they will perist until container is alive, maybe that's fine if you don't re-create container, i.e via upgrade.