Config File Not Valid JSON

Hello,

I ran into issues earlier with my website’s subscription button. If someone tried to subscribe, it wouldn’t load.

Tried sorting it out myself. Because I use DigitalOcean, a website told to set up STMP with my Mailgun details. However, the subscription button is still not working. And now, when I try to restart ghost, I receive this message:

Ghost instance is not running! Starting…
:heavy_multiplication_x: Starting Ghost
A SystemError occurred.

Message: The content folder is not owned by the current user.
Ensure the content folder has correct permissions and try again.

Debug Information:
OS: Ubuntu, v22.04.1 LTS
Node Version: v16.17.0
Ghost Version: 5.22.6
Ghost-CLI Version: 1.23.1
Environment: production
Command: ‘ghost restart’

When I run ghost doctor, I get:

One or more errors occurred.

  1. Validating config

Error detected in the production configuration.

Message: Config file is not valid JSON

I’m very new to this so I tried running the config through a validator. But I don’t even know how to read JSON so not sure how to correct it. Here it is:
{

“url”: “https://mydomain.com”,
“server”: {
“port”: 2368,
“host”: “127.0.0.1”
},
“database”: {
“client”: “mysql”,
“connection”: {
“host”: “localhost”,
“user”: “ghost-456”,
“password”: “REDACTED”,
“port”: 3306,
“database”: “ghost_production”
}
},
“mail”:
{“from”: “vanessa <noreply @ DOMAIN>”,
“transport”: “SMTP”,
“options”: {
“service”: “Mailgun”,
“host”: “smtp.mailgun.org”,
“port”: 465,
“secureConnection”: true,
“auth”: {
“user”: TKTKTK@gmail.com",
“pass”: “REDACTED”
}
}
},
“transport”: “Direct”
},
“logging”: {
“transports”: [
“file”,
“stdout”}

]

},
“process”: “systemd”,
“paths”: {
“contentPath”: “/var/www/ghost/content”
}

A bunch of your quotes are slanted quotes rather than straight up and down quotes. That /might/ be the result of posting on the forum, but I’d check your file really closely.

WRONG:

“process”: “systemd”,

RIGHT:

"process": "systemd",

Ah yeah, I checked and that’s just from posting on the forum :/ In the file, they’re all straight.

The transactional email settings for Mailgun should look like this:

  },
  "mail": {
    "from": "noreply@yourdomain",
    "transport": "SMTP",
    "options": {
      "host": "smtp.mailgun.org",
      "port": 587,
      "service": "Mailgun",
      "secure": false,
      "requireTLS": true,
      "auth": {
        "user": "postmaster@yourdomain",
        "pass": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx-xxxxxxxx"
      }
    }
  },

Remove "transport": "Direct"}, which incidently has a missing brace.

The user credentials and pass are from Mailgun Domains Settings > SMTP Credentials.

1 Like

2 posts were split to a new topic: Mailgun config setup

That’s not valid JSON.
A json objects start with { and end with }
e.g.

{
  "mail": {
                "transport": "test"
          }
}

I went ahead and fixed the initial json you posted, there were a bunch of syntax errors:

{
	"url": "https://mydomain.com",
	"server": {
		"port": 2368,
		"host": "127.0.0.1"
	},
	"database": {
		"client": "mysql",
		"connection": {
			"host": "localhost",
			"user": "ghost-456",
			"password": "REDACTED",
			"port": 3306,
			"database": "ghost_production"
		}
	},
	"mail": {
		"from": "vanessa <noreply @ DOMAIN>",
		"transport": "SMTP",
		"options": {
			"service": "Mailgun",
			"host": "smtp.mailgun.org",
			"port": 465,
			"secureConnection": true,
			"auth": {
				"user": "TKTKTK@gmail.com",
				"pass": "REDACTED"
			}
		}
	},
	"transport": "Direct",
	"logging": {
		"transports": [
			"file",
			"stdout"
		]
	},
	"process": "systemd",
	"paths": {
		"contentPath": "/var/www/ghost/content"
	}
}