bazarr icon indicating copy to clipboard operation
bazarr copied to clipboard

Unique constraint failures

Open silverbullettruck2001 opened this issue 4 months ago • 1 comments

I am receiving the following error when Bazarr is trying to sync up with Sonarr. I am on Bazarr 1.4.1 and Sonarr 4.0.1.929

BAZARR cannot insert series /tv/Darkwing Duck because of (sqlite3.IntegrityError) UNIQUE constraint failed: table_shows.sonarrSeriesId [SQL: INSERT INTO table_shows ("tvdbId", "alternativeTitles", audio_language, fanart, "imdbId", monitored, overview, path, poster, "profileId", "seriesType", "sonarrSeriesId", "sortTitle", tags, title, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] [parameters: (75475, '[]', '[]', '/MediaCover/32/fanart.jpg', 'tt0101076', 'False', 'In the city of St. Canard, the people are plagued by the most bizarre criminals, but they have a protector as well, Darkwing Duck. This bumbling and ... (6 characters truncated) ... tical superhero battles evil in that fair city with the help of his pilot sidekick, Launchpad McQuack and his rambunctious adopted daughter, Gosalyn.', '/tv/Darkwing Duck', '/MediaCover/32/poster-250.jpg', 1, 'standard', 32, 'darkwing duck', '[]', 'Darkwing Duck', '1991')] (Background on this error at: https://sqlalche.me/e/20/gkpj)

It's happening on multiple shows without a discernable pattern. Any ideas on what is causing this or how to resolve it?

Thanks

silverbullettruck2001 avatar Feb 10 '24 17:02 silverbullettruck2001

You probably restarted Sonarr from scratch without doing the same for Bazarr. Bazarr already has another shows with that unique ID from Sonarr and it doesn't match with the one provided by Sonarr during sync.

morpheus65535 avatar Feb 10 '24 22:02 morpheus65535

No news, good news!

morpheus65535 avatar Mar 08 '24 18:03 morpheus65535

what is the Fix ?

Dudleydogg avatar Apr 19 '24 21:04 Dudleydogg

what is the Fix ?

Do not reuse an existing Bazarr instance when you restart Sonarr/Radarr from scratch.

morpheus65535 avatar Apr 19 '24 21:04 morpheus65535

OK did not do that sonarr/radarr running for years just now rebuilt bazar from scratch although I did bring over the yaml config

Dudleydogg avatar Apr 19 '24 21:04 Dudleydogg

BAZARR cannot insert series \nas10g.spiritlake.us\MultiMedia\Television\New Amsterdam (2018) because of (sqlite3.IntegrityError) UNIQUE constraint failed: table_shows.sonarrSeriesId [SQL: INSERT INTO table_shows ("tvdbId", "alternativeTitles", audio_language, fanart, "imdbId", monitored, overview, path, poster, "profileId", "seriesType", "sonarrSeriesId", "sortTitle", tags, title, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] [parameters: (349272, "['New Amsterdam', 'New Amsterdam', 'New Amsterdam (2019)', 'New Amsterdam']", "['English']", '/sonarr/MediaCover/169/fanart.jpg', 'tt7817340', 'True', "A new medical director breaks the rules to heal the system at America's oldest public hospital.", '\\nas10g.spiritlake.us\MultiMedia\Television\New Amsterdam (2018)', '/sonarr/MediaCover/169/poster-250.jpg', None, 'standard', 169, 'new amsterdam 2018', '[]', 'New Amsterdam (2018)', '2018')] (Background on this error at: https://sqlalche.me/e/20/gkpj)

Dudleydogg avatar Apr 19 '24 21:04 Dudleydogg

previous was working just not for Radarr so updated Bazar did not work with config so ditched started anew.

Dudleydogg avatar Apr 19 '24 21:04 Dudleydogg

Sonarr is trying to add a new series with an ID that's already present in database.

morpheus65535 avatar Apr 19 '24 22:04 morpheus65535

the Bazar DB is new, sonarr is not. should I nuke the bazar db or something ? technically I just did with clean install?

Dudleydogg avatar Apr 19 '24 22:04 Dudleydogg

Did you empty the config directory when you've reinstalled? You can stop Bazarr and delete the content of the config/db directory. You're going to have to recreate your languages profiles and assign them to series and movies when the whole indexing is completed. Other than that, notifications providers may need to be reconfigured.

morpheus65535 avatar Apr 20 '24 00:04 morpheus65535

Did you empty the config directory when you've reinstalled? You can stop Bazarr and delete the content of the config/db directory. You're going to have to recreate your languages profiles and assign them to series and movies when the whole indexing is completed. Other than that, notifications providers may need to be reconfigured.

Yes and now everything is working, was my bad, I cleaned up like you described above and now its working perfect. I just have notifications left. Was a big change from the version I had to this one, way better working great now, thank you very much for the pointers.

Dudleydogg avatar Apr 21 '24 16:04 Dudleydogg