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

Error running sync command: Not Found - method exists, but no record found #2101

Open
3 tasks done
NGDM opened this issue Nov 24, 2024 · 4 comments
Open
3 tasks done

Comments

@NGDM
Copy link
Contributor

NGDM commented Nov 24, 2024

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

Script fails when running 'sync' command.
Not sure what changed, I tried downgrading without luck.
Maybe some TraktUserList which makes the script fail?

Steps to reproduce the behavior

  1. Run new docker compose container with latest tag and empty directories
  2. Follow setup with my own credentials
  3. Script fails during sync and keeps retrying

Error trace / logs

/app # plextraktsync sync
INFO     PlexTraktSync [0.32.2]                                                                                         
INFO     Connecting with url: https://192-168-1-11.b15141e6b6674ee1a82ce05d0b25bde3.plex.direct:32400, timeout 30       
         seconds                                                                                                        
INFO     Sync Movie sections: ['4K Movies', 'Anime Movies', 'Movies']                                                   
INFO     Sync Show sections: ['Anime TV Shows', 'TV Shows']                                                             
INFO     Enable sync plugin 'AddCollectionPlugin': True                                                                 
INFO     Enable sync plugin 'ClearCollectedPlugin': True                                                                
INFO     Enable sync plugin 'LikedListsPlugin': True                                                                    
INFO     Enable sync plugin 'SyncRatingsPlugin': True                                                                   
INFO     Enable sync plugin 'SyncWatchedPlugin': True                                                                   
INFO     Enable sync plugin 'TraktListsPlugin': True                                                                    
INFO     Enable sync plugin 'WatchListPlugin': True                                                                     
INFO     Enable sync plugin 'WatchProgressPlugin': False                                                                
INFO     Downloaded Trakt list 'Highly rated movies (post-2010)' (237 items): https://trakt.tv/lists/25373705           
Processing 4K Movies   6% ━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/16  [ 0:00:00 < -:--:-- , ? it/s ]
ERROR    Not Found - method exists, but no record found                                                                 
         ╭───────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────╮
         │ /app/plextraktsync/cli.py:28 in wrap                                                                        │
         │                                                                                                             │
         │    25 │   │   │   cmd = getattr(module, name)                                                               │
         │    26 │   │   │                                                                                             │
         │    27 │   │   │   try:                                                                                      │
         │ ❱  28 │   │   │   │   cmd(*args, **kwargs)                                                                  │
         │    29 │   │   │   except EOFError as e:                                                                     │
         │    30 │   │   │   │   raise ClickException(f"Program requested terminal, No terminal is                     │
         │       connected: {e}")                                                                                      │
         │    31 │   │   │   except ClickException as e:                                                               │
         │                                                                                                             │
         │ /app/plextraktsync/commands/sync.py:74 in sync                                                              │
         │                                                                                                             │
         │   71 │   │   │   w.print_plan(print=logger.info)                                                            │
         │   72 │   │   if dry_run:                                                                                    │
         │   73 │   │   │   logger.info("Enabled dry-run mode: not making actual changes")                             │
         │ ❱ 74 │   │   run_async(runner, walker=w, dry_run=config.dry_run)                                            │
         │   75                                                                                                        │
         │                                                                                                             │
         │ /usr/local/lib/python3.13/site-packages/decorator.py:232 in fun                                             │
         │                                                                                                             │
         │   229 │   │   def fun(*args, **kw):                                                                         │
         │   230 │   │   │   if not kwsyntax:                                                                          │
         │   231 │   │   │   │   args, kw = fix(args, kw, sig)                                                         │
         │ ❱ 232 │   │   │   return caller(func, *(extras + args), **kw)                                               │
         │   233 │   fun.__name__ = func.__name__                                                                      │
         │   234 │   fun.__doc__ = func.__doc__                                                                        │
         │   235 │   fun.__wrapped__ = func                                                                            │
         │                                                                                                             │
         │ /app/plextraktsync/decorators/coro.py:15 in coro                                                            │
         │                                                                                                             │
         │   12 │                                                                                                      │
         │   13 │   https://github.com/pallets/click/issues/85#issuecomment-503464628                                  │
         │   14 │   """                                                                                                │
         │ ❱ 15 │   return asyncio.run(f(*args, **kwargs))                                                             │
         │   16                                                                                                        │
         │                                                                                                             │
         │ /usr/local/lib/python3.13/asyncio/runners.py:194 in run                                                     │
         │                                                                                                             │
         │   191 │   │   │   "asyncio.run() cannot be called from a running event loop")                               │
         │   192 │                                                                                                     │
         │   193 │   with Runner(debug=debug, loop_factory=loop_factory) as runner:                                    │
         │ ❱ 194 │   │   return runner.run(main)                                                                       │
         │   195                                                                                                       │
         │   196                                                                                                       │
         │   197 def _cancel_all_tasks(loop):                                                                          │
         │                                                                                                             │
         │ /usr/local/lib/python3.13/asyncio/runners.py:118 in run                                                     │
         │                                                                                                             │
         │   115 │   │                                                                                                 │
         │   116 │   │   self._interrupt_count = 0                                                                     │
         │   117 │   │   try:                                                                                          │
         │ ❱ 118 │   │   │   return self._loop.run_until_complete(task)                                                │
         │   119 │   │   except exceptions.CancelledError:                                                             │
         │   120 │   │   │   if self._interrupt_count > 0:                                                             │
         │   121 │   │   │   │   uncancel = getattr(task, "uncancel", None)                                            │
         │                                                                                                             │
         │ /usr/local/lib/python3.13/asyncio/base_events.py:721 in run_until_complete                                  │
         │                                                                                                             │
         │    718 │   │   if not future.done():                                                                        │
         │    719 │   │   │   raise RuntimeError('Event loop stopped before Future completed.')                        │
         │    720 │   │                                                                                                │
         │ ❱  721 │   │   return future.result()                                                                       │
         │    722 │                                                                                                    │
         │    723 │   def stop(self):                                                                                  │
         │    724 │   │   """Stop running the event loop.                                                              │
         │                                                                                                             │
         │ /app/plextraktsync/commands/sync.py:13 in run_async                                                         │
         │                                                                                                             │
         │   10                                                                                                        │
         │   11 @coro                                                                                                  │
         │   12 async def run_async(runner, **kwargs):                                                                 │
         │ ❱ 13 │   await runner.sync(**kwargs)                                                                        │
         │   14                                                                                                        │
         │   15                                                                                                        │
         │   16 def sync(                                                                                              │
         │                                                                                                             │
         │ /app/plextraktsync/sync/Sync.py:50 in sync                                                                  │
         │                                                                                                             │
         │   47 │   │                                                                                                  │
         │   48 │   │   if self.config.need_library_walk:                                                              │
         │   49 │   │   │   async for movie in walker.find_movies():                                                   │
         │ ❱ 50 │   │   │   │   await pm.ahook.walk_movie(movie=movie, dry_run=dry_run)                                │
         │   51 │   │   │                                                                                              │
         │   52 │   │   │   async for episode in walker.find_episodes():                                               │
         │   53 │   │   │   │   await pm.ahook.walk_episode(episode=episode, dry_run=dry_run)                          │
         │                                                                                                             │
         │ /usr/local/lib/python3.13/site-packages/apluggy/wrap/ext.py:19 in call                                      │
         │                                                                                                             │
         │   16 │   │   async def call(*args: Any, **kwargs: Any) -> list:                                             │
         │   17 │   │   │   hook: HookCaller = getattr(self.pm.hook, name)                                             │
         │   18 │   │   │   coros: list[asyncio.Future] = hook(*args, **kwargs)                                        │
         │ ❱ 19 │   │   │   return await asyncio.gather(*coros)                                                        │
         │   20 │   │                                                                                                  │
         │   21 │   │   return call                                                                                    │
         │   22                                                                                                        │
         │                                                                                                             │
         │ /app/plextraktsync/sync/TraktListsPlugin.py:65 in walk_movie                                                │
         │                                                                                                             │
         │   62 │                                                                                                      │
         │   63 │   @hookimpl                                                                                          │
         │   64 │   async def walk_movie(self, movie: Media):                                                          │
         │ ❱ 65 │   │   self.trakt_lists.add_to_lists(movie)                                                           │
         │   66 │                                                                                                      │
         │   67 │   @hookimpl                                                                                          │
         │   68 │   async def walk_episode(self, episode: Media):                                                      │
         │                                                                                                             │
         │ /app/plextraktsync/trakt/TraktUserListCollection.py:32 in add_to_lists                                      │
         │                                                                                                             │
         │   29 │   │   if m.plex.edition_title is not None:                                                           │
         │   30 │   │   │   return                                                                                     │
         │   31 │   │   for tl in self:                                                                                │
         │ ❱ 32 │   │   │   tl.add(m)                                                                                  │
         │   33 │                                                                                                      │
         │   34 │   def load_lists(self, liked_lists: list[TraktLikedList]):                                           │
         │   35 │   │   for liked_list in liked_lists:                                                                 │
         │                                                                                                             │
         │ /app/plextraktsync/trakt/TraktUserList.py:100 in add                                                        │
         │                                                                                                             │
         │    97 │   │   return self.plex_lists[self.name]                                                             │
         │    98 │                                                                                                     │
         │    99 │   def add(self, m: Media):                                                                          │
         │ ❱ 100 │   │   rank = self.items.get((m.media_type, m.trakt_id))                                             │
         │   101 │   │   if rank is None:                                                                              │
         │   102 │   │   │   # Item is not in this trakt list                                                          │
         │   103 │   │   │   return                                                                                    │
         │                                                                                                             │
         │ /app/plextraktsync/trakt/TraktUserList.py:49 in items                                                       │
         │                                                                                                             │
         │    46 │   @property                                                                                         │
         │    47 │   def items(self):                                                                                  │
         │    48 │   │   if self._items is None:                                                                       │
         │ ❱  49 │   │   │   self.description, self._items = self.load_items()                                         │
         │    50 │   │   return self._items                                                                            │
         │    51 │                                                                                                     │
         │    52 │   @staticmethod                                                                                     │
         │                                                                                                             │
         │ /app/plextraktsync/trakt/TraktUserList.py:74 in load_items                                                  │
         │                                                                                                             │
         │    71 │   │   return items                                                                                  │
         │    72 │                                                                                                     │
         │    73 │   def load_items(self):                                                                             │
         │ ❱  74 │   │   pl = PublicList.load(self.trakt_id)                                                           │
         │    75 │   │   self.logger.info(f"Downloaded Trakt list '{pl.name}' ({len(pl)} items):                       │
         │       {pl.share_link}")                                                                                     │
         │    76 │   │                                                                                                 │
         │    77 │   │   return pl.description, self.build_dict(pl)                                                    │
         │                                                                                                             │
         │ /usr/local/lib/python3.13/site-packages/trakt/core.py:579 in inner                                          │
         │                                                                                                             │
         │   576 │   │   │   │   # Handle cached property responses                                                    │
         │   577 │   │   │   │   return resp                                                                           │
         │   578 │   │   │   url, generator, _ = resp                                                                  │
         │ ❱ 579 │   │   │   json_data = self._handle_request('get', url)                                              │
         │   580 │   │   │   try:                                                                                      │
         │   581 │   │   │   │   return generator.send(json_data)                                                      │
         │   582 │   │   │   except StopIteration:                                                                     │
         │                                                                                                             │
         │ /usr/local/lib/python3.13/site-packages/trakt/core.py:551 in _handle_request                                │
         │                                                                                                             │
         │   548 │   │   │   │   │   │   │   │   │      data=json.dumps(data))                                         │
         │   549 │   │   self.logger.debug('RESPONSE [%s] (%s): %s', method, url, str(response))                       │
         │   550 │   │   if response.status_code in self.error_map:                                                    │
         │ ❱ 551 │   │   │   raise self.error_map[response.status_code](response)                                      │
         │   552 │   │   elif response.status_code == 204:  # HTTP no content                                          │
         │   553 │   │   │   return None                                                                               │
         │   554                                                                                                       │
         ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
         NotFoundException: Not Found - method exists, but no record found                                              
Error: Error running sync command: Not Found - method exists, but no record found
/app #

Expected behavior

Sync executes entirely and syncs my libraries/collection

Inspect of problematic items

No response

Workarounds

No response

Config file contents

cache:
  path: /app/config/trakt_cache
excluded-libraries:
- Family
config:
  dotenv_override: true
plex:
  timeout: 30
logging:
  append: true
  console_time: false
  debug: false
  filename: plextraktsync.log
  filter_loggers: null
  filter: null
sync:
  rating_priority: plex
  plex_to_trakt:
    collection: true
    clear_collected: true
    ratings: true
    watched_status: true
    watchlist: true
  trakt_to_plex:
    liked_lists: true
    ratings: true
    watched_status: true
    watchlist: false
    watchlist_as_playlist: false
    playback_status: false
liked_lists:
  keep_watched: true
watch:
  add_collection: true
  remove_collection: true
  scrobble_threshold: 80
  username_filter: true
  media_progressbar: true
  ignore_clients: null
xbmc-providers:
  movies: imdb
  shows: tvdb

Install method

docker-compose

Version

0.32.2

Python Version

3.13.0

Plex Server Version

1.41.2.9200

Operating System and Version

Linux-6.8.0-49-generic-x86_64-with

@rgzr
Copy link

rgzr commented Dec 2, 2024

Same here with a fresh install and minimum sync config (just trakt_to_plex.liked_lists = true, the rest to false).

@glensc
Copy link
Collaborator

glensc commented Dec 3, 2024

  1. did you try to unsubscribe from the faulty list? if so, then post results!
  2. did you try disable liked_lists? if so, then post results!
  3. did you try downgrade? if so, then post results!
  4. enable debug log and find what was the last request to trakt, post details

@NGDM
Copy link
Contributor Author

NGDM commented Dec 5, 2024

  1. did you try to unsubscribe from the faulty list? if so, then post results!

Yes, didn't help.

  1. did you try disable liked_lists? if so, then post results!

This did fix it and confirmed me that issue was in a list.

  1. did you try downgrade? if so, then post results!

Yes, no fix on any version in the last 6 months.

  1. enable debug log and find what was the last request to trakt, post details

This showed me that the calls to the lists endpoint https://trakt.tv/lists/*id* always returned HTTP 404.
Eventually I discovered this was due to the "Private" setting on my Trakt profile being checked.

So, even though we're logged in with our own credentials, the Trakt API doesn't allow you to view public lists of a private account.

@glensc
Copy link
Collaborator

glensc commented Dec 11, 2024

It uses public api, for private lists need to use different endpoint.

basically it's this feature request then:

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

3 participants