cobyism/ghost-on-heroku

Ghost app crashes after updating 0.11.x to latest 1.x master

Closed this issue · 4 comments

Hi, thank you for maintaining this project so far. It's been very useful to update my Ghost blogs.

After updating to latest master (396fb78), and pushing to Heroku, the build finishes successfully, but I get following errors in the log:

2018-09-04T16:28:40.648107+00:00 app[web.1]:
2018-09-04T16:28:40.648118+00:00 app[web.1]: Ghost has shut down
2018-09-04T16:28:40.650422+00:00 app[web.1]:
2018-09-04T16:28:40.650424+00:00 app[web.1]: Your blog is now offline
2018-09-04T16:28:43.609031+00:00 heroku[web.1]: Starting process with command `npm start --production`
2018-09-04T16:28:43.000000+00:00 app[api]: Build succeeded
2018-09-04T16:28:45.809790+00:00 app[web.1]:
2018-09-04T16:28:45.809806+00:00 app[web.1]: > ghost-on-heroku@1.7.1 start /app
2018-09-04T16:28:45.809807+00:00 app[web.1]: > node server.js
2018-09-04T16:28:45.809809+00:00 app[web.1]:
2018-09-04T16:28:49.167958+00:00 app[web.1]: Unhandled rejection Error: connect ECONNREFUSED 127.0.0.1:3306
2018-09-04T16:28:49.168000+00:00 app[web.1]: at Object.exports._errnoException (util.js:1020:11)
2018-09-04T16:28:49.168001+00:00 app[web.1]: at exports._exceptionWithHostPort (util.js:1043:20)
2018-09-04T16:28:49.168004+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
2018-09-04T16:28:49.168006+00:00 app[web.1]: --------------------
2018-09-04T16:28:49.168008+00:00 app[web.1]: at Protocol._enqueue (/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
2018-09-04T16:28:49.168009+00:00 app[web.1]: at Protocol.handshake (/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
2018-09-04T16:28:49.168010+00:00 app[web.1]: at Connection.connect (/app/node_modules/mysql/lib/Connection.js:118:18)
2018-09-04T16:28:49.168013+00:00 app[web.1]: at Promise._execute (/app/node_modules/bluebird/js/release/debuggability.js:303:9)
2018-09-04T16:28:49.168011+00:00 app[web.1]: at /app/node_modules/knex/lib/dialects/mysql/index.js:109:18
2018-09-04T16:28:49.168014+00:00 app[web.1]: at Promise._resolveFromExecutor (/app/node_modules/bluebird/js/release/promise.js:483:18)
2018-09-04T16:28:49.168017+00:00 app[web.1]: at Client_MySQL.acquireRawConnection (/app/node_modules/knex/lib/dialects/mysql/index.js:104:12)
2018-09-04T16:28:49.168015+00:00 app[web.1]: at new Promise (/app/node_modules/bluebird/js/release/promise.js:79:10)
2018-09-04T16:28:49.168019+00:00 app[web.1]: at create (/app/node_modules/knex/lib/client.js:283:23)
2018-09-04T16:28:49.168020+00:00 app[web.1]: at tryPromise (/app/node_modules/tarn/lib/Pool.js:366:22)
2018-09-04T16:28:49.168021+00:00 app[web.1]: at tryPromise (/app/node_modules/tarn/lib/utils.js:57:20)
2018-09-04T16:28:49.168022+00:00 app[web.1]: at Promise (/app/node_modules/tarn/lib/Pool.js:366:5)
2018-09-04T16:28:49.168024+00:00 app[web.1]: at Promise._execute (/app/node_modules/bluebird/js/release/debuggability.js:303:9)
2018-09-04T16:28:49.168025+00:00 app[web.1]: at Promise._resolveFromExecutor (/app/node_modules/bluebird/js/release/promise.js:483:18)
2018-09-04T16:28:49.168026+00:00 app[web.1]: at new Promise (/app/node_modules/bluebird/js/release/promise.js:79:10)
2018-09-04T16:28:49.168027+00:00 app[web.1]: at callbackOrPromise (/app/node_modules/tarn/lib/Pool.js:357:10)
2018-09-04T16:29:44.168782+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-09-04T16:29:44.168859+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-09-04T16:29:44.238211+00:00 heroku[web.1]: Process exited with status 137
2018-09-04T16:29:44.259061+00:00 heroku[web.1]: State changed from starting to crashed
2018-09-04T16:29:44.261484+00:00 heroku[web.1]: State changed from crashed to starting
2018-09-04T16:29:51.187209+00:00 heroku[web.1]: Starting process with command `npm start --production`

Do you have any idea what this can be due to?

mars commented

Looks like it thinks the database is at the default localhost MySQL port.

Did Ghost 2.0 change how it reads configuration? Like the config file naming?

Maybe the config generator for this Heroku app does no longer outputs to the correct location? (config.production.json)

(I misinterpreted the context of this issue as relating to Ghost 2.0)

Hi again. Thanks for the quick reply.

I think it's mostly due to me trying to upgrade my blog from pre-1.0 to 1.x without having done the necessary migration steps. Apparently there's more to do in this migration (see guide) than just bumping the numbers in package.json.

Anyway, I'll just rebase the git repo to before merging cobyism/master and merge the 0.11.1 branch instead. And then go through the migration process.

mars commented

That makes sense. The upgrade from 0.11 to 1.0 totally changes the database config. Once the app is on 1.x, the upgrade to 2.x should go smoother.

It's working again, in version 1. I followed the migration guide (create backup, shut down old blog), and used the deploy button to deploy a new instance.

Works perfectly. Thanks for maintaining this repo. I'd be lost without it.