Error 502 after production.json edit

Ghost: 5.52.1
Node: 16.20.0
OS: Ubuntu 22.04
Hosting: VPS on Interserver

I had ghost running yesterday! I realized that I need to get a mail service running so I could actually log in! I tried with postfix since I’m not doing mass mailing (no need for mailgun). I couldn’t get it to run so I removed it and tried to go back to the default config. Now I have a 502 error at the address.

Ghost status is running with no errors and nginx is the same. Mysterious!


ps I tried ghost run after another post suggestion and got this:

[2023-06-29 20:15:48] ERROR (EADDRINUSE) Cannot start Ghost.
(EADDRINUSE) Cannot start Ghost.
β€œPort 2369 is already in use by another program.”
β€œIs another Ghost instance already running?”
Error ID:
InternalServerError: (EADDRINUSE) Cannot start Ghost.
at Server. (/var/www/fourankles/versions/5.52.1/core/server/GhostServer.js:89:34)
at Server.emit (node:events:513:28)
at emitErrorNT (node:net:1490:8)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
[2023-06-29 20:15:48] WARN Ghost is shutting down
[2023-06-29 20:15:48] WARN Ghost has shut down
[2023-06-29 20:15:48] WARN Your site is now offline
[2023-06-29 20:15:48] WARN Ghost was running for a few seconds
gbadmin@vps2685427:/var/www/fourankles$ ghost status

Is there a second instance fighting?

It’s currently showing a cloudflare error - it may be helpful to switch Cloudflare over to β€˜dns only’ (no proxy) while debugging.

Can you report what you see when you do ghost ls ? I suspect you’ve got something running, indeed.

If you see another ghost running, i.e. β€˜ghost-local-1’, you can stop it with ghost stop ghost-local-1

β”‚ Name β”‚ Location β”‚ Version β”‚ Status β”‚ URL β”‚ Port β”‚ Process Manager β”‚
β”‚ fourankles-com β”‚ /var/www/fourankles β”‚ 5.52.1 β”‚ running (production) β”‚ β”‚ 2369 β”‚ systemd

Looks like just the one… I’ll check cloudflare.
Switched cloudflare to dns only on just the domain name.

Ghost usually runs on 2368. Does your nginx config file say 2369?

Now I get a Your connection isn’t private

Attackers might be trying to steal your information from (for example, passwords, messages, or credit cards).


Which is something new. Yeah?

And the config does say 2369. I wondered about that. Should I move that back to 8?


It completely doesn’t matter what port you put Ghost at, as long as nginx points to it, and you don’t have something else trying to run there.

Good catch. The port in the nginx config was on 2368. So I changed it to 8 and restarted. I then moved it back to strict proxy on cloudflare. No change that I can tell though.

ps, It might take a few to populate the new values on the web?

I’m seeing it now! Make sure you’re trying to access with https. :)

Whoop, I’m back up! Now to go and sort out that smtp!!!

1 Like

I’ve got a vps running postfix for transactional mail, so if you get hung up, please post again! :)

Ditto. I use Postfix and Mailgun as a relay for transactional email.

1 Like