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

[Bug]: Crash when matching a book and the author name ends in a comma #2796

Closed
gardiol opened this issue Mar 28, 2024 · 4 comments
Closed

[Bug]: Crash when matching a book and the author name ends in a comma #2796

gardiol opened this issue Mar 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@gardiol
Copy link

gardiol commented Mar 28, 2024

Describe the issue

[audiobookshelf] | [2024-03-28 11:32:09.558] INFO: Listening on port :80
[audiobookshelf] | [2024-03-28 11:32:09.593] INFO: [Watcher] "Podcasts" Ready
[audiobookshelf] | [2024-03-28 11:32:09.700] INFO: [Watcher] "Audiolibri" Ready
[audiobookshelf] | [2024-03-28 11:32:20.777] INFO: [CoverManager] Downloaded libraryItem cover "/audiobooks/Casa Surace/cover.jpg" from url "https://books.google.com/books/content?id=OGx2Dwprintsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api" for "Quest'anno non scendo"
[2024-03-28 11:32:20.786] ERROR: [ApiRouter] Invalid author object, no name { id: 'new-3401', name: '' } (ApiRouter.js:533)
[2024-03-28 11:32:20.840] FATAL: [Server] Unhandled rejection: SequelizeForeignKeyConstraintError: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed, promise: Promise {
Error
at Database. (/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)
at /node_modules/sequelize/lib/dialects/sqlite/query.js:183:50
at new Promise ()
at Query.run (/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12)
at /node_modules/sequelize/lib/sequelize.js:315:28
at async SQLiteQueryInterface.insert (/node_modules/sequelize/lib/dialects/abstract/query-interface.js:308:21)
at async BookAuthor.save (/node_modules/sequelize/lib/model.js:2490:35)
at async bookAuthor.create (/node_modules/sequelize/lib/model.js:1362:12)
at async libraryItem.fullUpdateFromOld (/server/models/LibraryItem.js:330:13)
at async Database.updateLibraryItem (/server/Database.js:430:21) {
name: 'SequelizeForeignKeyConstraintError',
parent: [Error: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed] {
errno: 19,
code: 'SQLITE_CONSTRAINT',
sql: 'INSERT INTO bookAuthors (id,createdAt,bookId,authorId) VALUES ($1,$2,$3,$4);'
},
original: [Error: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed] {
errno: 19,
code: 'SQLITE_CONSTRAINT',
sql: 'INSERT INTO bookAuthors (id,createdAt,bookId,authorId) VALUES ($1,$2,$3,$4);'
},
sql: 'INSERT INTO bookAuthors (id,createdAt,bookId,authorId) VALUES ($1,$2,$3,$4);',
parameters: {},
table: undefined,
fields: undefined,
value: undefined,
index: undefined,
reltype: undefined
}
} (Server.js:164)
exit code: 1

Steps to reproduce the issue

Edit book, search for book details, import them. ABS will crash with above log failing the import.

the book is "Quest'anno non scendo" ISBN 9788893427623

Audiobookshelf version

v2.8.1

How are you running audiobookshelf?

Docker

@gardiol gardiol added the bug Something isn't working label Mar 28, 2024
@advplyr
Copy link
Owner

advplyr commented Mar 28, 2024

What provider are you using to search for book details?

@advplyr advplyr added the awaiting release Issue is resolved and will be in the next release label Mar 28, 2024
@advplyr advplyr changed the title [Bug]: crash on Invalid author object, no name [Bug]: Crash when matching a book and the author name ends in a comma Mar 28, 2024
@advplyr
Copy link
Owner

advplyr commented Mar 28, 2024

I found the issue and fixed for the next release. It had to do with this trailing comma that google books provider was returning.

image

@gardiol
Copy link
Author

gardiol commented Mar 29, 2024

I see! Thank you! i will clean the coma then.
Yes i am using Google Books

@gardiol gardiol closed this as completed Mar 29, 2024
@advplyr
Copy link
Owner

advplyr commented Apr 22, 2024

Fixed in v2.9.0

@advplyr advplyr removed the awaiting release Issue is resolved and will be in the next release label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants