RickDB / PlexAniSync

Sync Plex anime library to AniList
GNU General Public License v3.0
280 stars 44 forks source link

HTTP 500 Error when setting a new series to completed #238

Closed scratike closed 7 months ago

scratike commented 7 months ago

Hi,

What can I do with this error?

2024-02-17 20:57:51 [GRAPHQL] Response [application/json]:
{"error":{"status":500,"messages":["Bad request"]}}
Traceback (most recent call last):
  File "/plexanisync/PlexAniSync.py", line 106, in <module>
    start()
  File "/plexanisync/PlexAniSync.py", line 100, in start
    anilist.match_to_plex(anilist_series, plex_series_watched)
  File "/plexanisync/plexanisync/anilist.py", line 293, in match_to_plex
    self.__add_or_update_show_by_id(
  File "/plexanisync/plexanisync/anilist.py", line 472, in __add_or_update_show_by_id
    self.__add_by_id(
  File "/plexanisync/plexanisync/anilist.py", line 486, in __add_by_id
    self.__update_entry(
  File "/plexanisync/plexanisync/anilist.py", line 574, in __update_entry
    self.__update_episode_incremental(series, watched_episode_count, anilist_episodes_watched, "COMPLETED", plex_rating)
  File "/plexanisync/plexanisync/anilist.py", line 651, in __update_episode_incremental
    self.graphql.update_series(series.anilist_id, current_episodes_watched, new_status, plex_rating)
  File "/plexanisync/plexanisync/graphql.py", line 177, in update_series
    self.__send_graphql_request(op)
  File "/plexanisync/plexanisync/graphql.py", line 203, in __send_graphql_request
    raise data["exception"]
          ~~~~^^^^^^^^^^^^^
KeyError: 'exception'
reconman commented 7 months ago

I'll need your DEBUG log file to see what's going on.

scratike commented 7 months ago

how can I get if I use it as an unraid docker?

reconman commented 7 months ago
  1. Connect to your Unraid server with SSH
  2. Run sudo docker cp plexanisync:/plexanisync/PlexAniSync-DEBUG.log ./PlexAniSync-DEBUG.log to copy the DEBUG log from the container to the current directory of your SSH session
  3. Copy the file to your computer
scratike commented 7 months ago

Thanks! Attached here. PlexAniSync-DEBUG.log

reconman commented 7 months ago

Might be related to updating a series to Completed from 0.

I see in the logs that 12 updates were sent for The Great Cleric, each with status Completed and with the episode count increasing by 1. So first Completed + 1/12, then Completed + 2/12, and so on.

The last update of Completed + 12/12 failed.

For now check if your Anilist entry for The Great Cleric is set to completed and has 12 episodes watched.

I'll test this case at some point because I think the progressive episode progress updates don't work correctly for completed series.

scratike commented 7 months ago

Yes it is set to completed with 12 episodes.

reconman commented 7 months ago

Then your next run will probably either complete successfully or get another error. The latter will probably be the case if you're importing a lot of watched Plex shows into Anilist.

It should sort itself out after a few runs. Restart the container on every error until it completes successfully.

scratike commented 7 months ago

Super! Thanks for looking into my issue :)