RemiRigal / Plex-Auto-Languages

Automated language selection for Plex TV Shows !
MIT License
490 stars 18 forks source link

Issue on Container Startup #62

Closed CardcaptorRLH85 closed 1 year ago

CardcaptorRLH85 commented 2 years ago

I'm having an issue when starting the container even though I wasn't in the past. I've changed no configurations in PAL inbetween.

2022-12-01 03:10:15,855 [INFO] Parsing config file '/config/config.yaml'
2022-12-01 03:10:15,878 [INFO] The provided configuration has been successfully validated
2022-12-01 03:10:15,880 [INFO] Starting scheduler
2022-12-01 03:10:16,534 [INFO] Successfully connected as user 'CardcaptorRLH85' (id: 1)
Traceback (most recent call last):
  File "main.py", line 118, in <module>
    plex_auto_languages.start()
  File "main.py", line 68, in start
    self.init()
  File "main.py", line 45, in init
    self.plex = PlexServer(self.config.get("plex.url"), self.config.get("plex.token"), self.notifier, self.config)
  File "/app/plex_auto_languages/plex_server.py", line 110, in __init__
    self.cache = PlexServerCache(self)
  File "/app/plex_auto_languages/plex_server_cache.py", line 41, in __init__
    if not self._load():
  File "/app/plex_auto_languages/plex_server_cache.py", line 114, in _load
    cache = json.load(stream)
  File "/usr/local/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/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)
RemiRigal commented 2 years ago

Have you tried launching the container multiple times ? Does this happen every time now ?

CardcaptorRLH85 commented 1 year ago

Have you tried launching the container multiple times ? Does this happen every time now ?

I'm sorry for the gap in my reply, I was away for a bit. Yes, I get this same error on every container restart now.

JohnFawkes commented 1 year ago

same here

JohnFawkes commented 1 year ago

So I got it working again by going to my mapped volume and deleting the cache folder and restarting. For some reason it was an empty file inside. After deleting and then restarting, it scanned files again and started working

CardcaptorRLH85 commented 1 year ago

So I got it working again by going to my mapped volume and deleting the cache folder and restarting. For some reason it was an empty file inside. After deleting and then restarting, it scanned files again and started working

This fixed it for me too. No idea what corrupted the cache though.

RemiRigal commented 1 year ago

Thank you for the precious feedback @JohnFawkes, I'm glad that you were able to solve this ! I will update the code to deal with corrupted cache files.