Jump to content

UNIQUE constraint failed: episode.idEpisode


Saviq
 Share

Recommended Posts

Hey,

 

With the plugin version 3.1.28a I started having trouble with the sync, it seemed to interrupt on one of the shows claiming the UNIQUE constraint failed:

09:59:14.177 T:3900707744  NOTICE: EMBY.objects.tvshows -> ADD tvshow [2/275/273] Tom Clancy's Jack Ryan: 85450
09:59:14.380 T:3900707744  NOTICE: EMBY.objects.kodi.artwork -> -->[ q:artwork/3762033040 ]
09:59:14.399 T:3900707744  NOTICE: EMBY.objects.kodi.artwork -> -->[ q:artwork/3703240976 ]
09:59:14.521 T:3900707744  NOTICE: EMBY.objects.kodi.artwork -> -->[ q:artwork/3883268208 ]
09:59:14.523 T:3900707744  NOTICE: EMBY.objects.tvshows -> UPDATE season [273/805] Sezon 1: 74833
09:59:15.736 T:3900707744  NOTICE: EMBY.objects.tvshows -> ADD tvshow [2/276/274] Tom Clancy's Jack Ryan: 85445
09:59:16.024 T:3900707744  NOTICE: EMBY.objects.tvshows -> UPDATE season [274/807] Sezon 1: 74833
09:59:17.711 T:3900707744  NOTICE: EMBY.database -> ERROR:: type: <class 'sqlite3.IntegrityError'> value: UNIQUE constraint failed: episode.idEpisode
09:59:17.712 T:3900707744  NOTICE: EMBY.database -> [emby] 5661 rows updated.
09:59:17.895 T:3900707744  NOTICE: EMBY.database -> ERROR:: type: <class 'sqlite3.IntegrityError'> value: UNIQUE constraint failed: episode.idEpisode
09:59:17.896 T:3900707744  NOTICE: EMBY.database -> [video] 86824 rows updated.

Indeed something was off in the Emby database, I had to remove the show twice and now it all seems to have synced fine.

 

That said, the plugin could deal better with this error? Skip over the duplicate show maybe? That seems to be what it did so far.

Link to comment
Share on other sites

Angelblue05

Thanks for reporting. For sure, but it sure would be nice to understand how it even happened. Can you tell me of the structure for your tv show? Do they span across multiple folders? Thank you

Link to comment
Share on other sites

In general I have Shows/{Title}/{File} structure, with a separate 4K/Shows/{Title}/{File} set. There may be duplicates between those (same show in 4K and lower resolution) and I try to combine the two versions in Emby.

 

The show in question, however, was just a single folder, no duplicates. Somehow it got duplicated in Emby even though each episode only had a single file associated. It could be enough to forward the title of the failed show to the user so they know what to look at in Emby?

  • Like 1
Link to comment
Share on other sites

Angelblue05

Strange, looking at your snippet, looks like Emby has created two tv show entry for that one show. Anyway, I will work on making this process more robust.

Link to comment
Share on other sites

Yes exactly, and I had to delete it twice from Emby for it to go away - so it was certainly Emby's database at fault.

  • Like 1
Link to comment
Share on other sites

Yes exactly, and I had to delete it twice from Emby for it to go away - so it was certainly Emby's database at fault.

 

Hey there...

 

I have the exact same behaviour and the same error in my kodi.log with syncing some tvshows in Kodi using the latest emby addon.

 

Do you have to delete your entry in Emby Server to make the error dissapear?

I tried to re-scrape the metadata for the entry in Emby Server... and one of the errors was gone.

 

Is there any easier way to fix this?

Edited by nocci
Link to comment
Share on other sites

Angelblue05

Try to repair your tv library. Launch the addon open the context menu on the library, try repair library. Does it allow it to complete this time?

Link to comment
Share on other sites

Try to repair your tv library. Launch the addon open the context menu on the library, try repair library. Does it allow it to complete this time?

No... My solution was to delete the tvshow.xml in the specific folders and re-generate the metadata for the tv shows.

After I have done this, the addon was able to sync as normal.

 

Sure... this was a quick and dirty fix, but because I had this problem for over a week this was the best solution for me this time.

 

So I guess your addon does what it should be, but maybe the error message could be more specific. :D

 

EDIT: I really had some dupes on my disk as well. So the addon just collapsed if there are same tvseries in two folders so I had to check in Emby Server as well.

Edited by nocci
  • Like 1
Link to comment
Share on other sites

ddurdle

I just ran into the same problem.  In my case the tv show is broken up across two different folders.  This wasn't happening in the past, against the same database (emby 3.3).

Link to comment
Share on other sites

Angelblue05

Duplicate episodes? The difference is that series pooling is applied instantly now, by the add-on. Can you provide the Kodi log? Not just a snippet like op because I don't see the full error trace.

Edited by Angelblue05
  • Like 1
Link to comment
Share on other sites

ddurdle

I'll post the log.

 

In my case there are 4 tv series that have multiple folders but the same tv series

deception 2018 vs deception (2018)

dc's legends of tomorrow vs legends of tomorrow

dirk gently's holistic detective agency vs dirk gentlys holistic detective agency

big hero 6- the series vs big hero 6 the series

 

There is just one odd-ball tv series that I can't find it's duplicate series name (by searching the disk or by searching in emby, reports only 1 such folder) -- that tv series is "pose".

 

Log I'll upload from the test system.

  • Like 1
Link to comment
Share on other sites

Angelblue05

Thank you for your log. I see where the issue is happening. I'll work on a fix. Just so I fully understand, are those shows appearing as one entry in the web client?

Link to comment
Share on other sites

ddurdle

Ran across another series -- for the people 2018 vs for the people (2018).

 

To temporarily bypass the issue, I've been changing the permissions on the duplicate tv show folder so that emby no longer has access to it, so it then removes it from the library.

kodi.log

Link to comment
Share on other sites

ddurdle

Thank you for your log. I see where the issue is happening. I'll work on a fix. Just so I fully understand, are those shows appearing as one entry in the web client?

 

Correct, they show up as 1 entry.  Even when searching, it returns only 1 entry

  • Like 1
Link to comment
Share on other sites

Angelblue05

Last question. The same episode exists in both tv show's physical location?

 

The reason I ask is that I do have a few series pooling but I don't run into this issue.

Edited by Angelblue05
Link to comment
Share on other sites

ddurdle

Some of the series I looked at, some will have some of the seasons (1-5) in one folder and the 6th season in the second folder.

 

Some of the other series will have some of the episodes of a season in one and the remaining season one episodes in the other.

 

One of the series I checked, there were duplicate episodes in both.

  • Like 1
Link to comment
Share on other sites

Angelblue05

Are you able to test using this build? This is only for Krypton. Keep me posted. Also let me know if you are missing any episodes regarding those series if it does complete without errors.

plugin.video.emby-3.1.30b.zip

Edited by Angelblue05
Link to comment
Share on other sites

ddurdle
avengers assemble/season 02:

avengers assemble S02E20 - original 1080p.nfo

avengers assemble S02E20 - original 1080p.strm

avengers assemble S02E20 - original 1080p-thumb.jpg

avengers assemble S02E21 - original 1080p.nfo

avengers assemble S02E21 - original 1080p.strm

avengers assemble S02E21 - original 1080p-thumb.jpg

avengers assemble S02E22 - original 1080p.nfo

avengers assemble S02E22 - original 1080p.strm

avengers assemble S02E22 - original 1080p-thumb.jpg

avengers assemble S02E23 - original 1080p.eng.srt

avengers assemble S02E23 - original 1080p.nfo

avengers assemble S02E23 - original 1080p.strm

avengers assemble S02E23 - original 1080p-thumb.jpg

avengers assemble S02E24 - original 1080p.nfo

avengers assemble S02E24 - original 1080p.strm

avengers assemble S02E24 - original 1080p-thumb.jpg

avengers assemble S02E25 - original 1080p.nfo

avengers assemble S02E25 - original 1080p.strm

avengers assemble S02E26 - original 1080p.nfo

avengers assemble S02E26 - original 1080p.strm

season.nfo

 

 marvel's avengers assemble/season 01/:


/season 01:

marvel's avengers assemble S01E01 - original 1080p.nfo

marvel's avengers assemble S01E01 - original 1080p.strm

marvel's avengers assemble S01E01 - original 1080p-thumb.jpg

marvel's avengers assemble S01E02 - original 1080p.nfo

marvel's avengers assemble S01E02 - original 1080p.strm

marvel's avengers assemble S01E02 - original 1080p-thumb.jpg

marvel's avengers assemble S01E03 - original 1080p.nfo

marvel's avengers assemble S01E03 - original 1080p.strm

marvel's avengers assemble S01E03 - original 1080p-thumb.jpg

marvel's avengers assemble S01E04 - original 1080p.nfo

marvel's avengers assemble S01E04 - original 1080p.strm

marvel's avengers assemble S01E04 - original 1080p-thumb.jpg

marvel's avengers assemble S01E05 - original 1080p.nfo

marvel's avengers assemble S01E05 - original 1080p.strm

marvel's avengers assemble S01E05 - original 1080p-thumb.jpg

marvel's avengers assemble S01E06 - original 1080p.nfo

marvel's avengers assemble S01E06 - original 1080p.strm

marvel's avengers assemble S01E06 - original 1080p-thumb.jpg

marvel's avengers assemble S01E07 - original 1080p.nfo

marvel's avengers assemble S01E07 - original 1080p.strm

marvel's avengers assemble S01E07 - original 1080p-thumb.jpg

marvel's avengers assemble S01E08 - original 1080p.nfo

marvel's avengers assemble S01E08 - original 1080p.strm

marvel's avengers assemble S01E08 - original 1080p-thumb.jpg

marvel's avengers assemble S01E09 - original 1080p.nfo

marvel's avengers assemble S01E09 - original 1080p.strm

marvel's avengers assemble S01E09 - original 1080p-thumb.jpg

marvel's avengers assemble S01E10 - original 1080p.nfo

marvel's avengers assemble S01E10 - original 1080p.strm

marvel's avengers assemble S01E10 - original 1080p-thumb.jpg

marvel's avengers assemble S01E11 - original 1080p.nfo

marvel's avengers assemble S01E11 - original 1080p.strm

marvel's avengers assemble S01E11 - original 1080p-thumb.jpg

marvel's avengers assemble S01E12 - original 1080p.nfo

marvel's avengers assemble S01E12 - original 1080p.strm

marvel's avengers assemble S01E12 - original 1080p-thumb.jpg

marvel's avengers assemble S01E13 - original 1080p.nfo

marvel's avengers assemble S01E13 - original 1080p.strm

marvel's avengers assemble S01E13 - original 1080p-thumb.jpg

marvel's avengers assemble S01E14 - original 1080p.nfo

marvel's avengers assemble S01E14 - original 1080p.strm

marvel's avengers assemble S01E14 - original 1080p-thumb.jpg

marvel's avengers assemble S01E15 - original 1080p.nfo

marvel's avengers assemble S01E15 - original 1080p.strm

marvel's avengers assemble S01E15 - original 1080p-thumb.jpg

marvel's avengers assemble S01E16 - original 1080p.nfo

marvel's avengers assemble S01E16 - original 1080p.strm


marvel's avengers assemble S01E17 - original 1080p.nfo

marvel's avengers assemble S01E17 - original 1080p.strm

marvel's avengers assemble S01E17 - original 1080p-thumb.jpg

marvel's avengers assemble S01E18 - original 1080p.nfo

marvel's avengers assemble S01E18 - original 1080p.strm

marvel's avengers assemble S01E18 - original 1080p-thumb.jpg

marvel's avengers assemble S01E19 - original 1080p.nfo

marvel's avengers assemble S01E19 - original 1080p.strm

marvel's avengers assemble S01E19 - original 1080p-thumb.jpg

marvel's avengers assemble S01E20 - original 1080p.nfo

marvel's avengers assemble S01E20 - original 1080p.strm

marvel's avengers assemble S01E20 - original 1080p-thumb.jpg

marvel's avengers assemble S01E21 - original 1080p.nfo

marvel's avengers assemble S01E21 - original 1080p.strm

marvel's avengers assemble S01E21 - original 1080p-thumb.jpg

marvel's avengers assemble S01E22 - original 1080p.nfo

marvel's avengers assemble S01E22 - original 1080p.strm

marvel's avengers assemble S01E22 - original 1080p-thumb.jpg

marvel's avengers assemble S01E23 - original 1080p.nfo

marvel's avengers assemble S01E23 - original 1080p.strm

marvel's avengers assemble S01E23 - original 1080p-thumb.jpg

marvel's avengers assemble S01E24 - original 1080p.nfo

marvel's avengers assemble S01E24 - original 1080p.strm

marvel's avengers assemble S01E24 - original 1080p-thumb.jpg

marvel's avengers assemble S01E25 - original 1080p.nfo

marvel's avengers assemble S01E25 - original 1080p.strm

marvel's avengers assemble S01E25 - original 1080p-thumb.jpg

marvel's avengers assemble S01E26 - original 1080p.nfo

marvel's avengers assemble S01E26 - original 1080p.strm

marvel's avengers assemble S01E26 - original 1080p-thumb.jpg

season.nfo


./season 02:

marvel's avengers assemble S02E01 - original 1080p.nfo

marvel's avengers assemble S02E01 - original 1080p.strm

marvel's avengers assemble S02E01 - original 1080p-thumb.jpg

marvel's avengers assemble S02E02 - original 1080p.eng.srt

marvel's avengers assemble S02E02 - original 1080p.nfo

marvel's avengers assemble S02E02 - original 1080p.strm

marvel's avengers assemble S02E02 - original 1080p-thumb.jpg

marvel's avengers assemble S02E03 - original 1080p.nfo

marvel's avengers assemble S02E03 - original 1080p.strm

marvel's avengers assemble S02E03 - original 1080p-thumb.jpg

marvel's avengers assemble S02E04 - original 1080p.nfo

marvel's avengers assemble S02E04 - original 1080p.strm

marvel's avengers assemble S02E04 - original 1080p-thumb.jpg

marvel's avengers assemble S02E05 - original 1080p.nfo

marvel's avengers assemble S02E05 - original 1080p.strm

marvel's avengers assemble S02E05 - original 1080p-thumb.jpg

marvel's avengers assemble S02E06 - original 1080p.nfo

marvel's avengers assemble S02E06 - original 1080p.strm

marvel's avengers assemble S02E06 - original 1080p-thumb.jpg

marvel's avengers assemble S02E07 - original 1080p.nfo

marvel's avengers assemble S02E07 - original 1080p.strm

marvel's avengers assemble S02E07 - original 1080p-thumb.jpg

marvel's avengers assemble S02E08 - original 1080p.nfo

marvel's avengers assemble S02E08 - original 1080p.strm

marvel's avengers assemble S02E08 - original 1080p-thumb.jpg

marvel's avengers assemble S02E09 - original 1080p.nfo

marvel's avengers assemble S02E09 - original 1080p.strm

marvel's avengers assemble S02E09 - original 1080p-thumb.jpg

marvel's avengers assemble S02E10 - original 1080p.nfo

marvel's avengers assemble S02E10 - original 1080p.strm

marvel's avengers assemble S02E10 - original 1080p-thumb.jpg

marvel's avengers assemble S02E11 - original 1080p.nfo

marvel's avengers assemble S02E11 - original 1080p.strm

marvel's avengers assemble S02E11 - original 1080p-thumb.jpg

marvel's avengers assemble S02E12 - original 1080p.nfo

marvel's avengers assemble S02E12 - original 1080p.strm

marvel's avengers assemble S02E12 - original 1080p-thumb.jpg

marvel's avengers assemble S02E13 - original 1080p.nfo

marvel's avengers assemble S02E13 - original 1080p.strm

marvel's avengers assemble S02E13 - original 1080p-thumb.jpg

marvel's avengers assemble S02E14 - original 1080p.nfo

marvel's avengers assemble S02E14 - original 1080p.strm

marvel's avengers assemble S02E14 - original 1080p-thumb.jpg


marvel's avengers assemble S02E15 - original 1080p.nfo

marvel's avengers assemble S02E15 - original 1080p.strm

marvel's avengers assemble S02E15 - original 1080p-thumb.jpg

marvel's avengers assemble S02E16 - original 1080p.nfo

marvel's avengers assemble S02E16 - original 1080p.strm

marvel's avengers assemble S02E16 - original 1080p-thumb.jpg

marvel's avengers assemble S02E17 - original 1080p.nfo

marvel's avengers assemble S02E17 - original 1080p.strm

marvel's avengers assemble S02E17 - original 1080p-thumb.jpg

marvel's avengers assemble S02E18 - original 1080p.eng.srt

marvel's avengers assemble S02E18 - original 1080p.nfo

marvel's avengers assemble S02E18 - original 1080p.strm

marvel's avengers assemble S02E18 - original 1080p-thumb.jpg

marvel's avengers assemble S02E19 - original 1080p.nfo

marvel's avengers assemble S02E19 - original 1080p.strm

marvel's avengers assemble S02E19 - original 1080p-thumb.jpg

season.nfo

 


./season 04:

marvel's avengers assemble S04E01 - original 1080p.nfo

marvel's avengers assemble S04E01 - original 1080p.strm

marvel's avengers assemble S04E01 - original 1080p-thumb.jpg

marvel's avengers assemble S04E02 - original 1080p.nfo

marvel's avengers assemble S04E02 - original 1080p.strm

marvel's avengers assemble S04E02 - original 1080p-thumb.jpg

marvel's avengers assemble S04E03 - original 1080p.nfo

marvel's avengers assemble S04E03 - original 1080p.strm

marvel's avengers assemble S04E03 - original 1080p-thumb.jpg

marvel's avengers assemble S04E04 - original 1080p.nfo

marvel's avengers assemble S04E04 - original 1080p.strm

marvel's avengers assemble S04E04 - original 1080p-thumb.jpg

marvel's avengers assemble S04E05 - original 1080p.nfo

marvel's avengers assemble S04E05 - original 1080p.strm

marvel's avengers assemble S04E05 - original 1080p-thumb.jpg

marvel's avengers assemble S04E06 - original 1080p.nfo

marvel's avengers assemble S04E06 - original 1080p.strm

marvel's avengers assemble S04E06 - original 1080p-thumb.jpg

marvel's avengers assemble S04E07 - original 1080p.nfo

marvel's avengers assemble S04E07 - original 1080p.strm

marvel's avengers assemble S04E07 - original 1080p-thumb.jpg

marvel's avengers assemble S04E08 - original 1080p.nfo

marvel's avengers assemble S04E08 - original 1080p.strm

marvel's avengers assemble S04E08 - original 1080p-thumb.jpg

marvel's avengers assemble S04E09 - original 1080p.nfo

marvel's avengers assemble S04E09 - original 1080p.strm

marvel's avengers assemble S04E09 - original 1080p-thumb.jpg

marvel's avengers assemble S04E10 - original 1080p.nfo

marvel's avengers assemble S04E10 - original 1080p.strm

marvel's avengers assemble S04E10 - original 1080p-thumb.jpg

marvel's avengers assemble S04E11 - original 1080p.nfo

marvel's avengers assemble S04E11 - original 1080p.strm

marvel's avengers assemble S04E11 - original 1080p-thumb.jpg

marvel's avengers assemble S04E12 - original 1080p.nfo

marvel's avengers assemble S04E12 - original 1080p.strm

marvel's avengers assemble S04E12 - original 1080p-thumb.jpg


marvel's avengers assemble S04E13 - original 1080p.nfo

marvel's avengers assemble S04E13 - original 1080p.strm

marvel's avengers assemble S04E13 - original 1080p-thumb.jpg

marvel's avengers assemble S04E14 - original 1080p.nfo

marvel's avengers assemble S04E14 - original 1080p.strm

marvel's avengers assemble S04E15 - original 1080p.nfo

marvel's avengers assemble S04E15 - original 1080p.strm

marvel's avengers assemble S04E16 - original 1080p.nfo

marvel's avengers assemble S04E16 - original 1080p.strm

marvel's avengers assemble S04E17 - original 1080p.nfo

marvel's avengers assemble S04E17 - original 1080p.strm

marvel's avengers assemble S04E18 - original 1080p.nfo

marvel's avengers assemble S04E18 - original 1080p.strm

marvel's avengers assemble S04E19 - original 1080p.nfo

marvel's avengers assemble S04E19 - original 1080p.strm

marvel's avengers assemble S04E20 - original 1080p.nfo

marvel's avengers assemble S04E20 - original 1080p.strm

marvel's avengers assemble S04E21 - original 1080p.nfo

marvel's avengers assemble S04E21 - original 1080p.strm

marvel's avengers assemble S04E22 - original 1080p.nfo

marvel's avengers assemble S04E22 - original 1080p.strm

marvel's avengers assemble S04E23 - original 1080p.nfo

marvel's avengers assemble S04E23 - original 1080p.strm

marvel's avengers assemble S04E24 - original 1080p.nfo

marvel's avengers assemble S04E24 - original 1080p.strm

marvel's avengers assemble S04E25 - original 1080p.nfo

marvel's avengers assemble S04E25 - original 1080p.strm

season.nfo

 


./season 05:

marvel's avengers assemble S05E01 - original 1080p.strm

marvel's avengers assemble S05E02 - original 1080p.strm

marvel's avengers assemble S05E03 - original 1080p.strm

marvel's avengers assemble S05E04 - original 1080p.strm

 







Link to comment
Share on other sites

Angelblue05

@@ddurdle

 

In the add-on settings > advanced > check for updates

Then retry.

 

Edit: Sorry about this :) I'm refining the patching system at the moment. It holds all the code to run on your kodi version and I applied the fix in the wrong file. I do believe this time we should see something different in your log if it fails again.

Edited by Angelblue05
Link to comment
Share on other sites

ddurdle

It looks like those last updates did the trick.  I'm testing two more syncs against two other instances to confirm.  Will report back here when done.  But so far 2 servers passed without errors and 2 more to go.

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...