[Bug]: Unknown column NaN when opening "Add" podcast page, crashes server #2304

Closed
opened 2026-04-25 00:05:54 +02:00 by adam · 3 comments
Owner

Originally created by @nichwall on GitHub (Oct 11, 2024).

What happened?

Using the edge image from commit d258b42e01 (after 2.14.0), I am encountering crashes with a newly created server when navigating to the "add" page in a podcast library as the root user. The crashes occur regardless of whether a podcasts exist in the library or not.

Looks like this may be related to https://github.com/advplyr/audiobookshelf/commit/64b78b5822f5c5410975dfab524c6f3ab09ad5ba moving the limit and page validation to the middleware.

What did you expect to happen?

Able to navigate to "add" page. Functionality is correct in 2.14.0.

Steps to reproduce the issue

  1. Create new server
  2. Navigate to add page

Audiobookshelf version

edge, d258b42e01

How are you running audiobookshelf?

Built from source

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

[2024-10-10 20:45:48.821] FATAL: [Server] Unhandled rejection: Error
    at Database.<anonymous> (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)
    at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:50
    at new Promise (<anonymous>)
    at Query.run (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12)
    at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/sequelize.js:315:28
    at async SQLiteQueryInterface.select (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:12)
    at async podcast.findAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1140:21)
    at async Promise.all (index 1)
    at async podcast.findAndCountAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1322:27)
    at async Object.getFilteredLibraryItems (/home/chell/data/Documents/git/audiobookshelf/server/utils/queries/libraryItemsPodcastFilters.js:156:39) {
  name: 'SequelizeDatabaseError',
  parent: [Error: SQLITE_ERROR: no such column: NaN] {
    errno: 1,
    code: 'SQLITE_ERROR',
    sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;"
  },
  original: [Error: SQLITE_ERROR: no such column: NaN] {
    errno: 1,
    code: 'SQLITE_ERROR',
    sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;"
  },
  sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;",
  parameters: {}
} 
promise: Promise {
  <rejected> Error
      at Database.<anonymous> (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27)
      at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:50
      at new Promise (<anonymous>)
      at Query.run (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12)
      at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/sequelize.js:315:28
      at async SQLiteQueryInterface.select (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:12)
      at async podcast.findAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1140:21)
      at async Promise.all (index 1)
      at async podcast.findAndCountAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1322:27)
      at async Object.getFilteredLibraryItems (/home/chell/data/Documents/git/audiobookshelf/server/utils/queries/libraryItemsPodcastFilters.js:156:39) {
    name: 'SequelizeDatabaseError',
    parent: [Error: SQLITE_ERROR: no such column: NaN] {
      errno: 1,
      code: 'SQLITE_ERROR',
      sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;"
    },
    original: [Error: SQLITE_ERROR: no such column: NaN] {
      errno: 1,
      code: 'SQLITE_ERROR',
      sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;"
    },
    sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;",
    parameters: {}
  }
}

Additional Notes

No response

Originally created by @nichwall on GitHub (Oct 11, 2024). ### What happened? Using the `edge` image from commit d258b42e0144ca6d63e950d9547d363ad075bc7d (after 2.14.0), I am encountering crashes with a newly created server when navigating to the "add" page in a podcast library as the root user. The crashes occur regardless of whether a podcasts exist in the library or not. Looks like this may be related to https://github.com/advplyr/audiobookshelf/commit/64b78b5822f5c5410975dfab524c6f3ab09ad5ba moving the `limit` and `page` validation to the middleware. ### What did you expect to happen? Able to navigate to "add" page. Functionality is correct in 2.14.0. ### Steps to reproduce the issue 1. Create new server 2. Navigate to add page ### Audiobookshelf version edge, d258b42e0144ca6d63e950d9547d363ad075bc7d ### How are you running audiobookshelf? Built from source ### 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 [2024-10-10 20:45:48.821] FATAL: [Server] Unhandled rejection: Error at Database.<anonymous> (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27) at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:50 at new Promise (<anonymous>) at Query.run (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12) at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/sequelize.js:315:28 at async SQLiteQueryInterface.select (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:12) at async podcast.findAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1140:21) at async Promise.all (index 1) at async podcast.findAndCountAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1322:27) at async Object.getFilteredLibraryItems (/home/chell/data/Documents/git/audiobookshelf/server/utils/queries/libraryItemsPodcastFilters.js:156:39) { name: 'SequelizeDatabaseError', parent: [Error: SQLITE_ERROR: no such column: NaN] { errno: 1, code: 'SQLITE_ERROR', sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;" }, original: [Error: SQLITE_ERROR: no such column: NaN] { errno: 1, code: 'SQLITE_ERROR', sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;" }, sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;", parameters: {} } promise: Promise { <rejected> Error at Database.<anonymous> (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:185:27) at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:50 at new Promise (<anonymous>) at Query.run (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/sqlite/query.js:183:12) at /home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/sequelize.js:315:28 at async SQLiteQueryInterface.select (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:12) at async podcast.findAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1140:21) at async Promise.all (index 1) at async podcast.findAndCountAll (/home/chell/data/Documents/git/audiobookshelf/node_modules/sequelize/lib/model.js:1322:27) at async Object.getFilteredLibraryItems (/home/chell/data/Documents/git/audiobookshelf/server/utils/queries/libraryItemsPodcastFilters.js:156:39) { name: 'SequelizeDatabaseError', parent: [Error: SQLITE_ERROR: no such column: NaN] { errno: 1, code: 'SQLITE_ERROR', sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;" }, original: [Error: SQLITE_ERROR: no such column: NaN] { errno: 1, code: 'SQLITE_ERROR', sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;" }, sql: "SELECT `podcast`.`id`, `podcast`.`title`, `podcast`.`titleIgnorePrefix`, `podcast`.`author`, `podcast`.`releaseDate`, `podcast`.`feedURL`, `podcast`.`imageURL`, `podcast`.`description`, `podcast`.`itunesPageURL`, `podcast`.`itunesId`, `podcast`.`itunesArtistId`, `podcast`.`language`, `podcast`.`podcastType`, `podcast`.`explicit`, `podcast`.`autoDownloadEpisodes`, `podcast`.`autoDownloadSchedule`, `podcast`.`lastEpisodeCheck`, `podcast`.`maxEpisodesToKeep`, `podcast`.`maxNewEpisodesToDownload`, `podcast`.`coverPath`, `podcast`.`tags`, `podcast`.`genres`, `podcast`.`createdAt`, `podcast`.`updatedAt`, (SELECT count(*) FROM podcastEpisodes pe WHERE pe.podcastId = podcast.id) AS `numEpisodes`, `libraryItem`.`id` AS `libraryItem.id`, `libraryItem`.`ino` AS `libraryItem.ino`, `libraryItem`.`path` AS `libraryItem.path`, `libraryItem`.`relPath` AS `libraryItem.relPath`, `libraryItem`.`mediaId` AS `libraryItem.mediaId`, `libraryItem`.`mediaType` AS `libraryItem.mediaType`, `libraryItem`.`isFile` AS `libraryItem.isFile`, `libraryItem`.`isMissing` AS `libraryItem.isMissing`, `libraryItem`.`isInvalid` AS `libraryItem.isInvalid`, `libraryItem`.`mtime` AS `libraryItem.mtime`, `libraryItem`.`ctime` AS `libraryItem.ctime`, `libraryItem`.`birthtime` AS `libraryItem.birthtime`, `libraryItem`.`size` AS `libraryItem.size`, `libraryItem`.`lastScan` AS `libraryItem.lastScan`, `libraryItem`.`lastScanVersion` AS `libraryItem.lastScanVersion`, `libraryItem`.`libraryFiles` AS `libraryItem.libraryFiles`, `libraryItem`.`extraData` AS `libraryItem.extraData`, `libraryItem`.`createdAt` AS `libraryItem.createdAt`, `libraryItem`.`updatedAt` AS `libraryItem.updatedAt`, `libraryItem`.`libraryId` AS `libraryItem.libraryId`, `libraryItem`.`libraryFolderId` AS `libraryItem.libraryFolderId` FROM `podcasts` AS `podcast` INNER JOIN `libraryItems` AS `libraryItem` ON `podcast`.`id` = `libraryItem`.`mediaId` AND (`libraryItem`.`libraryId` = 'b4d22d4e-7738-4b98-a16a-419c21cbfec9' AND `libraryItem`.`mediaType` = 'podcast') WHERE 1=1 LIMIT NaN, 10000000000000;", parameters: {} } } ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:05:54 +02:00
adam closed this issue 2026-04-25 00:05:54 +02:00
Author
Owner

@advplyr commented on GitHub (Oct 12, 2024):

Nice find on this one. I saw that the podcast add page was making an inefficient API call to load all podcast library items in order to detect which podcasts are already added.

I added an API endpoint to only fetch the required data for podcasts but this might be better handled in the podcast search API endpoint. Having a special API endpoint for just that scenario seems like a sub-optimal solution. I figure once the API starts getting improved we'll have a better idea on how best to handle that.

@advplyr commented on GitHub (Oct 12, 2024): Nice find on this one. I saw that the podcast add page was making an inefficient API call to load all podcast library items in order to detect which podcasts are already added. I added an API endpoint to only fetch the required data for podcasts but this might be better handled in the podcast search API endpoint. Having a special API endpoint for just that scenario seems like a sub-optimal solution. I figure once the API starts getting improved we'll have a better idea on how best to handle that.
Author
Owner

@nichwall commented on GitHub (Oct 12, 2024):

Ah, thanks for looking into that. Yeah, after I started investigating I had the thought of "why is the add page even making a request", but that makes sense.

@nichwall commented on GitHub (Oct 12, 2024): Ah, thanks for looking into that. Yeah, after I started investigating I had the thought of "why is the add page even making a request", but that makes sense.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 12, 2024):

Fixed in v2.15.0.

@github-actions[bot] commented on GitHub (Oct 12, 2024): Fixed in [v2.15.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.15.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2304