Readarr / Readarr

Book Manager and Automation (Sonarr for Ebooks)
http://readarr.com
GNU General Public License v3.0
2.72k stars 150 forks source link

Failed to import book. SourceTitle = [null] #1620

Open djs4000 opened 2 years ago

djs4000 commented 2 years ago

Is there an existing issue for this?

Current Behavior

Books do not get added to readarr after finishing download. Book does show in the activity tab, and progress bar shows 100%

Expected Behavior

Book should be passed back to Readarr from qbittorrent once download is complete.

Steps To Reproduce

Add book, wait for qbittorrent to download, check error logs

Environment

- OS: Ubuntu 20.04
- Readarr: 0.1.0.1248
- Docker Install: no
- Using Reverse Proxy: no
- Browser: Firefox 
- Downloader: qbittorrent 4.1.7

What branch are you running?

Develop

Trace Logs?

2022-04-02 17:59:42.5|Error|EventAggregator|DownloadHistoryService failed while processing [BookImportIncompleteEvent]

[v0.1.0.1248] code = Constraint (19), message = System.Data.SQLite.SQLiteException (0x800027AF): constraint failed NOT NULL constraint failed: DownloadHistory.SourceTitle 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 //Dapper/SqlMapper.cs:line 1075 at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in //Dapper/SqlMapper.cs:line 1058 at NzbDrone.Core.Datastore.BasicRepository1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model) in D:\a\1\s\src\NzbDrone.Core\Datastore\BasicRepository.cs:line 194 at NzbDrone.Core.Datastore.BasicRepository1.Insert(TModel model) in D:\a\1\s\src\NzbDrone.Core\Datastore\BasicRepository.cs:line 152 at NzbDrone.Core.Download.History.DownloadHistoryService.Handle(BookImportIncompleteEvent message) in D:\a\1\s\src\NzbDrone.Core\Download\History\DownloadHistoryService.cs:line 189 at NzbDrone.Core.Messaging.Events.EventAggregator.PublishEvent[TEvent](TEvent event) SQL: ==== Begin Query Trace ====

QUERY TEXT: INSERT INTO DownloadHistory ("EventType", "AuthorId", "DownloadId", "SourceTitle", "Date", "Protocol", "IndexerId", "DownloadClientId", "Release", "Data") VALUES (@EventType, @AuthorId, @DownloadId, @SourceTitle, @Date, @Protocol, @IndexerId, @DownloadClientId, @Release, @Data); SELECT last_insert_rowid() id

PARAMETERS: Id = [0] EventType = ["downloadImportIncomplete"] AuthorId = [11] DownloadId = ["\"B5FA088E1ACAB9AE7A47FAA19BFC42CFACCC7A70\""] SourceTitle = [null] Date = ["2022-04-02T13:59:42.2093615Z"] Protocol = ["torrent"] IndexerId = [0] DownloadClientId = [1] Release = [null] Data = [{ "downloadClient": "qBittorrent", "downloadClientName": "qBit", "statusMessages": "[\n {\n \"title\": \"FreedomTMUnabridgedPart2_mp332.mp3\",\n \"messages\": [\n \"Book match is not close enough: 22.1% vs 80% [author, book]\"\n ]\n },\n {\n \"title\": \"FreedomTMUnabridgedPart1_mp332.mp3\",\n \"messages\": [\n \"Book match is not close enough: 22.1% vs 80% [author, book]\"\n ]\n }\n]" }]

==== End Query Trace ====

AB#2894

bakerboy448 commented 2 years ago

The DB error seems to maybe be a bug.

However, that book will correctly never be imported as the file's tags are not a strong enough match not

Also why is Qbit 4.1.7 being used? That version is extremely old - nearly 3 years - and likely not supported.

djs4000 commented 2 years ago

But that seems a bit weird when it was set to download by Readarr, no? Could Readarr not track which books were sent to the downloader so it knows what to import them as regardless of tags?

bakerboy448 commented 2 years ago

The search blackbox is completely different from the import blackbox.

They intentionally don't talk to each other.

The former is only by the release name and the latter is only by the file's tags.