Ghost-CLI: Install fails on --db sqlite3 --dbpath

Please help me. I’ve been trying to do this for a day now. It tries to connect to the MySQL host even if I don’t need MySQL. And in this, it fails.

root@thecyberfibre:~/.ghost/logs# cat ghost-cli-debug-2017-07-10T09_31_35_408Z.log 
Debug Information:
    Node Version: v6.11.0
    Ghost-CLI Version: 1.0.0-beta.6
    Environment: production
    Command: 'ghost install --db sqlite3 --dbpath ./content/data/ghost.db'
An error occurred.
Message: 'connect ECONNREFUSED 127.0.0.1:3306'

Stack: 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)
Code: ECONNREFUSED
root@thecyberfibre:~/.ghost/logs# 

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@regalstreak a workaround is to run ghost install --url <url> --db sqlite3 --dbpath ./content/data/ghost.db

Passing both url and db options skips the prompts for mysql data, which are actually what is causing the issue.

Ah wait I know what’s going on - this is actually related to some other issues - will get this fixed asap though.

hmmm…ok I’ll look into this. Thanks for the report!

@regalstreak The version of Ghost installed by the CLI is still in beta. RC is coming soon, but it’s still not deemed production ready.

If you’re looking to do a production install today - I highly recommend installing the LTS.

Can it be done by today lol? Or ill have to do a manual install. (no eta i know, myself a developer) More like, should i go ahead with a manual install?

Maybe you might not want to run

                // Special-case migrations
                if (includes(argv.stages, 'migrate')) {
                    tasks.push({title: 'Running database migrations', task: migrate})
                }

when there is no existing mysql install.

This is with a fresh cloud on vultr running ubuntu 16.04.1 LTS. I had installed nginx, and followed the rest from https://docs.ghost.org/docs/installing-ghost-via-the-cli But i had not installed mysql as instructed. And I do not plan on using mysql because I’m low on budget and just would have a gig of ram.

@acburdine

root@thecyberfibre:/var/www/ghost# ghost install --db sqlite3 --dbpath ./content/data/ghost.db
✔ Checking for latest Ghost version
✔ Running system checks
✔ Setting up install directory
✔ Downloading and installing Ghost v1.0.0-beta.2
✔ Moving files
? Enter your blog URL: https://thecyberfibre.com
? Enter your MySQL hostname: localhost
? Enter your MySQL username: 
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: ghost_production
✔ Configuring Ghost
✔ Running setup checks
✔ Setting up instance
? Do you wish to set up a ghost mysql user? No
ℹ Setting up mysql [skipped]
? Do you wish to set up a ghost system user? Yes
Running sudo command: useradd --system --user-group ghost
Running sudo command: chown -R ghost:ghost /var/www/ghost/content
✔ Setting up linux-user
? Do you wish to set up nginx? Yes
? Ghost-CLI would like to generate a nginx config file. Yes, write config file
Running sudo command: ln -sf /var/www/ghost/system/files/thecyberfibre.com.conf /etc/nginx/sites-available/thecyberfibre.com.conf
Running sudo command: ln -sf /etc/nginx/sites-available/thecyberfibre.com.conf /etc/nginx/sites-enabled/thecyberfibre.com.conf
Running sudo command: service nginx restart
✔ Setting up nginx
? Do you wish to set up ssl? Yes
? Enter your email (used for SSL certificate generation) regalstreak@gmail.com
Running sudo command: service nginx restart
? Ghost-CLI would like to generate a ssl parameters file. Yes, write config file
Running sudo command: service nginx restart
✔ Setting up ssl
? Do you wish to set up automatic ssl renewal? Yes
✔ Setting up ssl-renew
? Do you wish to set up systemd? Yes
? Ghost-CLI would like to generate a systemd service file file. Yes, write config file
Running sudo command: ln -sf /var/www/ghost/system/files/ghost_thecyberfibre-com.service /lib/systemd/system/ghost_thecyberfibre-com.service
Running sudo command: systemctl daemon-reload
✔ Setting up systemd
✖ Running database migrations
An error occurred.
Message: 'connect ECONNREFUSED 127.0.0.1:3306'


Debug Information:
    Node Version: v6.11.0
    Ghost-CLI Version: 1.0.0-beta.6
    Environment: production
    Command: 'ghost install --db sqlite3 --dbpath ./content/data/ghost.db'

Additional log info available in: /root/.ghost/logs/ghost-cli-debug-2017-07-10T10_03_39_671Z.log

Please refer to https://docs.ghost.org/docs/installing-ghost-via-the-cli#troubleshooting for troubleshooting.
root@thecyberfibre:/var/www/ghost# 

@regalstreak can you post a screenshot/copy paste of the actual CLI output during ghost install (not just the logs)? This log is helpful but I’m having trouble seeing where this error came from specifically. Thanks!