cross-seed
cross-seed copied to clipboard
database is locked
I have gotten this error a lot lately though I have made a config error in the conf. so I made a new one. But the error was back
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 21)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 24)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 27)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 30)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 33)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 36)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 39)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 42)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 45)
(node:1) UnhandledPromiseRejectionWarning: SqliteError: select last_run from job_log where name = 'search' limit 1 - database is locked
at Statement.all (<anonymous>)
at Client_BetterSQLite3._query (/usr/src/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:34:40)
at executeQuery (/usr/src/app/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/src/app/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/src/app/node_modules/knex/lib/execution/runner.js:130:36)
at ensureConnectionCallback (/usr/src/app/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:13:17)
at Runner.ensureConnection (/usr/src/app/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/src/app/node_modules/knex/lib/execution/runner.js:30:19)
at async Timeout.loop [as _onTimeout] (file:///usr/src/app/dist/jobs.js:43:36)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 48)`
and fyi, i don't get a config.js when starting the container first time, it comes and disapear :-/
Are you running multiple instances of cross-seed at the same time?
No im only running one in docker
I have this although $ ps aux |grep cross root 2479157 0.0 0.0 11435328 18844 ? Ssl Jul09 0:45 node /usr/local/bin/cross-seed daemon`
looks like that might be the culprit. Try killing that
It came back after killing it
and got this in cross-seed log
today at 19:27:59Configuration file already exists. today at 19:27:59info: Validating your configuration... today at 19:27:59info: Your configuration is valid! today at 19:27:59info: [server] Server is running on port 2468, ^C to stop.
so that line is tied to the docker it seems
cross-seed - https://hub.docker.com/r/mmgoodnow/cross-seed
cross-seed: container_name: cross-seed image: mmgoodnow/cross-seed:latest restart: unless-stopped logging: driver: json-file options: max-file: ${DOCKERLOGGING_MAXFILE} max-size: ${DOCKERLOGGING_MAXSIZE} ports: - 2468:2468 depends_on: - prowlarr - qbittorrent environment: - PUID=${PUID} - PGID=${GUID} - UMASK=${UMASK} - TZ=${TZ} volumes: - ${BASE_DOCKER_DATA_PATH}/cross-seed/config:/config - ${BASE_DOCKER_DATA_PATH}/qbittorrent/config/data/BT_backup:/input:ro - ${BASE_DATA_LOCAL_PATH}:/downloads command: daemon labels: - org.hotio.pullio.notify=${PULLIO_NOTIFY} - org.hotio.pullio.update=${PULLIO_UPDATE} - org.hotio.pullio.generic.webhook=${PULLIO_GENERIC_WEBHOOK} - org.hotio.pullio.author.avatar=${CROSS_AUTHOR_AVATAR} - "org.hotio.pullio.author.url={"link": "${CROSS_AUTHOR_URL}", "label": "${AUTHOR_LABEL}"}"
can you try these steps?
first, stop the docker container. Then, cd into cross-seed's config dir. After that, here are some things to check:
- That you don't have a hung process sitting on the file (unix:
$ fuser cross-seed.dbshould say nothing) - There isn't a
cross-seed.db-journalfile in the directory withcross-seed.db; this would indicate a crashed session that hasn't been cleaned up properly. - Ask the database shell to check itself:
$ sqlite3 cross-seed.db "pragma integrity_check;" - Backup the database
$ sqlite3 cross-seed.db ".backup cross-seed.db.bak" - See if the backup works
$ sqlite3 cross-seed.db.bak ".schema"
fuser cross-seed.db = output empty
sqlite3 cross-seed.db "pragma integrity_check;" = ok
sqlite3 cross-seed.db ".backup cross-seed.db.bak" = Error: cannot open "cross-seed.db.bak"
sqlite3 cross-seed.db.bak ".schema" = Error: unable to open database "cross-seed.db.bak": unable to open database file
Can you post your config (redacting relevant parts)? I'm somewhat out of ideas
https://pastebin.com/kDKmiLYc
is there anything else that's weird about your setup? network file shares, maybe?
Can't take lock to run migrations: update knex_migrations_lock set is_locked = 1 where is_locked = 0 - unable to open database file
11
If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock'
10
/usr/src/cross-seed/node_modules/knex/lib/migrations/migrate/Migrator.js:342
9
throw new LockError(err.message);
8
^
7
6
MigrationLocked: update knex_migrations_lock set is_locked = 1 where is_locked = 0 - unable to open database file
5
at /usr/src/cross-seed/node_modules/knex/lib/migrations/migrate/Migrator.js:342:13
4
at async Migrator._runBatch (/usr/src/cross-seed/node_modules/knex/lib/migrations/migrate/Migrator.js:358:7)
3
at async Command.
I'm seeing this too. Mostly when I Ctrl-C to stop the program. One time I had a .journal file in my config dir, and another time I didn't
/usr/local/lib/node_modules/cross-seed/node_modules/better-sqlite3/lib/methods/wrappers.js:5
return this[cppdb].prepare(sql, this, false);
^
SqliteError: select * from sqlite_master where type = 'table' and name = 'knex_migrations' - database is locked
at Database.prepare (/usr/local/lib/node_modules/cross-seed/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
at Client_BetterSQLite3._query (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/dialects/better-sqlite3/index.js:30:34)
at executeQuery (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
at Client_BetterSQLite3.query (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/client.js:146:12)
at Runner.query (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/execution/runner.js:130:36)
at Runner.queryArray (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/execution/runner.js:224:21)
at ensureConnectionCallback (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:11:19)
at Runner.ensureConnection (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/execution/runner.js:307:20)
at async Runner.run (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/execution/runner.js:30:19)
at async listCompleted (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/migrations/migrate/migration-list-resolver.js:12:3) {
code: 'SQLITE_BUSY'
}
Can't take lock to run migrations: Migration table is already locked
If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock'
/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/migrations/migrate/Migrator.js:342
throw new LockError(err.message);
^
MigrationLocked: Migration table is already locked
at /usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/migrations/migrate/Migrator.js:342:13
at async Migrator._runBatch (/usr/local/lib/node_modules/cross-seed/node_modules/knex/lib/migrations/migrate/Migrator.js:358:7)
at async Command.<anonymous> (file:///usr/local/lib/node_modules/cross-seed/dist/cmd.js:166:9)
at async Command.parseAsync (/usr/local/lib/node_modules/cross-seed/node_modules/commander/lib/command.js:923:5)
at async file:///usr/local/lib/node_modules/cross-seed/dist/cmd.js:177:1
this is tentatively fixed in #341
- database acquireConnectionTimeout increased
- WAL mode enabled