DB migration failed after upgrade to 9.0.13
-
Description
After upgrade from 8 to 9.0.13 dashboard not working. With the hep of other post, I noticed my tasks table doesn't have completed column, so adding it manually solved the issue with dashboard not loading.
Steps to reproduce
After running troubleshoot script:
[FAIL] Database migrations are pending. Last migration in DB: /20250618200400-fix-charset-collate.js. Last migration file: /20251110084515-cloudflare-add-defaultProxyStatus.js.
Please run 'cloudron-support --apply-db-migrations' to apply the migrations.After running --apply-db-migrations:
Logs
[ERROR] AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Duplicate entry '20647655-d757-412a-8a67-3b6ff3d224a3-oidc' for key 'oidcClients.PRIMARY'
at /home/yellowtent/box/node_modules/db-migrate/lib/commands/on-complete.js:15:14
at tryCatcher (/home/yellowtent/box/node_modules/bluebird/js/release/util.js:16:23)
at Promise.successAdapter (/home/yellowtent/box/node_modules/bluebird/js/release/nodeify.js:22:30)
at Promise._settlePromise (/home/yellowtent/box/node_modules/bluebird/js/release/promise.js:601:21)
at Promise._settlePromiseCtx (/home/yellowtent/box/node_modules/bluebird/js/release/promise.js:641:10)
at _drainQueueStep (/home/yellowtent/box/node_modules/bluebird/js/release/async.js:97:12)
at _drainQueue (/home/yellowtent/box/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/yellowtent/box/node_modules/bluebird/js/release/async.js:102:5)
at Async.drainQueues [as _onImmediate] (/home/yellowtent/box/node_modules/bluebird/js/release/async.js:15:14)
at process.processImmediate (node:internal/timers:485:21)
at Packet.asError (/home/yellowtent/box/node_modules/mysql2/lib/packets/packet.js:740:17)
at Query.execute (/home/yellowtent/box/node_modules/mysql2/lib/commands/command.js:29:26)
at Connection.handlePacket (/home/yellowtent/box/node_modules/mysql2/lib/base/connection.js:477:34)
at PacketParser.onPacket (/home/yellowtent/box/node_modules/mysql2/lib/base/connection.js:93:12)
at PacketParser.executeStart (/home/yellowtent/box/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (/home/yellowtent/box/node_modules/mysql2/lib/base/connection.js
25)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
2025-12-07T16:47:15 ==> start: DB migration failed
[FAIL] Database migrations failedCloudron Version
9.0.13
-
Changing the database schema manually is usually always a bad idea. It becomes very hard to apply the database migration scripts which have to be run one-after-the-other and with manual changes it is unknown at which schema state the database is and if subsequent migrations can work.
Do you know exactly which SQL query you ran manually to update the schema? If so ideally revert that and run db migration script again. It probably will just show the same error as before, so we can work from that on.
Duplicate entry '20647655-d757-412a-8a67-3b6ff3d224a3-oidc' for key 'oidcClients.PRIMARY'it seems like you have duplicate records in theoidcClientstable. Can you run:mysql -uroot -ppassword box -e "SELECT * from oidcClients"Then find the duplicates and remove one of them. Then rerun the migration script again.