Error with knex self-hosted

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What’s your URL? This is the easiest way for others to debug your issue
    hitchcock.dev
  • What version of Ghost are you using?
    3.33
  • What configuration?
    Ubuntu 18.04 LTS
    MySQL
  • What browser?
    Chrom
  • What errors or information do you see in the console?
    brennan@localhost:/var/www/ghost$ ghost run
    The ghost run command is used by the configured Ghost process manager and for debugging. If you’re not running this to debug something, you should run ghost start instead.
  • sudo node current/index.js
    /var/www/ghost/versions/3.33.0/node_modules/knex-migrator/node_modules/knex/lib/client.js:55
    throw new Error(knex: Required configuration option 'client' is missing.);
    ^

Error: knex: Required configuration option ‘client’ is missing.
at new Client (/var/www/ghost/versions/3.33.0/node_modules/knex-migrator/node_modules/knex/lib/client.js:55:11)
at Knex (/var/www/ghost/versions/3.33.0/node_modules/knex-migrator/node_modules/knex/lib/knex.js:53:28)
at Object.connect (/var/www/ghost/versions/3.33.0/node_modules/knex-migrator/lib/database.js:26:12)
at KnexMigrator.isDatabaseOK (/var/www/ghost/versions/3.33.0/node_modules/knex-migrator/lib/index.js:589:32)
at Object.module.exports.getState (/var/www/ghost/versions/3.33.0/core/server/data/db/migrator.js:13:25)
at isDatabaseInitialisationRequired (/var/www/ghost/versions/3.33.0/core/server/index.js:172:21)
at makeGhost (/var/www/ghost/versions/3.33.0/core/index.js:13:12)
at Object. (/var/www/ghost/versions/3.33.0/index.js:27:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

  • What steps could someone else take to reproduce the issue you’re having?
    Ghost LS says site is running, but not responded and refusing connections.

It looks like you have not properly configured the database property in your configuration file. Can you share that portion with the credentials redacted?

This was just an upgrade to a blog thats been running for a few years.

“url”: “https://hitchcock.dev”,
“server”: {
“port”: 2368,
“host”: “127.0.0.1”
},
“database”: {
“connection”: {
“user”: “user”,
“password”: “pass”,
“database”: “hitchcockdev_prod”
}
},
“mail”: {
“transport”: “Direct”
},
“logging”: {
“transports”: [
“file”,
“stdout”
]
},

You’re missing the client property - should be mysql or sqlite3

This was the solution. I had to add a “client”: “mysql” under the database node. Odd that it went missing.