# Error 502 after production.json edit

**URL:** <https://forum.ghost.org/t/error-502-after-production-json-edit/39561>\
**Category:** Self-hosting\
**Created:** [June 29, 2023, 8:32pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561 "2023-06-29T20:32:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fritz\_Ferrante](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fritz_ferrante/32/24935_2.png) [@Fritz\_Ferrante](https://forum.ghost.org/u/Fritz_Ferrante)\
**Post date:** [June 29, 2023, 8:32pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/1 "2023-06-29T20:32:23Z")

</div>

Ghost: 5.52.1  
Node: 16.20.0  
OS: Ubuntu 22.04  
Hosting: VPS on Interserver  
[https://fourankles.com](https://fourankles.com)

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!

Fritz

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:  
> bc7466d0-16b9-11ee-806b-c9c95cd7c31f  
> 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?

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 29, 2023, 8:43pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/2 "2023-06-29T20:43:31Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![Fritz\_Ferrante](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fritz_ferrante/32/24935_2.png) [@Fritz\_Ferrante](https://forum.ghost.org/u/Fritz_Ferrante)\
**Post date:** [June 29, 2023, 8:45pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/3 "2023-06-29T20:45:20Z")

</div>

> ──────────────────┬──────┬─────────────────┐  
> │ Name │ Location │ Version │ Status │ URL │ Port │ Process Manager │  
> ├────────────────┼─────────────────────┼─────────┼──────────────────────┼────────────────────────┼──────┼─────────────────┤  
> │ fourankles-com │ /var/www/fourankles │ 5.52.1 │ running (production) │ [https://fourankles.com](https://fourankles.com) │ 2369 │ systemd

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

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 29, 2023, 8:48pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/4 "2023-06-29T20:48:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fritz\_Ferrante](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fritz_ferrante/32/24935_2.png) [@Fritz\_Ferrante](https://forum.ghost.org/u/Fritz_Ferrante)\
**Post date:** [June 29, 2023, 8:49pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/5 "2023-06-29T20:49:08Z")

</div>

Now I get a Your connection isn’t private

Attackers might be trying to steal your information from **[fourankles.com](http://fourankles.com)** (for example, passwords, messages, or credit cards).

NET::ERR\_CERT\_AUTHORITY\_INVALID

Which is something new. Yeah?

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

F

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 29, 2023, 8:52pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/6 "2023-06-29T20:52:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fritz\_Ferrante](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fritz_ferrante/32/24935_2.png) [@Fritz\_Ferrante](https://forum.ghost.org/u/Fritz_Ferrante)\
**Post date:** [June 29, 2023, 8:58pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/7 "2023-06-29T20:58:45Z")

</div>

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.

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

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 29, 2023, 9:00pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/8 "2023-06-29T21:00:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fritz\_Ferrante](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fritz_ferrante/32/24935_2.png) [@Fritz\_Ferrante](https://forum.ghost.org/u/Fritz_Ferrante)\
**Post date:** [June 29, 2023, 9:05pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/9 "2023-06-29T21:05:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 29, 2023, 9:52pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/10 "2023-06-29T21:52:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [June 29, 2023, 10:16pm UTC](https://forum.ghost.org/t/error-502-after-production-json-edit/39561/11 "2023-06-29T22:16:51Z")

</div>

> [@Cathy\_Sarisky](#):
>
> I’ve got a vps running postfix for transactional mail …

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