[Bug]: Crash When adding new book to library #1377

Closed
opened 2026-04-24 23:42:39 +02:00 by adam · 2 comments
Owner

Originally created by @jt196 on GitHub (Sep 13, 2023).

Describe the issue

Tried to add a new author via match to Audible and I got a crash. Here's the log:

[2023-09-13 09:02:36] WARN: [ApiRouter] Author id "new-1933" does not exist (ApiRouter.js:558)

[2023-09-13 09:02:36] WARN: [ApiRouter] Series id "new-9069" does not exist (ApiRouter.js:595)

node:internal/process/promises:279

            triggerUncaughtException(err, true /* fromPromise */);

            ^

Error

    at Database.<anonymous> (/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)

    at /node_modules/sequelize/lib/dialects/sqlite/query.js:183:50

    at new Promise (<anonymous>)

    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.select (/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:12)

    at async Function.findAll (/node_modules/sequelize/lib/model.js:1140:21)

    at async Function.findOne (/node_modules/sequelize/lib/model.js:1240:12)

    at async Function.getOldByNameAndLibrary (/server/models/Series.js:106:21)

    at async ApiRouter.createAuthorsAndSeriesForItemUpdate (/server/routers/ApiRouter.js:600:30) {

  name: 'SequelizeDatabaseError',

  parent: [Error: SQLITE_ERROR: near "Club": syntax error] {

    errno: 1,

    code: 'SQLITE_ERROR',

    sql: "SELECT `id`, `name`, `nameIgnorePrefix`, `description`, `createdAt`, `updatedAt`, `libraryId` FROM `series` AS `series` WHERE (name = 'Rotters' Club' COLLATE NOCASE AND `series`.`libraryId` = '96cfd553-cc4e-4a9b-9f67-866838eb62d7') LIMIT 1;"

  },

  original: [Error: SQLITE_ERROR: near "Club": syntax error] {

    errno: 1,

    code: 'SQLITE_ERROR',

    sql: "SELECT `id`, `name`, `nameIgnorePrefix`, `description`, `createdAt`, `updatedAt`, `libraryId` FROM `series` AS `series` WHERE (name = 'Rotters' Club' COLLATE NOCASE AND `series`.`libraryId` = '96cfd553-cc4e-4a9b-9f67-866838eb62d7') LIMIT 1;"

  },

  sql: "SELECT `id`, `name`, `nameIgnorePrefix`, `description`, `createdAt`, `updatedAt`, `libraryId` FROM `series` AS `series` WHERE (name = 'Rotters' Club' COLLATE NOCASE AND `series`.`libraryId` = '96cfd553-cc4e-4a9b-9f67-866838eb62d7') LIMIT 1;",

  parameters: {}

}

Steps to reproduce the issue

  1. Match on audible
  2. Save
  3. Exit container, not able to connect to db

Audiobookshelf version

v2.4.1

How are you running audiobookshelf?

Docker

Originally created by @jt196 on GitHub (Sep 13, 2023). ### Describe the issue Tried to add a new author via match to Audible and I got a crash. Here's the log: ```log [2023-09-13 09:02:36] WARN: [ApiRouter] Author id "new-1933" does not exist (ApiRouter.js:558) [2023-09-13 09:02:36] WARN: [ApiRouter] Series id "new-9069" does not exist (ApiRouter.js:595) node:internal/process/promises:279 triggerUncaughtException(err, true /* fromPromise */); ^ Error at Database.<anonymous> (/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27) at /node_modules/sequelize/lib/dialects/sqlite/query.js:183:50 at new Promise (<anonymous>) 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.select (/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:12) at async Function.findAll (/node_modules/sequelize/lib/model.js:1140:21) at async Function.findOne (/node_modules/sequelize/lib/model.js:1240:12) at async Function.getOldByNameAndLibrary (/server/models/Series.js:106:21) at async ApiRouter.createAuthorsAndSeriesForItemUpdate (/server/routers/ApiRouter.js:600:30) { name: 'SequelizeDatabaseError', parent: [Error: SQLITE_ERROR: near "Club": syntax error] { errno: 1, code: 'SQLITE_ERROR', sql: "SELECT `id`, `name`, `nameIgnorePrefix`, `description`, `createdAt`, `updatedAt`, `libraryId` FROM `series` AS `series` WHERE (name = 'Rotters' Club' COLLATE NOCASE AND `series`.`libraryId` = '96cfd553-cc4e-4a9b-9f67-866838eb62d7') LIMIT 1;" }, original: [Error: SQLITE_ERROR: near "Club": syntax error] { errno: 1, code: 'SQLITE_ERROR', sql: "SELECT `id`, `name`, `nameIgnorePrefix`, `description`, `createdAt`, `updatedAt`, `libraryId` FROM `series` AS `series` WHERE (name = 'Rotters' Club' COLLATE NOCASE AND `series`.`libraryId` = '96cfd553-cc4e-4a9b-9f67-866838eb62d7') LIMIT 1;" }, sql: "SELECT `id`, `name`, `nameIgnorePrefix`, `description`, `createdAt`, `updatedAt`, `libraryId` FROM `series` AS `series` WHERE (name = 'Rotters' Club' COLLATE NOCASE AND `series`.`libraryId` = '96cfd553-cc4e-4a9b-9f67-866838eb62d7') LIMIT 1;", parameters: {} } ``` ### Steps to reproduce the issue 1. Match on audible 2. Save 3. Exit container, not able to connect to db ### Audiobookshelf version v2.4.1 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:42:39 +02:00
adam closed this issue 2026-04-24 23:42:40 +02:00
Author
Owner

@jt196 commented on GitHub (Sep 13, 2023):

Thought I'd just check and this fixed it. The series was "The Rotters' Club", I removed the ' from the series and the crash no longer occurs.

@jt196 commented on GitHub (Sep 13, 2023): Thought I'd just check and this fixed it. The series was "The Rotters' Club", I removed the ' from the series and the crash no longer occurs.
Author
Owner

@advplyr commented on GitHub (Sep 13, 2023):

Duplicate of #2070

@advplyr commented on GitHub (Sep 13, 2023): Duplicate of #2070
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1377