New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get through mysql setting while installing Ghost via CLI #407
Comments
It is not the systemd step that is failing, but this one:
ECONNREFUSED to port 3306 is referring to your MySQL service. Do you have a running MySQL service, and are the credentials you provided valid? |
Sorry about my lack of related knowledge. I've updated the log, and it includes all after 'ghost install'. The only command about MySQL I typed was 'sudo apt-get install mysql-server' when installing it. What should I do now? |
I tried this:
and it says:
|
Hi @vistaing I was pointing out that the X (failed task) was next to the mysql task, and not the systemd task (that has a tick next to it, so succeeded). Knowing that an ECONNRESET with port 3306 means MySQL is definitely something that Ghost CLI could handle and tell you explicitly - we can look at adding some clearer error messages here. It seems the documentation for setting up mysql in the migration guide is not complete. Sorry about that. For now I recommend following this guide: https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04. CC @sebgie can you please take a second look at the setup docs when you have a minute? According to digital ocean the security task is needed & also the service needs to be explicitly started. |
@ErisDS Thank you for you replies! Seems that |
@ErisDS I solved it (although I didn't fully understand the mechanics)! It seems that users should be informed that running Thank you for your generous guide on this simple issue !! |
@vistaing to get a better understanding of how this occured could you please describe what steps you took to get to that stage?
|
@sebgie Glad to share more detail with you:
Thanks for reading! Maybe it's hard for a veteran to commit the same move, but as a newbie in development, I really didn't know that I should manually install mysql-client first. |
So, I have tried this out on a new droplet on DO. I can reproduce the output mentioned above if mysql-server installation fails. This could happen if the package list in apt is not updated ( The output after that looks like this:
I have added a new section about updating the package list and upgrading installed packages to the documentation. |
Leaving this issue open so I can add an additional check to the migrate step to handle ECONNREFUSED errors with a better error message. |
Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂 |
SOLVED!
I'm trying to migrate from 0.11.11 to 1.0.0+, and I followed the official guide here. To complete this, I started a brand new droplet on DigitalOcean.
The problem is that I just can't pass the systemd setting step. Here's detailed log:
? Enter your blog URL: http://shi****yu.com/
? Enter your MySQL hostname: localhost
? Enter your MySQL username: recon
? Enter your MySQL password (skip to keep current password): [hidden]
? Enter your Ghost database name: ghost_production
✔ Configuring Ghost
✔ Setting up instance
Running sudo command: chown -R ghost:ghost /var/www/ghost/content
✔ Setting up "ghost" system user
? Do you wish to set up Nginx? Yes
✔ Creating nginx config file at /var/www/ghost/system/files/shiratsuyu.com.conf
Running sudo command: ln -sf /var/www/ghost/system/files/shiratsuyu.com.conf /etc/nginx/sites-available/shiratsuyu.com.conf
Running sudo command: ln -sf /etc/nginx/sites-available/shiratsuyu.com.conf /etc/nginx/sites-enabled/shiratsuyu.com.conf
Running sudo command: service nginx restart
✔ Setting up Nginx
? Do you wish to set up SSL? Yes
? Enter your email (used for Let's Encrypt notifications) ****@.com
✔ Creating ssl security parameters file at /var/www/ghost/system/files/ssl-params.conf
✔ Creating ssl config file at /var/www/ghost/system/files/shiratsuyu.com-ssl.conf
Running sudo command: ln -sf /var/www/ghost/system/files/shiratsuyu.com-ssl.conf /etc/nginx/sites-available/shiratsuyu.com-ssl.conf
Running sudo command: ln -sf /etc/nginx/sites-available/shiratsuyu.com-ssl.conf /etc/nginx/sites-enabled/shiratsuyu.com-ssl.conf
Running sudo command: service nginx restart
✔ Setting up SSL
? Do you wish to set up "ghost" mysql user? Yes
MySQL user is not "root", skipping additional user setup
ℹ Setting up "ghost" mysql user [skipped]
? Do you wish to set up Systemd? Yes
✔ Creating systemd service file at /var/www/ghost/system/files/ghost_localhost.service
Running sudo command: ln -sf /var/www/ghost/system/files/ghost_localhost.service /lib/systemd/system/ghost_localhost.service
Running sudo command: systemctl daemon-reload
? Do you wish to set up Systemd? Yes
✔ Creating systemd service file at /var/www/ghost/system/files/ghost_localhost.service
Running sudo command: ln -sf /var/www/ghost/system/files/ghost_localhost.service /lib/systemd/system/ghost_localhost.service
Running sudo command: systemctl daemon-reload
✔ Setting up Systemd
Running sudo command: -E -u ghost /usr/lib/node_modules/ghost-cli/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current
✖ Running database migrations
An error occurred.
Message: 'Command failed: /bin/sh -c sudo -E -u ghost /usr/lib/node_modules/ghost-cli/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current
[2017-07-31 09:21:30] ERROR
NAME: InternalServerError
CODE: ECONNREFUSED
MESSAGE: The server has encountered an error.
level:normal
InternalServerError: The server has encountered an error.
at new KnexMigrateError (/usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/errors.js:7:26)
at /usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/database.js:58:19
at tryCatcher (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:689:18)
at Async._drainQueue (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
Error: connect ECONNREFUSED 127.0.0.1:3306
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
--------------------
at Protocol._enqueue (/usr/lib/node_modules/ghost-cli/node_modules/mysql/lib/protocol/Protocol.js:141:48)
at Protocol.handshake (/usr/lib/node_modules/ghost-cli/node_modules/mysql/lib/protocol/Protocol.js:52:41)
at Connection.connect (/usr/lib/node_modules/ghost-cli/node_modules/mysql/lib/Connection.js:130:18)
at /usr/lib/node_modules/ghost-cli/node_modules/knex/lib/dialects/mysql/index.js:106:18
at Promise._execute (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:79:10)
at Client_MySQL.acquireRawConnection (/usr/lib/node_modules/ghost-cli/node_modules/knex/lib/dialects/mysql/index.js:104:12)
at Object.create (/usr/lib/node_modules/ghost-cli/node_modules/knex/lib/client.js:239:16)
at Pool._createResource (/usr/lib/node_modules/ghost-cli/node_modules/generic-pool/lib/generic-pool.js:354:17)
at Pool._ensureMinimum (/usr/lib/node_modules/ghost-cli/node_modules/generic-pool/lib/generic-pool.js:408:12)
at new Pool (/usr/lib/node_modules/ghost-cli/node_modules/generic-pool/lib/generic-pool.js:157:8)
at Client_MySQL.initializePool (/usr/lib/node_modules/ghost-cli/node_modules/knex/lib/client.js:269:17)
at Client_MySQL.Client (/usr/lib/node_modules/ghost-cli/node_modules/knex/lib/client.js:116:12)
at new Client_MySQL (/usr/lib/node_modules/ghost-cli/node_modules/knex/lib/dialects/mysql/index.js:62:20)
at Knex (/usr/lib/node_modules/ghost-cli/node_modules/knex/lib/index.js:60:34)
at Object.connect (/usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/database.js:24:12)
at Object.createDatabaseIfNotExist (/usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/database.js:41:30)
at KnexMigrator.init (/usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/index.js:71:21)
at KnexMigrator.migrate (/usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/index.js:158:21)
at /usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/bin/knex-migrator-migrate:26:29
at tryCatcher (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/util.js:16:23)
'
Debug Information:
Node Version: v6.11.1
Ghost-CLI Version: 1.0.1
Environment: production
Command: 'ghost setup'
Additional log info available in: /home/recon/.ghost/logs/ghost-cli-debug-2017-07-31T09_21_30_330Z.log
Please refer to https://docs.ghost.org/docs/installing-ghost-via-the-cli#troubleshooting for troubleshooting.
Please help me out, thanks anyway!
The text was updated successfully, but these errors were encountered: