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

Rewatched episode: Conflict - resource already created #1972

Closed
2 of 3 tasks
dimikal37 opened this issue Jun 1, 2024 · 3 comments
Closed
2 of 3 tasks

Rewatched episode: Conflict - resource already created #1972

dimikal37 opened this issue Jun 1, 2024 · 3 comments

Comments

@dimikal37
Copy link

dimikal37 commented Jun 1, 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

Hello,

I am using PlexTrakSync in a docker container and only in watch (Scrobbler)
When I rewatch an episode I get the following error: Conflict - resource already created

Please see below my config.yaml

watch:
  add_collection: false
  remove_collection: false
  # what video watched percentage (0 to 100) triggers the watched status
  scrobble_threshold: 90
  # true to scrobble only what's watched by you, false for all your PMS users
  username_filter: true
  # Show the progress bar of played media in terminal
  media_progressbar: true
  # Clients to ignore when listening Play events
  ignore_clients: ~

and my container .yaml

services:
  plextraktsync:
    container_name: plextraktsync
    image: ghcr.io/taxel/plextraktsync:latest
    volumes:
      - ./config:/app/config
    environment: 
      - PUID=${PLEXTRAKTSYNC_UID}
      - PGID=${PLEXTRAKTSYNC_GID}
      - TZ=${TIME_ZONE}
    command: watch
    restart: unless-stopped
    networks:
      default:
        ipv4_address: "0.0.0.0"

Steps to reproduce the behavior

  1. Start PlexTrakSync only using watch command
  2. Watch an episode/movie for the first time. -> Trakt is updated successfully
  3. Rewatch the same episode/movie. -> Trakt is not updated

Error trace / logs

2024-06-01 22:05:15,452 DEBUG[trakt.core]:get: https://api.trakt.tv/search/tmdb/2975040?type=episode
2024-06-01 22:05:15,453 DEBUG[trakt.core]:method, url :: get, https://api.trakt.tv/search/tmdb/2975040?type=episode
2024-06-01 22:05:15,457 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-06-01 22:05:15,463 DEBUG[requests_cache.policy.expiration]:URL https://api.trakt.tv/search/tmdb/2975040?type=episode matched pattern "api.trakt.tv/search/tmdb/*?type=episode": 1 day, 0:00:00
2024-06-01 22:05:15,463 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: Passed
2024-06-01 22:05:15,472 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=datetime.timedelta(days=1))
2024-06-01 22:05:15,473 DEBUG[trakt.core]:RESPONSE [get] (https://api.trakt.tv/search/tmdb/2975040?type=episode): <CachedResponse [200]: created: 2024-06-01 21:58:44 CEST, expires: 2024-06-02 05:58:44 CEST (fresh), size: 314 bytes, request: GET https://api.trakt.tv/search/tmdb/2975040?type=episode>
2024-06-01 22:05:15,474 DEBUG[plextraktsync.media.MediaFactory]:Resolved <PlexGuid:tmdb://2975040> of <tmdb:2975040:Episode:1044:Shōgun-s01e01> to <tmdb:2975040:Episode:1044:Shōgun-s01e01>
2024-06-01 22:05:15,475 DEBUG[trakt.core]:get: https://api.trakt.tv/search/tmdb/126308?type=show
2024-06-01 22:05:15,475 DEBUG[trakt.core]:method, url :: get, https://api.trakt.tv/search/tmdb/126308?type=show
2024-06-01 22:05:15,484 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-06-01 22:05:15,485 DEBUG[requests_cache.policy.expiration]:URL https://api.trakt.tv/search/tmdb/126308?type=show matched pattern "api.trakt.tv/search/tmdb/*?type=show": 1 day, 0:00:00
2024-06-01 22:05:15,486 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: Passed
2024-06-01 22:05:15,490 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=datetime.timedelta(days=1))
2024-06-01 22:05:15,491 DEBUG[trakt.core]:RESPONSE [get] (https://api.trakt.tv/search/tmdb/126308?type=show): <CachedResponse [200]: created: 2024-06-01 21:27:44 CEST, expires: 2024-06-02 05:27:44 CEST (fresh), size: 174 bytes, request: GET https://api.trakt.tv/search/tmdb/126308?type=show>
2024-06-01 22:05:15,492 DEBUG[plextraktsync.media.MediaFactory]:Resolved <PlexGuid:tmdb://126308> of <tmdb:126308:Show:1042:Shōgun> to <tmdb:126308:Show:1042:Shōgun>
2024-06-01 22:05:15,493 INFO[plextraktsync.watch.WatchStateUpdater]:on_play: <Episode:1044:Shōgun-s01e01>: 95.345927%, State: stopped, Played: True, LastViewed: 2024-05-26 20:20:27
2024-06-01 22:05:15,502 DEBUG[plextraktsync.trakt.ScrobblerProxy]:stop(<TVEpisode>: Shōgun S1E1 Anjin): 95.34592694118348
2024-06-01 22:05:15,502 DEBUG[plextraktsync.watch.WatchStateUpdater]:Scrobbled: None
2024-06-01 22:05:16,503 DEBUG[trakt.core]:post: https://api.trakt.tv/scrobble/stop
2024-06-01 22:05:16,504 DEBUG[trakt.core]:method, url :: post, https://api.trakt.tv/scrobble/stop
2024-06-01 22:05:16,508 DEBUG[requests_cache.policy.actions]:Cache directives from request headers: CacheDirectives()
2024-06-01 22:05:16,509 DEBUG[requests_cache.policy.actions]:Pre-read cache checks: disabled method
2024-06-01 22:05:16,510 DEBUG[requests_cache.policy.actions]:Post-read cache actions: CacheActions(expire_after=-1, send_request=True, skip_read=True)
2024-06-01 22:05:16,662 DEBUG[urllib3.connectionpool]:https://api.trakt.tv:443 "POST /scrobble/stop HTTP/1.1" 409 None
2024-06-01 22:05:16,666 DEBUG[requests_cache.policy.actions]:Cache directives from response headers: CacheDirectives(no_cache=True)
2024-06-01 22:05:16,666 DEBUG[requests_cache.policy.actions]:Pre-write cache checks: disabled method, disabled status
2024-06-01 22:05:16,667 DEBUG[requests_cache.session]:Skipping cache write for URL: https://api.trakt.tv/scrobble/stop
2024-06-01 22:05:16,667 DEBUG[trakt.core]:RESPONSE [post] (https://api.trakt.tv/scrobble/stop): <Response [409]>
2024-06-01 22:05:16,667 ERROR[plextraktsync.queue.TraktScrobbleWorker]:Conflict - resource already created
2024-06-01 22:05:16,672 DEBUG[plextraktsync.queue.TraktScrobbleWorker]:{'Date': 'Sat, 01 Jun 2024 20:05:16 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '0', 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'referrer-policy': 'strict-origin-when-cross-origin', 'vary': 'Accept-Encoding', 'Content-Encoding': 'gzip', 'x-ratelimit': '{"name":"AUTHED_API_POST_LIMIT","period":1,"limit":1,"remaining":0,"until":"2024-06-01T20:05:17Z"}', 'Cache-Control': 'no-cache', path=/; HttpOnly; SameSite=Lax', 'x-request-id': '', 'x-runtime': '0.023919', 'CF-Cache-Status': 'DYNAMIC', 'Server': 'cloudflare', 'CF-RAY': '', 'alt-svc': 'h3=":443"; ma=86400'}
2024-06-01 22:05:16,672 DEBUG[plextraktsync.queue.TraktScrobbleWorker]:<Response [409]>
2024-06-01 22:05:16,673 DEBUG[plextraktsync.queue.TraktScrobbleWorker]:Submitted stop: [None]

Expected behavior

From what I read, scrobbler should mark as watched when you are re-watching something.
I found this pr that maybe is relevant ? #1882

Inspect of problematic items

No response

Workarounds

No response

Config file contents

No response

Install method

docker-compose

Version

0.30.10

Python Version

3.12.3

Plex Server Version

1.40.3.8502

Operating System and Version

Debian 12 (Open Media Vault 7.1.1-1)

@glensc
Copy link
Collaborator

glensc commented Jun 7, 2024

Is there an actual problem? the conflict error can be ignored as it will scribble with next tick. the conflict can happen if you run watch command multiple times for same trakt.tv account.

@dimikal37
Copy link
Author

You are right. I just tried again and rewatches are added fine.

I had only one instance of watch running. Maybe while I was testing the rewatches were close to each other? I was fast forwarding the same episode to check if it will be registered.

@glensc
Copy link
Collaborator

glensc commented Jun 8, 2024

doesn't matter how fast you watch. plextraktsync watch still sends updates every 1s

@glensc glensc closed this as completed Jun 8, 2024
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

2 participants