PlexTraktSync: plex 500 internal error with index=None
Confirmation
- I have read the README.md on the project homepage
- I have checked if identical issue already exists
- I have tried downgrading to find version that can be used as a workaround
The problem
i got this error in the plex console when running plextraktsync.
Got exception from request handler: sqlite3_statement_backend::prepare: no such column: None for SQL: select count(*) from (select distinct(metadata_items.id) from metadata_items join metadata_items as parents on metadata_items.parent_id=parents.id join metadata_items as children on children.parent_id=metadata_items.id where metadata_items.library_section_id in (1) and (metadata_items.`index`=None and metadata_items.metadata_type=3 and metadata_items.parent_id=66153) )
anyone seen this? and have a fix? is it the plextraktsync thats broken?
Error trace / logs
2023-11-14 22:59:45,270 ERROR[PlexTraktSync]:(500) internal_server_error; https://192-168-10-20.29069781034849ab98845e008b75f47c.plex.direct:32400/library/metadata/66153/children?excludeAllLeaves=1&index=None <html><head><title>Internal Server Error</title></head><body><h1>500 Internal Server Error</h1></body></html>
Traceback (most recent call last):
File "/app/plextraktsync/cli.py", line 26, in wrap
cmd(*args, **kwargs)
File "/app/plextraktsync/commands/sync.py", line 68, in sync
runner.sync(walker=w, dry_run=config.dry_run)
File "/app/plextraktsync/sync.py", line 79, in sync
for episode in walker.find_episodes():
File "/app/plextraktsync/walker.py", line 303, in find_episodes
yield from self.episode_from_show(show)
File "/app/plextraktsync/walker.py", line 343, in episode_from_show
me = self.mf.resolve_any(pe, show)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/plextraktsync/media.py", line 252, in resolve_any
m = self.resolve_guid(guid, show)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/plextraktsync/media.py", line 260, in resolve_guid
logger.warning(f"{guid.pm.item}: Skipping {guid} because provider {guid.provider} has no external Id")
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/video.py", line 975, in __repr__
f"{self.grandparentTitle.replace(' ', '-')[:20]}-{self.seasonEpisode}",
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/base.py", line 516, in __getattribute__
value = super(PlexPartialObject, self).__getattribute__(attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/video.py", line 1011, in seasonEpisode
return f's{str(self.seasonNumber).zfill(2)}e{str(self.episodeNumber).zfill(2)}'
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/base.py", line 516, in __getattribute__
value = super(PlexPartialObject, self).__getattribute__(attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/video.py", line 1006, in seasonNumber
return self.parentIndex if isinstance(self.parentIndex, int) else self._season.seasonNumber
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/base.py", line 516, in __getattribute__
value = super(PlexPartialObject, self).__getattribute__(attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/functools.py", line 995, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/video.py", line 966, in _season
return self.fetchItem(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/base.py", line 307, in fetchItem
return self.fetchItems(ekey, cls, **kwargs)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/base.py", line 255, in fetchItems
data = self._server.query(ekey, headers=headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/plexapi/server.py", line 770, in query
raise BadRequest(message)
plexapi.exceptions.BadRequest: (500) internal_server_error; https://192-168-10-20.29069781034849ab98845e008b75f47c.plex.direct:32400/library/metadata/66153/children?excludeAllLeaves=1&index=None <html><head><title>Internal Server Error</title></head><body><h1>500 Internal Server Error</h1></body></html>
Expected behavior
sync
Steps to reproduce the behavior
running plextraktsync
Inspect of problematic items
No response
Workarounds
No response
Install method
Unraid installation (not supported)
Config file contents
No response
Version
0.27.11
Python Version
3.12.0
Operating System and Version
unraid
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 18 (4 by maintainers)
I don’t know why your
parentIndexis missing, but I added a guard against it.pkkid/python-plexapi#1304
The episode will show up as
sNoneeNone.