Ghost: Knex Error knew migration, ERROR Empty .update() call detected, last docker image

Created on 2 Jul 2020  路  7Comments  路  Source: TryGhost/Ghost

Issue Summary

Migration failed on last docker image

To Reproduce

I just updated the image, the db migration failed during the process

ERROR Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query. Table: settings. Columns: value.
7/2/2020 2:27:07 PM 
7/2/2020 2:27:07 PM Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query. Table: settings. Columns: value.
7/2/2020 2:27:07 PM 
7/2/2020 2:27:07 PM {"config":{"transaction":true},"name":"05-migrate-members-subscription-settings.js"}
7/2/2020 2:27:07 PM "Error occurred while executing the following migration: 05-migrate-members-subscription-settings.js"
7/2/2020 2:27:07 PM 
7/2/2020 2:27:07 PM Error ID:
7/2/2020 2:27:07 PM     300
7/2/2020 2:27:07 PM 
7/2/2020 2:27:07 PM ----------------------------------------
7/2/2020 2:27:07 PM 
7/2/2020 2:27:07 PM MigrationScriptError: Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query. Table: settings. Columns: value.
7/2/2020 2:27:07 PM     at MigrationScriptError.KnexMigrateError (/var/lib/ghost/versions/3.22.1/node_modules/knex-migrator/lib/errors.js:7:26)
7/2/2020 2:27:07 PM     at new MigrationScriptError (/var/lib/ghost/versions/3.22.1/node_modules/knex-migrator/lib/errors.js:25:26)
7/2/2020 2:27:07 PM     at /var/lib/ghost/versions/3.22.1/node_modules/knex-migrator/lib/index.js:1055:19
7/2/2020 2:27:07 PM 
7/2/2020 2:27:07 PM Error: Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query. Table: settings. Columns: value.
7/2/2020 2:27:07 PM     at QueryCompiler_SQLite3._prepUpdate (/var/lib/ghost/versions/3.22.1/node_modules/knex/lib/query/compiler.js:820:13)
7/2/2020 2:27:07 PM     at QueryCompiler_SQLite3.update (/var/lib/ghost/versions/3.22.1/node_modules/knex/lib/query/compiler.js:175:29)
7/2/2020 2:27:07 PM     at QueryCompiler_SQLite3.toSQL (/var/lib/ghost/versions/3.22.1/node_modules/knex/lib/query/compiler.js:62:29)
7/2/2020 2:27:07 PM     at Builder.toSQL (/var/lib/ghost/versions/3.22.1/node_modules/knex/lib/query/builder.js:72:44)
7/2/2020 2:27:07 PM     at /var/lib/ghost/versions/3.22.1/node_modules/knex/lib/runner.js:31:36
7/2/2020 2:27:07 PM     at /var/lib/ghost/versions/3.22.1/node_modules/knex/lib/runner.js:260:24
7/2/2020 2:27:07 PM     at tryCatcher (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/util.js:16:23)
7/2/2020 2:27:07 PM     at Promise._settlePromiseFromHandler (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/promise.js:547:31)
7/2/2020 2:27:07 PM     at Promise._settlePromise (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/promise.js:604:18)
7/2/2020 2:27:07 PM     at Promise._settlePromise0 (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/promise.js:649:10)
7/2/2020 2:27:07 PM     at Promise._settlePromises (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/promise.js:729:18)
7/2/2020 2:27:07 PM     at _drainQueueStep (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/async.js:93:12)
7/2/2020 2:27:07 PM     at _drainQueue (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/async.js:86:9)
7/2/2020 2:27:07 PM     at Async._drainQueues (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/async.js:102:5)
7/2/2020 2:27:07 PM     at Immediate.Async.drainQueues (/var/lib/ghost/versions/3.22.1/node_modules/bluebird/js/release/async.js:15:14)
7/2/2020 2:27:07 PM     at processImmediate (internal/timers.js:456:21)
7/2/2020 2:27:07 PM     at process.topLevelDomainCallback (domain.js:137:15)

Technical details:

Linked issues :

bug

Most helpful comment

It's perfect I confirm that everything is restarted by deleting, thank you for the responsiveness!

I have no idea, it's a very old blog, but nothing special done on it, default style, default config, classic migration from 1.x probably.

All 7 comments

Would you be able to share the contents of your members_subscription_settings setting? Please redact the secret_token and public_token values if they're set though

Hello, yep

5ec7e713eea79e0001b8ad66|members_subscription_settings|{"paymentProcessors":[{"adapter":"stripe","config":{"secret_token":"","public_token":"","product":{"name":"....."},"plans":[{"name":"Monthly","currency":"usd","interval":"month","amount":""},{"name":"Yearly","currency":"usd","interval":"year","amount":""}]}}],"allowSelfSignup":true}|members|2019-04-22 08:08:29|1|2020-05-15 17:32:14|1

not used for me I can easily delete it if it is the responsible? but I wanted to go up the info by not finding a trace.

Thanks!

Looks like it's missing a fromAddress property in the JSON, I wonder how that happened :thinking:

I'll look into reproducing this and fixing - in the meantime, seeing as you're not using these settings if you can safely delete that row, and the migration should succeed :relaxed:

It's perfect I confirm that everything is restarted by deleting, thank you for the responsiveness!

I have no idea, it's a very old blog, but nothing special done on it, default style, default config, classic migration from 1.x probably.

Awesome, glad I could help, and thanks for the report and giving more info!

Similar issue reported on the forum, whereby members_subscription_settings does not have the expected structure:

https://forum.ghost.org/t/error-starting-ghost-after-upgrade-from-2-38-to-3-22-cannot-read-property-tostring-of-undefined/15586

The migration needs updating to be more robust ahead of 3.23.

Going to timebox a couple hours to fix this on monday :relaxed:

Was this page helpful?
0 / 5 - 0 ratings