[Bug]: SQLITE_ERROR: no such column: size #2934

Closed
opened 2026-04-25 00:11:57 +02:00 by adam · 2 comments
Owner

Originally created by @dinjarin007 on GitHub (Aug 7, 2025).

What happened?

Upgrading from 2.14 to latest fails when migrating at 2.17.7. Container stops

What did you expect to happen?

Upgrade should be successfully and container boots up

Steps to reproduce the issue

  1. Upgrade container from 2.14.* to latest 2.27.0

Audiobookshelf version

v2.27.0

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?

None

Logs

[2025-08-07 12:28:15.362] INFO: { event: 'migrating', name: 'v2.17.7-add-indices.js' }
[2025-08-07 12:28:15.362] INFO: [2.17.7 migration] UPGRADE BEGIN: 2.17.7-add-indices
[2025-08-07 12:28:15.362] INFO: [2.17.7 migration] adding index [libraryId, mediaType, size] to table "libraryItems"
[2025-08-07 12:28:15.615] INFO: [MigrationManager] Saved the failed database as absdatabase.failed.sqlite.
[2025-08-07 12:28:15.617] INFO: [MigrationManager] Restored the original database from the backup.
[2025-08-07 12:28:15.617] INFO: [MigrationManager] Migration failed. Exiting Audiobookshelf with code 1.
[2025-08-07 12:28:15.366] ERROR: [MigrationManager] Migration failed: MigrationError: Migration v2.17.7-add-indices.js (up) failed: Original error: SQLITE_ERROR: no such column: size
    at /app/server/libs/umzug/umzug.js:150:17
    at async Umzug.runCommand (/app/server/libs/umzug/umzug.js:112:12)
    at async MigrationManager.runMigrations (/app/server/managers/MigrationManager.js:102:9)
    at async Database.init (/app/server/Database.js:194:7)
    at async Server.init (/app/server/Server.js:158:5)
    at async Server.start (/app/server/Server.js:222:5) {
  migration: {
    direction: 'up',
    name: 'v2.17.7-add-indices.js',
    path: '/config/migrations/v2.17.7-add-indices.js',
    context: { queryInterface: [SQLiteQueryInterface], logger: [Logger] }
  },
  [cause]: Error
      at Database.<anonymous> (/app/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)
      at /app/node_modules/sequelize/lib/dialects/sqlite/query.js:183:50
      at new Promise (<anonymous>)
      at Query.run (/app/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12)
      at /app/node_modules/sequelize/lib/sequelize.js:315:28
      at async SQLiteQueryInterface.addIndex (/app/node_modules/sequelize/lib/dialects/abstract/query-interface.js:250:12)
      at async addIndex (/app/server/migrations/v2.17.7-add-indices.js:57:5)
      at async Object.up (/app/server/migrations/v2.17.7-add-indices.js:24:3)
      at async /app/server/libs/umzug/umzug.js:148:11
      at async Umzug.runCommand (/app/server/libs/umzug/umzug.js:112:12) {
    name: 'SequelizeDatabaseError',
    parent: [Error: SQLITE_ERROR: no such column: size] {
      errno: 1,
      code: 'SQLITE_ERROR',
      sql: 'CREATE INDEX `library_items_library_id_media_type_size` ON `libraryItems` (`libraryId`, `mediaType`, `size`)'
    },
    original: [Error: SQLITE_ERROR: no such column: size] {
      errno: 1,
      code: 'SQLITE_ERROR',
      sql: 'CREATE INDEX `library_items_library_id_media_type_size` ON `libraryItems` (`libraryId`, `mediaType`, `size`)'
    },
    sql: 'CREATE INDEX `library_items_library_id_media_type_size` ON `libraryItems` (`libraryId`, `mediaType`, `size`)',
    parameters: {}
  }
}

Additional Notes

No response

Originally created by @dinjarin007 on GitHub (Aug 7, 2025). ### What happened? Upgrading from 2.14 to latest fails when migrating at 2.17.7. Container stops ### What did you expect to happen? Upgrade should be successfully and container boots up ### Steps to reproduce the issue 1. Upgrade container from 2.14.* to latest 2.27.0 ### Audiobookshelf version v2.27.0 ### 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? None ### Logs ```shell [2025-08-07 12:28:15.362] INFO: { event: 'migrating', name: 'v2.17.7-add-indices.js' } [2025-08-07 12:28:15.362] INFO: [2.17.7 migration] UPGRADE BEGIN: 2.17.7-add-indices [2025-08-07 12:28:15.362] INFO: [2.17.7 migration] adding index [libraryId, mediaType, size] to table "libraryItems" [2025-08-07 12:28:15.615] INFO: [MigrationManager] Saved the failed database as absdatabase.failed.sqlite. [2025-08-07 12:28:15.617] INFO: [MigrationManager] Restored the original database from the backup. [2025-08-07 12:28:15.617] INFO: [MigrationManager] Migration failed. Exiting Audiobookshelf with code 1. [2025-08-07 12:28:15.366] ERROR: [MigrationManager] Migration failed: MigrationError: Migration v2.17.7-add-indices.js (up) failed: Original error: SQLITE_ERROR: no such column: size at /app/server/libs/umzug/umzug.js:150:17 at async Umzug.runCommand (/app/server/libs/umzug/umzug.js:112:12) at async MigrationManager.runMigrations (/app/server/managers/MigrationManager.js:102:9) at async Database.init (/app/server/Database.js:194:7) at async Server.init (/app/server/Server.js:158:5) at async Server.start (/app/server/Server.js:222:5) { migration: { direction: 'up', name: 'v2.17.7-add-indices.js', path: '/config/migrations/v2.17.7-add-indices.js', context: { queryInterface: [SQLiteQueryInterface], logger: [Logger] } }, [cause]: Error at Database.<anonymous> (/app/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27) at /app/node_modules/sequelize/lib/dialects/sqlite/query.js:183:50 at new Promise (<anonymous>) at Query.run (/app/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12) at /app/node_modules/sequelize/lib/sequelize.js:315:28 at async SQLiteQueryInterface.addIndex (/app/node_modules/sequelize/lib/dialects/abstract/query-interface.js:250:12) at async addIndex (/app/server/migrations/v2.17.7-add-indices.js:57:5) at async Object.up (/app/server/migrations/v2.17.7-add-indices.js:24:3) at async /app/server/libs/umzug/umzug.js:148:11 at async Umzug.runCommand (/app/server/libs/umzug/umzug.js:112:12) { name: 'SequelizeDatabaseError', parent: [Error: SQLITE_ERROR: no such column: size] { errno: 1, code: 'SQLITE_ERROR', sql: 'CREATE INDEX `library_items_library_id_media_type_size` ON `libraryItems` (`libraryId`, `mediaType`, `size`)' }, original: [Error: SQLITE_ERROR: no such column: size] { errno: 1, code: 'SQLITE_ERROR', sql: 'CREATE INDEX `library_items_library_id_media_type_size` ON `libraryItems` (`libraryId`, `mediaType`, `size`)' }, sql: 'CREATE INDEX `library_items_library_id_media_type_size` ON `libraryItems` (`libraryId`, `mediaType`, `size`)', parameters: {} } } ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:11:57 +02:00
adam closed this issue 2026-04-25 00:11:57 +02:00
Author
Owner

@nichwall commented on GitHub (Aug 7, 2025):

There have been database migration issues when jumping that many versions. Try upgrading a few versions at a time until you are at 2.27.0

@nichwall commented on GitHub (Aug 7, 2025): There have been database migration issues when jumping that many versions. Try upgrading a few versions at a time until you are at 2.27.0
Author
Owner

@dinjarin007 commented on GitHub (Aug 8, 2025):

@nichwall That worked. I upgraded in 5 minor version increments. Thanks.

@dinjarin007 commented on GitHub (Aug 8, 2025): @nichwall That worked. I upgraded in 5 minor version increments. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2934