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

[Import] Jellyfin : Strange syncing issues... #141

Closed
TechPerplexed opened this issue Jun 3, 2022 · 40 comments · Fixed by #144
Closed

[Import] Jellyfin : Strange syncing issues... #141

TechPerplexed opened this issue Jun 3, 2022 · 40 comments · Fixed by #144
Assignees
Labels
Jellyfin Backend Upstream Bug Bugs that are caused by media servers.

Comments

@TechPerplexed
Copy link

TechPerplexed commented Jun 3, 2022

For some reason WatchState stopped syncing a few days ago, so I removed the container and started again from scratch. This is on Debian 11 with Docker. However, it suddenly marked thousands of random episodes as watched. I checked the import log and it constantly updates the same entries.

I'm also noticing some weird renaming such as

[2022-06-03T10:08:50.241361-07:00] logger.NOTICE: plex: Updating 'Dark Angel (2000) - 01x004'. State changed. {(guids: [ (guid_imdb: [ (old: tt0554559), (new: tt0554566) ]) ])}

Also it doesn't seem to sync in between services. Any idea what could be wrong? As always, thanks :)

@arabcoders
Copy link
Owner

arabcoders commented Jun 3, 2022

Hi, i am writing this reply from my phone, From quick log view it seems you encountered NFO jellyfin bug for movies at least.

if you could please try pulling newest version. After that import all your backends. Once that is done try running import for each server. if you notice huge records changes between each single backend import that could indicate problem with that backend.

Im guessing here probably one of your backends lost access to your media library and the records got purged and after gaining access it pulled new metadata and now has mismatch.

You can also run backend:library:mismatch for the problematic backend to see if we are able to determine which library item has mismatched data.

@TechPerplexed
Copy link
Author

Thanks :) I ran the individual imports a few times again, but they keep reporting huge records changes for sure. Even running just the Plex import a few times in a row keeps resulting in a huge number of record changes (similar to what I posted above).... time and time again.

The mismatch query shows some interesting things.

I ran it on JF first and it showed a few mismatched movies (two, to be exact). I rematched them in JF but still the same result (both movies still mismatched).
It didn't find anything mismatched with the TV shows.

Emby showed 4 mismatched movies. Again, matching them in Emby didn't correct it.
It too didn't find any mismatched TV shows.

Plex, whoa. At least 20 or 30 mismatched movies (I didn't attempt to correct those).
No mismatched TV shows though.

@arabcoders
Copy link
Owner

No worries im now back at my pc i could take better look on logs, if you can please do the following, first move your database in /config/db/ to for example watchstate_v01.db-bak to start fresh database, then run the following commands in order the logs will be huge though

docker exec -ti watchstate ash -c "console state:import -vvv --force-full --trace > /config/logs/import.full.log"
docker exec -ti watchstate ash -c "console state:import -vvv --trace -s plex > /config/logs/import.plex.log"
docker exec -ti watchstate ash -c "console state:import -vvv --trace -s jellyfin > /config/logs/import.jellyfin.log"
docker exec -ti watchstate ash -c "console state:import -vvv --trace -s emby > /config/logs/import.emby.log"

once that done, compress the /config/logs/ folder and either attach link here or you can email them to me if you dont feel safe sharing them here.

@TechPerplexed
Copy link
Author

TechPerplexed commented Jun 3, 2022

Haha yeah that sure took a while... but here you are:

-snip-
For security sake, please change 7 before the w to 2 and the 9 behind the w to 3
Once you have the download, I'll remove the file

Again, thanks so much, I appreciate your support!

@arabcoders
Copy link
Owner

Np, i downloaded the logs you can delete the logs now if you want. i'll take look at hopefully will manage to point to the problem.

@arabcoders
Copy link
Owner

arabcoders commented Jun 4, 2022

From first look as i expected it seems jellyfin screwing up your data for some reason, take for example these following lines

import.full.log:[2022-06-03T15:56:12.160932-07:00] logger.DEBUG: plex: Processing '(Movies) - (movie:2) - [Source Code (2011)]' Payload. {(payload: [ (ratingKey: 9758), (key: /library/metadata/9758), (guid: plex://movie/5d776881e6d55c00204146e3), (studio: The Mark Gordon Company), (type: movie), (title: Source Code), (contentRating: PG-13), (summary: A soldier wakes up in someone else's body and discovers he's part of an experimental government program to find the bomber of a commuter train within 8 minutes.), (rating: 9.2), (audienceRating: 8.2), (viewCount: 87), (lastViewedAt: 1640373655), (year: 2011), (tagline: Make Every Second Count), (thumb: /library/metadata/9758/thumb/1651392583), (art: /library/metadata/9758/art/1651392583), (duration: 5592992), (originallyAvailableAt: 2011-04-01), (addedAt: 1535105296), (updatedAt: 1651392583), (audienceRatingImage: rottentomatoes://image.rating.upright), (chapterSource: media), (primaryExtraKey: /library/metadata/9779), (ratingImage: rottentomatoes://image.rating.ripe), (Media: [ (0: [ (id: 21021), (duration: 5592992), (bitrate: 21874), (width: 1920), (height: 1038), (aspectRatio: 1.85), (audioChannels: 8), (audioCodec: truehd), (videoCodec: h264), (videoResolution: 1080), (container: mkv), (videoFrameRate: 24p), (videoProfile: high), (Part: [ (0: [ (id: 21025), (key: /library/parts/21025/1535105296/file.mkv), (duration: 5592992), (file: /Media/Movies/Source Code (2011)/Source Code (2011) Bluray-1080p.mkv), (size: 15314406187), (container: mkv), (hasThumbnail: 1), (videoProfile: high) ]) ]) ]) ]), (Guid: [ (0: [ (id: imdb://tt0945513) ]), (1: [ (id: tmdb://45612) ]), (2: [ (id: tvdb://1285) ]) ]), (Genre: [ (0: [ (tag: Drama) ]), (1: [ (tag: Thriller) ]) ]), (Director: [ (0: [ (tag: Duncan Jones) ]) ]), (Writer: [ (0: [ (tag: Ben Ripley) ]) ]), (Country: [ (0: [ (tag: Canada) ]), (1: [ (tag: United States of America) ]) ]), (Role: [ (0: [ (tag: Jake Gyllenhaal) ]), (1: [ (tag: Michelle Monaghan) ]), (2: [ (tag: Vera Farmiga) ]) ]) ])}
import.full.log:[2022-06-03T16:02:42.661551-07:00] logger.DEBUG: emby: Processing '(Movies) - (movie:f137a2dd21bbc1b99aa5c0f6bf02a805) - [Source Code (2011)]' Payload. {(payload: [ (Name: Source Code), (OriginalTitle: Source Code), (ServerId: 41fecb83181449898bcbf3b904141272), (Id: 3563), (DateCreated: 2018-08-24T10:34:22.0000000Z), (PremiereDate: 2011-03-30T07:00:00.0000000Z), (RunTimeTicks: 55929920000), (ProductionYear: 2011), (ProviderIds: [ (Imdb: tt0945513), (Tmdb: 45612) ]), (IsFolder: ), (Type: Movie), (UserData: [ (PlaybackPositionTicks: 0), (PlayCount: 1), (IsFavorite: ), (LastPlayedDate: 2020-05-25T14:47:11.0000000Z), (Played: 1) ]), (MediaType: Video) ])}
import.full.log:[2022-06-03T16:05:08.059593-07:00] logger.DEBUG: jellyfin: Processing '(Movies) - (movie:f137a2dd21bbc1b99aa5c0f6bf02a805) - [Source Code (2011)]' Payload. {(payload: [ (Name: Source Code), (OriginalTitle: Source Code), (ServerId: dec05d69846b45fd83fef716022679c7), (Id: 98d27e59ab4bdb333428acc485f8d5af), (DateCreated: 2018-08-24T10:34:22.0000000Z), (HasSubtitles: 1), (Container: mkv,webm), (PremiereDate: 2011-03-30T07:00:00.0000000Z), (OfficialRating: PG-13), (ChannelId: None), (CommunityRating: 7.3), (RunTimeTicks: 55929921536), (ProductionYear: 2011), (ProviderIds: [ (Imdb: 45612), (Tmdb: 45612) ]), (IsFolder: ), (Type: Movie), (UserData: [ (PlaybackPositionTicks: 0), (PlayCount: 1), (IsFavorite: ), (LastPlayedDate: 2020-05-22T23:14:46.3852875Z), (Played: 1), (Key: 45612) ]), (VideoType: VideoFile), (ImageBlurHashes: [  ]), (LocationType: FileSystem), (MediaType: Video) ])}        

import.full.log:[2022-06-03T15:56:12.162131-07:00] logger.NOTICE: plex: Adding 'Source Code (2011)'. As new Item. {(type: movie), (updated: "2021-12-24T12:20:55-07:00"), (watched: Yes), (via: plex), (title: Source Code), (year: 2011), (guids: [ (guid_imdb: tt0945513), (guid_tmdb: 45612), (guid_tvdb: 1285), (guidv_plex: 9758) ]), (metadata: [ (plex: [ (id: 9758), (type: movie), (watched: 1), (via: plex), (title: Source Code), (guids: [ (imdb: tt0945513), (plex: movie/5d776881e6d55c00204146e3), (tmdb: 45612), (tvdb: 1285) ]), (added_at: 1535105296), (extra: [ (date: 2011-04-01) ]), (library: 2), (year: 2011), (played_at: 1640373655) ]) ]), (extra: [  ])}
import.full.log:[2022-06-03T16:02:42.663281-07:00] logger.NOTICE: emby: Updating 'Source Code (2011)'. State changed. {(guids: [ (guidv_emby: [ (old: None), (new: 3563) ]) ]), (metadata: [ (emby: [ (old: None), (new: [ (id: 3563), (type: movie), (watched: 1), (via: emby), (title: Source Code), (guids: [ (imdb: tt0945513), (tmdb: 45612) ]), (added_at: 1535106862), (extra: [ (date: 2011-03-30) ]), (library: f137a2dd21bbc1b99aa5c0f6bf02a805), (year: 2011), (played_at: 1590418031) ]) ]) ])}
import.full.log:[2022-06-03T16:05:08.060923-07:00] logger.NOTICE: jellyfin: Updating 'Source Code (2011)'. State changed. {(guids: [ (guid_imdb: [ (old: tt0945513), (new: 45612) ]), (guidv_emby: [ (old: None), (new: 3563) ]), (guidv_jellyfin: [ (old: None), (new: 98d27e59ab4bdb333428acc485f8d5af) ]) ]), (metadata: [ (emby: [ (old: None), (new: [ (id: 3563), (type: movie), (watched: 1), (via: emby), (title: Source Code), (guids: [ (imdb: tt0945513), (tmdb: 45612) ]), (added_at: 1535106862), (extra: [ (date: 2011-03-30) ]), (library: f137a2dd21bbc1b99aa5c0f6bf02a805), (year: 2011), (played_at: 1590418031) ]) ]), (jellyfin: [ (old: None), (new: [ (id: 98d27e59ab4bdb333428acc485f8d5af), (type: movie), (watched: 1), (via: jellyfin), (title: Source Code), (guids: [ (imdb: 45612), (tmdb: 45612) ]), (added_at: 1535106862), (extra: [ (date: 2011-03-30) ]), (library: f137a2dd21bbc1b99aa5c0f6bf02a805), (year: 2011), (played_at: 1590189286) ]) ]) ])}

The metadata from your jellyfin backend seems to be corrupted, And is reporting themoviedb ids as if they are imdb ids, if you check your initial import log file you will notice most of jellyfin updates relates to something like {(guids: [ (guid_imdb: [ (old: tt0945513), (new: 45612) ]) which is should not happen as imdb ids begins with tt(\d+)

Both emby/plex seems to agree on ids for the majority of your import while jellyfin disagree, this worth investigating more. do you happen to use NFO files for jellyfin? it seems there are bugs related to it in 10.7x

@TechPerplexed
Copy link
Author

Ah, yes, NFO is enabled. To tell you the truth, I'm not overly attached to Jellyfin. I still have a lifetime Plex and Emby subscription, and JF doesn't really enhance anything over those two. If the answer is to abandon it, I wouldn't cry ^_^

But if it helps you troubleshoot, I'd be more than willing to see if we can sort this. Is there anything you'd like me to do?

@arabcoders
Copy link
Owner

I honestly wouldn't want to abandon jellyfin, it's safe bet for the future in case plex/emby do something stupid.

Jellyfin NFO related bugs
jellyfin/jellyfin#5347 (comment)
jellyfin/jellyfin#6363

It seems it doesn't fix the external ids even after doing full metadata replace. You could continue using jellyfin, and remove your movies library from it as it seems thats the only problem related to NFO, otherwise your episodes listing seems to be fine. and reporting correct ids in majority of the cases as far as i can see.

on my side i think I'll implement fix to reject the external ids from jellyfin if they dont match expected format for imdb.

@arabcoders arabcoders changed the title Strange syncing issues... [Import] Jellyfin : Strange syncing issues... Jun 4, 2022
@arabcoders arabcoders added Jellyfin Backend Upstream Bug Bugs that are caused by media servers. labels Jun 4, 2022
@arabcoders arabcoders self-assigned this Jun 4, 2022
@arabcoders arabcoders mentioned this issue Jun 4, 2022
55 tasks
@TechPerplexed
Copy link
Author

Ok, that's a good idea... it won't be so bad just replacing the movie library since that scans a lot faster than all those series. I'll do that and report back. Would you recommend starting WatchState from scratch again after that's done?

@arabcoders
Copy link
Owner

arabcoders commented Jun 4, 2022

It's always good idea to start fresh, data purity is important in this, as you might end up with duplicate records in the database thanks to those ids :-(

@TechPerplexed
Copy link
Author

Sure thing :) I'll report back in a day or so if it's behaving correctly then!

@arabcoders
Copy link
Owner

No worries, i'll be implementing a fix for this hopefully today or tomorrow. Thanks for bringing this up

@TechPerplexed
Copy link
Author

Great! Meanwhile, I have deleted the Movies library from Jellyfin and re-added it without NFO. Then I reinstalled WatchState from scratch and ran the initial import.

I guess this is what you intended, but here's a heads up of some of the errors it spits out:

[2022-06-03T19:39:18.167286-07:00] logger.ERROR: jellyfin: Unexpected value for 'guid_imdb'. Expecting 'tt(number)' but got '9292'. {(file: /app/src/Libs/Guid.php), (line: 94), (kind: RuntimeException)}
[2022-06-03T19:39:18.168852-07:00] logger.ERROR: jellyfin: Unexpected value for 'guid_imdb'. Expecting 'tt(number)' but got '44826'. {(file: /app/src/Libs/Guid.php), (line: 94), (kind: RuntimeException)}
[2022-06-03T19:39:18.169236-07:00] logger.INFO: jellyfin: Parsing '(Movies) - (movie:f137a2dd21bbc1b99aa5c0f6bf02a805)' response complete.

@arabcoders
Copy link
Owner

Indeed thats the expected behavior until jellyfin fixes their NFO parser :-( to actually add your movies again you have to remove the library refresh jellyfin cache and then re-add the library. otherwise it will still pick up the incorrect ids as far as i know

@TechPerplexed
Copy link
Author

OH! Yeah I deleted the library but I don't think I refreshed the JF cache - I don't even know how to. I can certainly do it again, adding the library was a lot fast than I expected really.

@arabcoders
Copy link
Owner

i think it's in the Scheduled Tasks tab

@TechPerplexed
Copy link
Author

Thank you :) I'll try that tomorrow and report back again!

@arabcoders
Copy link
Owner

No worries. good night =)

@TechPerplexed
Copy link
Author

TechPerplexed commented Jun 4, 2022

Okay as promised, a status report :) So, deleting the library, clearing the cache and re-adding it didn't solve it, because it adds the movies with exactly the same flaw as before. But at least now with the new WS version it doesn't bugger up anything else any longer.

I do however still have one issue: watching things on for example Plex will mark it watched on the other services, but marking something watched manually doesn't do anything at all. I know this was a know issue with Plex, but it doesn't work with Emby or JF either.

Perhaps unrelated but running docker exec -ti watchstate console state:push --queue-show gives an error: The "--queue-show" option does not exist.

@arabcoders
Copy link
Owner

arabcoders commented Jun 4, 2022

--queue-show has become its own command console db:queue it should show changes made via webhooks.

For marking things on other services. Tr the following, mark on emby or jellyfin after that pull only changes from that backend

docker exec -ti watchstate console state:pull -v -s emby

and check the item in db:list is the state reflected in the list or not

@TechPerplexed
Copy link
Author

Ahh ok. So yeah, db:queue shows No items in the queue.

stage:pull -v -s emby shows

In Application.php line 683:

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "state:pull" is not defined.

  Did you mean one of these?
      state:export
      state:import
      state:push


Exception trace:
  at /app/vendor/symfony/console/Application.php:683
 Symfony\Component\Console\Application->find() at /app/vendor/symfony/console/Application.php:259
 Symfony\Component\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /app/src/Libs/Initializer.php:118
 App\Libs\Initializer->runConsole() at /app/console:66

And finally, db:list shows only stuff that is synced between Plex and Jellyfin, whatever got marked in Emby didn't sync to either. The plot thickens 😆

@arabcoders
Copy link
Owner

arabcoders commented Jun 4, 2022

sorry i meant state:import right now using my phone xD also could you take look in docker logs -f watchstate and see if marking something in emby does trigger a response from the webhook handler or not.

the data shown in db:list reflect the last changes received to see full data entry try db:list --output yaml -l 5 it should show to you all metadata available from all backends. you also try db:list --metadata-as [backend_name] it will switch shown data to that backend

@TechPerplexed
Copy link
Author

Hah, okay enjoy your leisure time! state:import with emby gives an error as well

[2022-06-04T14:09:57.085683-07:00] logger.NOTICE: Running WatchState Version '4282613'.
[2022-06-04T14:09:57.088582-07:00] logger.NOTICE: MAPPER: Preloading database into memory.

In Guid.php line 94:

  [RuntimeException]
  Unexpected value for 'guid_imdb'. Expecting 'tt(number)' but got '1846'.


Exception trace:
  at /app/src/Libs/Guid.php:94
 App\Libs\Guid->__construct() at /app/src/Libs/Guid.php:144
 App\Libs\Guid::fromArray() at /app/src/Libs/Entity/StateEntity.php:162
 App\Libs\Entity\StateEntity->getPointers() at /app/src/Libs/Mappers/Import/MemoryMapper.php:445
 App\Libs\Mappers\Import\MemoryMapper->addPointers() at /app/src/Libs/Mappers/Import/MemoryMapper.php:63
 App\Libs\Mappers\Import\MemoryMapper->loadData() at /app/src/Commands/State/ImportCommand.php:197
 App\Commands\State\ImportCommand->process() at /app/src/Commands/State/ImportCommand.php:74
 App\Commands\State\ImportCommand->App\Commands\State\{closure}() at /app/src/Command.php:99
 App\Command->single() at /app/src/Commands/State/ImportCommand.php:74
 App\Commands\State\ImportCommand->runCommand() at /app/src/Command.php:35
 App\Command->execute() at /app/vendor/symfony/console/Command/Command.php:291
 Symfony\Component\Console\Command\Command->run() at /app/vendor/symfony/console/Application.php:989
 Symfony\Component\Console\Application->doRunCommand() at /app/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /app/src/Libs/Initializer.php:118
 App\Libs\Initializer->runConsole() at /app/console:66

state:import [-f|--force-full] [--dry-run] [--timeout TIMEOUT] [-s|--servers-filter [SERVERS-FILTER]] [--exclude] [--trace] [--always-update-metadata] [--direct-mapper] [--metadata-only] [-c|--config CONFIG]

As for marking things watched on both services - it seems to be a little erratic (works sometimes, doesn't work other times) so let me shut my big mouth until I have tested stuff in a little more detail with all the commands you just shared 🤣

@arabcoders
Copy link
Owner

i think i understand why it's happening, it seems emby also effected by the NFO bug or at least this one entry you got is using tmdb ids as imdb, anyway I'll be making new change to make it into an error instead of fetal exception. and continue parsing other ids.

@arabcoders
Copy link
Owner

@TechPerplexed fix is out, pull the new container and try now.

@TechPerplexed
Copy link
Author

TechPerplexed commented Jun 4, 2022

Aaallllllllllmost, lol. Sorry to be such a nuisance - I really appreciate your responsiveness and patience!

So here's the latest. I waited for the queue to finish before reporting to you. I marked one episode watched on Emby and one on Jellyfin (since with Plex only actual watching seems to matter).

Marked watched on JF: synced without issues to Emby and Plex
Marked watched on Emby: didn't sync to either Plex or JF

So, Jellyfin works fine, so does Plex.
Emby however seems to be able to receive, but not send.

@arabcoders
Copy link
Owner

Hmm, it might be possible you actually have import disabled for emby? could you try

docker exec -ti watchstate console servers:view -s emby ofc remove your secrets. also if you watch the docker log -f emby and trigger mark as played event from emby are you getting any logs there?

@TechPerplexed
Copy link
Author

This is what I have:

┌────────┬───────────────────────────────────────────┐
│ Server │ Filter: None │
├────────┼───────────────────────────────────────────┤
│ emby │ name: emby │
│ │ type: emby │
│ │ url: 'http://emby:8096' │
│ │ token: xxxxx │
│ │ uuid: xxxxx │
│ │ user: xxxxx │
│ │ import: │
│ │ enabled: true │
│ │ lastSync: 1654383610 │
│ │ export: │
│ │ enabled: true │
│ │ lastSync: 1654381801 │
│ │ webhook: │
│ │ import: true │
│ │ push: true │
│ │ match: │
│ │ user: true │
│ │ uuid: false │
│ │ token: xxxxx │
│ │ persist: { } │
└────────┴───────────────────────────────────────────┘

There are two Emby users, that is why I enabled user:true.

As for docker log -f emby it tells me unknown shorthand flag: 'f' in -f

@arabcoders
Copy link
Owner

arabcoders commented Jun 4, 2022

Your config seems to be fine. Sorry it's docker logs -f watchstate run this command and then go to your emby and mark something and see if you get log in there

@TechPerplexed
Copy link
Author

TechPerplexed commented Jun 4, 2022

Ah, no it doesn't get logged, however I do see a long list of errors like these:

[2022-06-04T16:29:20.325284-07:00] logger.ERROR: emby: Webhook payload has no id. {"file":"/app/src/Libs/Servers/EmbyServer.php","line":129,"attributes":{"ITEM_ID":"42400","SERVER_ID":"xxxxx","SERVER_NAME":"Omni","SERVER_VERSION":"4.7.2.0","USER_ID":"xxxxx","USER_NAME":"Sophia","WH_EVENT":"item.markplayed","WH_TYPE":"Episode"},"log":[]} []
[2022-06-04T23:29:20+00:00]   status: 400 - message: "emby: Webhook payload has no id." - event: "-" - type: "-" - id: "-" - item: "-" - backend: "-" - version: "-" - apikey: "-" - request_id: "xxxxx" - request: "POST /?&apikey=xxxxx HTTP/1.1":70 - host: watchstate - ip: 172.19.0.14 - agent: "Emby Server/4.7.2.0"

Edit: oh wait, I do see the event of it RECEIVING the entry from Jellyfin:

[2022-06-04T23:30:01+00:00] status: 200 - message: "Updated episode." - event: "UserDataSaved" - type: "Episode" - id: "31607" - item: "Beyond (2017) - 01x001" - backend: "jellyfin" - version: "c27c023" - apikey: "xxxxx" - request_id: "xxxxx" - request: "POST /?&apikey=xxxxx HTTP/1.1":1875 - host: watchstate - ip: 172.19.0.10 - agent: "Jellyfin-Server/10.7.7"

@arabcoders
Copy link
Owner

Sorry im not following, do you mean emby events are being shown as jellyfin events i log?

@TechPerplexed
Copy link
Author

Oh I'm not sure - this is the output of docker logs -f watchstate - I didn't specify Emby there. Sorry I know just enough to be dangerous, haha.

@arabcoders
Copy link
Owner

haha, no problem, i think thats unrelated as it's show everything there, anyway, i need to see some request dump from emby, edit your emby webhook url to include this &rdump=1 i.e. for example your URL looks like http://localhost/?apikey=[token] append the query to be http://localhost/?apikey=[token]&rdump=1

@TechPerplexed
Copy link
Author

Wait, wait wait wait. You are magic. You are solving stuff without even updating anything ^_^

I just marked something watched on Emby and another on Jellyfin, and the docker logs that is still running just mentioned

[2022-06-04T23:38:06+00:00]   status: 200 - message: "episode Marked as Played" - event: "UserDataSaved" - type: "Episode" - id: "31619" - item: "Beyond (2017) - 01x003" - backend: "jellyfin" - version: "c27c023" - apikey: "xxxxx" - request_id: "xxxxx" - request: "POST /?&apikey=xxxxx HTTP/1.1":1877 - host: watchstate - ip: 172.19.0.10 - agent: "Jellyfin-Server/10.7.7"
[2022-06-04T23:38:14+00:00]   status: 200 - message: "episode Marked as Played" - event: "UserDataSaved" - type: "Episode" - id: "31621" - item: "Beyond (2017) - 01x005" - backend: "jellyfin" - version: "c27c023" - apikey: "xxxxx" - request_id: "xxxxx" - request: "POST /?&apikey=xxxxx HTTP/1.1":1901 - host: watchstate - ip: 172.19.0.10 - agent: "Jellyfin-Server/10.7.7"
[2022-06-04T16:38:33.784028-07:00] logger.ERROR: emby: Webhook payload has no id. {"file":"/app/src/Libs/Servers/EmbyServer.php","line":129,"attributes":{"ITEM_ID":"42401","SERVER_ID":"xxxxx","SERVER_NAME":"Omni","SERVER_VERSION":"4.7.2.0","USER_ID":"xxxxx","USER_NAME":"Sophia","WH_EVENT":"item.markplayed","WH_TYPE":"Episode"},"log":[]} []
[2022-06-04T23:38:33+00:00]   status: 400 - message: "emby: Webhook payload has no id." - event: "-" - type: "-" - id: "-" - item: "-" - backend: "-" - version: "-" - apikey: "-" - request_id: "xxxxx" - request: "POST /?&apikey=xxxxx HTTP/1.1":70 - host: watchstate - ip: 172.19.0.14 - agent: "Emby Server/4.7.2.0"

For reference, that is one episode I marked watched on Emby, and one episode I marked watched on JF.

But here's the real beauty: they BOTH synced with each other!!!

Don't tell me it got solved by just talking about this 😆

@arabcoders
Copy link
Owner

Haha, i wish it was this easy, anyway because i dont have Emby premium it's hard for me to diagnose any webhook related problems there. anyway your logs helped and i discovered that i fat fingered something in Emby webhook parsing. a fix should be out shorty.

@TechPerplexed
Copy link
Author

That reminds me.... do you accept donations? It might buy you at least a few months of Emby (or a few beers, whichever you prefer). Anyway thanks for this really useful script, I really don't miss Trakt!

Cheers, Sophia

@arabcoders
Copy link
Owner

arabcoders commented Jun 4, 2022

That reminds me.... do you accept donations? It might buy you at least a few months of Emby (or a few beers, whichever you prefer). Anyway thanks for this really useful script, I really don't miss Trakt!

Cheers, Sophia

Oh.. dont worry about, the only reason i dont have Emby is i actually like Plex interface more and it works well with my apple tv setup, i plan on getting Emby premium just before release to check everything related to it.

If you feel like donating please donate to any charity that take care of kids everywhere. ❤️

PS: new build is out and ready for testing. do the same again docker logs -f watchstate and trigger event from emby.

@TechPerplexed
Copy link
Author

Awww, you're awesome :) Also, this log is more like it!!

[2022-06-04T23:56:01+0000] Starting HTTP Server.
[2022-06-04T23:56:01+0000] Starting Task Scheduler.
[2022-06-04T23:56:01+0000] Starting Cache Server.
[2022-06-04T23:56:01+0000] Running - WatchState c475401
[04-Jun-2022 23:56:12] NOTICE: fpm is running, pid 1
[04-Jun-2022 23:56:12] NOTICE: ready to handle connections
[2022-06-04T23:56:56+00:00]   status: 200 - message: "episode Marked as Played" - event: "item.markplayed" - type: "Episode" - id: "31613" - item: "Beyond (2018) - 02x001" - backend: "emby" - version: "c475401" - apikey: "-" - request_id: "xxxxx" - request: "POST /?&apikey=xxxxx HTTP/1.1":1824 - host: watchstate - ip: 172.19.0.14 - agent: "Emby Server/4.7.2.0"

@arabcoders
Copy link
Owner

Awww, you're awesome :) Also, this log is more like it!!

[2022-06-04T23:56:01+0000] Starting HTTP Server.
[2022-06-04T23:56:01+0000] Starting Task Scheduler.
[2022-06-04T23:56:01+0000] Starting Cache Server.
[2022-06-04T23:56:01+0000] Running - WatchState c475401
[04-Jun-2022 23:56:12] NOTICE: fpm is running, pid 1
[04-Jun-2022 23:56:12] NOTICE: ready to handle connections
[2022-06-04T23:56:56+00:00]   status: 200 - message: "episode Marked as Played" - event: "item.markplayed" - type: "Episode" - id: "31613" - item: "Beyond (2018) - 02x001" - backend: "emby" - version: "c475401" - apikey: "-" - request_id: "xxxxx" - request: "POST /?&apikey=xxxxx HTTP/1.1":1824 - host: watchstate - ip: 172.19.0.14 - agent: "Emby Server/4.7.2.0"

Glad it's working for you now :-)

Please don't hesitate to report any issues/problems that you may notice. 👍

@TechPerplexed
Copy link
Author

Haha ok. Right now the most pressing issue is a hungry hubby and three cats that want feeding ^_^

Thanks again for everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jellyfin Backend Upstream Bug Bugs that are caused by media servers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants