mtabz
July 3, 2020, 10:34am
1
I upgraded Ghost from v2.38.2 to latest 3.22.1. Upgrade seemed to proceed ok.
However, I’m unable to start ghost and get the following error:
Message: Cannot read property 'toString' of undefined
Help: Error occurred while executing the following migration: 05-migrate-members-subscription-settings.js
Full error msg, version info etc:
/var/www/ghost$ ghost restart
+ sudo systemctl is-active ghost_mysite-com
Ghost instance is not running! Starting...
+ sudo systemctl start ghost_mysite-com
+ sudo systemctl stop ghost_mysite-com
✖ Starting Ghost
A GhostError occurred.
Message: Cannot read property 'toString' of undefined
Help: Error occurred while executing the following migration: 05-migrate-members-subscription-settings.js
Suggestion: journalctl -u ghost_mysite-com -n 50
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v10.16.3
Ghost Version: 3.22.1
Ghost-CLI Version: 1.14.1
Environment: production
Command: 'ghost restart'
I tried to do ghost upgrade --force
and there was no change, still got the same behaviour.
Ghost doctor shows no issues as well.
Hannah
July 3, 2020, 10:53am
2
Hey @mtabz , sorry to hear about this.
Please can you share the result of the following DB query?
SELECT `value`
FROM `settings`
WHERE `key` = 'members_subscription_settings' \G
Before posting them please make sure to redact secret_token
and public_token
values. Thanks!
mtabz
July 3, 2020, 11:37am
3
Sure @Hannah
Here it is:
mysql> SELECT `value`
-> FROM `settings`
-> WHERE `key` = 'members_subscription_settings' \G
*************************** 1. row ***************************
value: {"paymentProcessors":[{"adapter":"stripe","config":{"secret_token":"","public_token":"","product":{"name":"Ghost Subscription"},"plans":[{"name":"Monthly","currency":"usd","interval":"month","amount":""},{"name":"Yearly","currency":"usd","interval":"year","amount":""}]}}],"isPaid":false}
1 row in set (0.00 sec)
There was nothing to redact as I’ve not changed any subscription settings.
Hannah
July 3, 2020, 12:31pm
4
Great thank you. I have updated the following issue as your case is very similar:
opened 12:36PM - 02 Jul 20 UTC
closed 03:21PM - 06 Jul 20 UTC
bug
### 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:
* Docker Version: https://hub.docker.com/_/ghost?tab=tags latest
* Database: sqlite3
### Linked issues :
* probably linked to https://github.com/knex/knex/issues/3591
For now you have 2 options. As you’re not using members, you can remove the row as suggested in the issue above, and then try the upgrade.
Alternatively you can run ghost update 3.20.3 --force
to upgrade to the previous version and then do the final upgrade once we fix the issue above.
mtabz
July 3, 2020, 1:09pm
5
Ok, as my SQL is very rusty, so just to double-check the command to delete the row would be:
DELETE FROM `settings` WHERE `key` = 'members_subscription_settings';
Have I got that right?
mtabz
July 3, 2020, 2:28pm
7
Thanks a bunch @Hannah !
With that change I have been able to successfully start Ghost on v3.22.1.
Hey @Hannah , thanks for the workaround. Roughly, where can we expect fixed version, please?
No rush, just wondering.
I hit the same issue upgrading v3.21.0 to v3.22.1.
Cheers.
Hey @stiggy !
3.22.2 was just released with an improved migration, which should fix the issues you were seeing. Please update using Ghost-CLI
1 Like
stiggy
July 6, 2020, 4:54pm
10
Grand, works like a charm, thanks!
Had this issue, as well – but 3.22.2 fixed it Thanks!