Radarr: UNIQUE constraint failed: AlternativeTitles.CleanTitle

Created on 18 Dec 2019  路  8Comments  路  Source: Radarr/Radarr

Debug logs:

19-12-17 23:17:58.6|Info|RefreshMovieService|Updating Info for The Village
19-12-17 23:17:58.9|Info|RefreshMovieService|Unable to communicate with Mappings Server.

[v3.0.0.2319] code = Constraint (19), message = System.Data.SQLite.SQLiteException (0x800027AF): constraint failed
UNIQUE constraint failed: AlternativeTitles.CleanTitle
   at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in C:\projects\dapper\Dapper\SqlMapper.cs:line 1060
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in C:\projects\dapper\Dapper\SqlMapper.cs:line 1043
   at Dapper.SqlMapper.QueryMultiple(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in C:\projects\dapper\Dapper\SqlMapper.cs:line 996
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model)
   at NzbDrone.Core.Datastore.BasicRepository`1.InsertMany(IList`1 models)
   at NzbDrone.Core.Movies.AlternativeTitles.AlternativeTitleService.UpdateTitles(List`1 titles, Movie movie)
   at NzbDrone.Core.Movies.RefreshMovieService.RefreshMovieInfo(Movie movie)

19-12-17 23:17:58.9|Info|MediaCoverService|Testing: NzbDrone.Core.Messaging.Commands.CommandQueueManager, 2236

And another one:

19-12-17 23:17:43.0|Info|RefreshMovieService|Updating Info for Unbreakable
19-12-17 23:17:43.2|Info|RefreshMovieService|Unable to communicate with Mappings Server.

[v3.0.0.2319] code = Constraint (19), message = System.Data.SQLite.SQLiteException (0x800027AF): constraint failed
UNIQUE constraint failed: AlternativeTitles.CleanTitle
   at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in C:\projects\dapper\Dapper\SqlMapper.cs:line 1060
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in C:\projects\dapper\Dapper\SqlMapper.cs:line 1043
   at Dapper.SqlMapper.QueryMultiple(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in C:\projects\dapper\Dapper\SqlMapper.cs:line 996
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model)
   at NzbDrone.Core.Datastore.BasicRepository`1.InsertMany(IList`1 models)
   at NzbDrone.Core.Movies.AlternativeTitles.AlternativeTitleService.UpdateTitles(List`1 titles, Movie movie)
   at NzbDrone.Core.Movies.RefreshMovieService.RefreshMovieInfo(Movie movie)

19-12-17 23:17:43.2|Info|MediaCoverService|Testing: NzbDrone.Core.Messaging.Commands.CommandQueueManager, 2398
19-12-17 23:17:43.2|Info|DiskScanService|Scanning disk for Unbreakable
19-12-17 23:17:43.2|Info|DiskScanService|Completed scanning disk for Unbreakable
bug confirmed v3

Most helpful comment

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.92. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 8 comments

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.92. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Might need to pull this from the develop branch

https://github.com/Radarr/Radarr/commit/8e43f5c4ae5d6d339775e9a69ab5f1f9b01b293b

Edit: that commit already appears in aphrodite.

I suppose this could happen either due to the strict UNIQUE on cleantitle creating interference between two movies, or due to a single movie having multiple titles that come out to the same cleantitle.

Probably need to cover both situations:

  • For first likely need a migration, something like this
Delete.UniqueConstraint().FromTable("AlternativeTitles").Column("CleanTitle");
Create.UniqueConstraint("MovieIdandTitle").OnTable("AlternativeTitles").Columns("MovieId", "CleanTitle");
  • For second will have to do some de-duplication before writing to DB if we don't already.

This issue has been automatically marked as stale because it has not had recent activity. Please verify that this is still an issue with the latest version of Radarr and report back. Otherwise this issue will be closed.

Error occurred while executing task RefreshMovie: constraint failed UNIQUE constraint failed: AlternativeTitles.CleanTitle Exception code = Constraint (19), message = System.Data.SQLite.SQLiteException (0x800027AF): constraint failed UNIQUE constraint failed: AlternativeTitles.CleanTitle at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt) at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt) at System.Data.SQLite.SQLiteDataReader.NextResult() at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave) at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior) at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in C:\projects\dapper\Dapper\SqlMapper.cs:line 1060 at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in C:\projects\dapper\Dapper\SqlMapper.cs:line 1043 at Dapper.SqlMapper.QueryMultiple(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable1 commandTimeout, Nullable1 commandType) in C:\projects\dapper\Dapper\SqlMapper.cs:line 996 at NzbDrone.Core.Datastore.BasicRepository1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model) in d:\a\1\s\src\NzbDrone.Core\Datastore\BasicRepository.cs:line 204
at NzbDrone.Core.Datastore.BasicRepository1.InsertMany(IList1 models) in d:\a\1\s\src\NzbDrone.Core\Datastore\BasicRepository.cs:line 218
at NzbDrone.Core.Movies.AlternativeTitles.AlternativeTitleService.UpdateTitles(List1 titles, Movie movie) in d:\a\1\s\src\NzbDrone.Core\Movies\AlternativeTitles\AlternativeTitleService.cs:line 96 at NzbDrone.Core.Movies.RefreshMovieService.RefreshMovieInfo(Movie movie) in d:\a\1\s\src\NzbDrone.Core\Movies\RefreshMovieService.cs:line 157 at NzbDrone.Core.Movies.RefreshMovieService.Execute(RefreshMovieCommand message) in d:\a\1\s\src\NzbDrone.Core\Movies\RefreshMovieService.cs:line 215 at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand](TCommand command, CommandModel commandModel) in d:\a\1\s\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:line 119 at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2) at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands() in d:\a\1\s\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:line 44

Sentry issue: RADARR-M

Sentry issue: RADARR-1S

Fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jipjan picture jipjan  路  3Comments

christronyxyocum picture christronyxyocum  路  3Comments

plexecutor picture plexecutor  路  3Comments

mattman86 picture mattman86  路  3Comments

scope999 picture scope999  路  3Comments