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]: Server Crash when I try to delete a library #3634

Closed
JBlond opened this issue Nov 21, 2024 · 7 comments
Closed

[Bug]: Server Crash when I try to delete a library #3634

JBlond opened this issue Nov 21, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@JBlond
Copy link
Contributor

JBlond commented Nov 21, 2024

What happened?

The server crashes when I try to delete a library

What did you expect to happen?

The library being deleted

Steps to reproduce the issue

  1. Choose a library
  2. Click on delete

Audiobookshelf version

v2.17.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Chrome

Logs

audiobookshelf  | Config /config /metadata
audiobookshelf  | [2024-11-21 16:26:40.871] INFO: === Starting Server ===
audiobookshelf  | [2024-11-21 16:26:40.880] INFO: [Server] Init v2.17.1
audiobookshelf  | [2024-11-21 16:26:40.881] INFO: [Server] Node.js Version: v20.18.0
audiobookshelf  | [2024-11-21 16:26:40.881] INFO: [Server] Platform: linux
audiobookshelf  | [2024-11-21 16:26:40.882] INFO: [Server] Arch: x64
audiobookshelf  | [2024-11-21 16:26:40.893] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
audiobookshelf  | [2024-11-21 16:26:40.931] INFO: [Database] Loading extension /usr/local/lib/nusqlite3/libnusqlite3.so
audiobookshelf  | [2024-11-21 16:26:40.932] INFO: [Database] Successfully loaded extension /usr/local/lib/nusqlite3/libnusqlite3.so
audiobookshelf  | [2024-11-21 16:26:40.932] INFO: [Database] Db supports unaccent and unicode foldings
audiobookshelf  | [2024-11-21 16:26:40.933] INFO: [Database] Db connection was successful
audiobookshelf  | [2024-11-21 16:26:40.957] INFO: [MigrationManager] Database is already up to date.
audiobookshelf  | [2024-11-21 16:26:41.248] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpiso
de, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackS
ession, feed, feedEpisode, setting, customMetadataProvider, mediaItemShare
audiobookshelf  | [2024-11-21 16:26:55.566] FATAL: [Server] Unhandled rejection: Error
audiobookshelf  |     at Database.<anonymous> (/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)
audiobookshelf  |     at /node_modules/sequelize/lib/dialects/sqlite/query.js:183:50
audiobookshelf  |     at new Promise (<anonymous>)
audiobookshelf  |     at Query.run (/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12)
audiobookshelf  |     at /node_modules/sequelize/lib/sequelize.js:315:28
audiobookshelf  |     at async SQLiteQueryInterface.bulkDelete (/node_modules/sequelize/lib/dialects/abstract/query-interface.js:403:12)
audiobookshelf  |     at async library.destroy (/node_modules/sequelize/lib/model.js:1838:16)
audiobookshelf  |     at async ApiRouter.delete (/server/controllers/LibraryController.js:508:5) {
audiobookshelf  |   name: 'SequelizeForeignKeyConstraintError',
audiobookshelf  |   parent: [Error: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed] {
audiobookshelf  |     errno: 19,
audiobookshelf  |     code: 'SQLITE_CONSTRAINT',
audiobookshelf  |     sql: "DELETE FROM `libraries` WHERE `id` = '69d70105-765c-4f9d-a541-0c3a2858002a'"
audiobookshelf  |   },
audiobookshelf  |   original: [Error: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed] {
audiobookshelf  |     errno: 19,
audiobookshelf  |     code: 'SQLITE_CONSTRAINT',
audiobookshelf  |     sql: "DELETE FROM `libraries` WHERE `id` = '69d70105-765c-4f9d-a541-0c3a2858002a'"
audiobookshelf  |   },
audiobookshelf  |   sql: "DELETE FROM `libraries` WHERE `id` = '69d70105-765c-4f9d-a541-0c3a2858002a'",
audiobookshelf  |   parameters: {},
audiobookshelf  |   table: undefined,
audiobookshelf  |   fields: undefined,
audiobookshelf  |   value: undefined,
audiobookshelf  |   index: undefined,
audiobookshelf  |   reltype: undefined
audiobookshelf  | }
audiobookshelf  | promise: Promise {
audiobookshelf  |   <rejected> Error
audiobookshelf  |       at Database.<anonymous> (/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)
audiobookshelf  |       at /node_modules/sequelize/lib/dialects/sqlite/query.js:183:50
audiobookshelf  |       at new Promise (<anonymous>)
audiobookshelf  |       at Query.run (/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12)
audiobookshelf  |       at /node_modules/sequelize/lib/sequelize.js:315:28
audiobookshelf  |       at async SQLiteQueryInterface.bulkDelete (/node_modules/sequelize/lib/dialects/abstract/query-interface.js:403:12)
audiobookshelf  |       at async library.destroy (/node_modules/sequelize/lib/model.js:1838:16)
audiobookshelf  |       at async ApiRouter.delete (/server/controllers/LibraryController.js:508:5) {
audiobookshelf  |     name: 'SequelizeForeignKeyConstraintError',
audiobookshelf  |     parent: [Error: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed] {
audiobookshelf  |       errno: 19,
audiobookshelf  |       code: 'SQLITE_CONSTRAINT',
audiobookshelf  |       sql: "DELETE FROM `libraries` WHERE `id` = '69d70105-765c-4f9d-a541-0c3a2858002a'"
audiobookshelf  |     },
audiobookshelf  |     original: [Error: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed] {
audiobookshelf  |       errno: 19,
audiobookshelf  |       code: 'SQLITE_CONSTRAINT',
audiobookshelf  |       sql: "DELETE FROM `libraries` WHERE `id` = '69d70105-765c-4f9d-a541-0c3a2858002a'"
audiobookshelf  |     },
audiobookshelf  |     sql: "DELETE FROM `libraries` WHERE `id` = '69d70105-765c-4f9d-a541-0c3a2858002a'",
audiobookshelf  |     parameters: {},
audiobookshelf  |     table: undefined,
audiobookshelf  |     fields: undefined,
audiobookshelf  |     value: undefined,
audiobookshelf  |     index: undefined,
audiobookshelf  |     reltype: undefined
audiobookshelf  |   }
audiobookshelf  | }

Additional Notes

No response

@JBlond JBlond added the bug Something isn't working label Nov 21, 2024
@advplyr
Copy link
Owner

advplyr commented Nov 21, 2024

I can't reproduce this issue. Are you able to share your database or check inside of it for that library?

@advplyr advplyr added waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels Nov 21, 2024
@JBlond
Copy link
Contributor Author

JBlond commented Nov 21, 2024

Can you offer a SQL query? or how do I share my database?

@advplyr
Copy link
Owner

advplyr commented Nov 21, 2024

You can open the database in a database editor and delete the row in the libraries table.

If you want to share the database so it can be investigated you can send it to me on Discord or email. It is the .sqlite file, you can zip it to make it smaller if it is too large to send.

@JBlond
Copy link
Contributor Author

JBlond commented Nov 21, 2024

I sent it via email to you.

@JBlond
Copy link
Contributor Author

JBlond commented Nov 22, 2024

You should have gotten my email.

@advplyr
Copy link
Owner

advplyr commented Nov 22, 2024

Thanks I got it and was able to reproduce the issue. I'm looking into a fix

@advplyr advplyr added awaiting release Issue is resolved and will be in the next release and removed waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels Nov 22, 2024
Copy link

Fixed in v2.17.3.

@github-actions github-actions bot removed the awaiting release Issue is resolved and will be in the next release label Nov 30, 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