Config file is not valid JSON error

  • What version of Ghost are you using? If it’s not the latest, please update Ghost first before opening your topic
    Ghost-CLI version: 1.17.0
    Ghost version: 4.4.0 (at ~)

And

  • How was Ghost installed and configured?
    Standard install with the digital ocean droplet
  • What Node version, database, OS & browser are you using?
    Node: v12.18.0
    database: mysql
    os: ubuntu 18.04
    browser: firefox/chrome
  • What errors or information do you see in the console?
    Running ghost doctor from user ghost-mgr leads to the following output
✔ Checking system Node.js version - found v12.18.0
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
✖ Validating config
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
One or more errors occurred.

1) Validating config

Error detected in the production configuration.

Message: Config file is not valid JSON

Debug Information:
    OS: Ubuntu, v18.04.4 LTS
    Node Version: v12.18.0
    Ghost Version: 4.4.0
    Ghost-CLI Version: 1.17.0
    Environment: production
    Command: 'ghost doctor'

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.
  • What steps could someone else take to reproduce the issue you’re having?
    having a mint digital ocean droplet installation

This is my config.production.json living under /var/www/ghost/:

{
  "url": "https://mydomain.com",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "ghost",
      "password": "PW",
      "database": "ghost_production"
    }
  },
  "mail": {
  "transport": "SMTP",
  "options": {
    "service": "Mailgun",
    "auth": {
      "user": "postmaster@mg.mydomain.com"
      "pass": "PW"
    }
  }
},
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/ghost/content"
  }
}

That line is missing a , at the end. If you ever have similar messages about invalid JSON https://jsonlint.com is a helpful website.

1 Like

It’s in my config, deleted it while removing my real user. I deleted the droplet and installed everything again. Now the error is gone. The real problem is that my magic link isn’t working, my server throws a 500 after a clean install when i try to sign up to the newsletter. Even after setting up mailgun. Could this be because I’m using cloudflare?

Hi @Kevin
Can you kindly check my file and tell me what is wrong with it, i tried using Json Validator but couldnt get it

{
	"database": {
		"client": "mysql",
		"connection": {
			"host": "127.0.0.1",
			"port": 3306,
			"database": "bitnami_ghost",
			"user": "bn_ghost",
			"password": "XX"
		}
	},
	"url": "XX",
	"server": {
		"port": 2368,
		"host": "0.0.0.0"
	},
	"logging": 
	{
		"transports": [
		"mail": 
		{
			"file",
		] 
		"from": "XX",},
		"transport": "SMTP",
		"process": "local",
		"paths": {
			"options": {
				"contentPath": "/opt/bitnami/ghost/content"
				"host": "smtp.sendgrid.net",
			}
		}
		"service": "Sendgrid",
		"port": "587",
		"secure": true,
		"auth": {
			"user": "XX",
			"pass": "XX"
		}
	}
},

Not sure what’s going on there, you’re starting a logging "transports": [ array but then have your other config inside of it.

Trailing commas with no following definitions are not valid JSON.

I really did not mean to, im not an expert, i got this config from Google.

What should i delete please.