# When updating config.production.json with Mailgun credentials, whole website crashes

**URL:** <https://forum.ghost.org/t/when-updating-config-production-json-with-mailgun-credentials-whole-website-crashes/35744>\
**Category:** Self-hosting\
**Created:** [January 22, 2023, 3:20pm UTC](https://forum.ghost.org/t/when-updating-config-production-json-with-mailgun-credentials-whole-website-crashes/35744 "2023-01-22T15:20:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [January 22, 2023, 3:20pm UTC](https://forum.ghost.org/t/when-updating-config-production-json-with-mailgun-credentials-whole-website-crashes/35744/1 "2023-01-22T15:20:32Z")

</div>

Everytime when I try to add my mailgun credentials in config.production.json, the whole website crashes (502 error). I don’t know why, but I followed carefully the instructions. The only way is to put back the original json that I got with my Ghost installation.

This is the file:

```auto
{
  "url": "",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "ghost",
      "password": "",
      "port": 3306,
      "database": "ghost_production"
    }
  "mail": {
  "transport": "SMTP",
  "options": {
    "service": "Mailgun",
    "auth": {
      "user": "",
      "pass": ""
    }
  }
},
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/ghost/content"
  }
}

```

---

<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:** [January 22, 2023, 3:41pm UTC](https://forum.ghost.org/t/when-updating-config-production-json-with-mailgun-credentials-whole-website-crashes/35744/2 "2023-01-22T15:41:10Z")

</div>

You’ve got syntax issues. You have the mail settings spliced in as part of the database settings, which is not correct. Looks like a missing }, before mail.

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [January 22, 2023, 4:27pm UTC](https://forum.ghost.org/t/when-updating-config-production-json-with-mailgun-credentials-whole-website-crashes/35744/3 "2023-01-22T16:27:12Z")

</div>

Thanks Cathy, you are a true resource on this forum. I thought I had lost the progress of a week (backup happens on sunday night) but now everything is back up 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:** [January 23, 2023, 10:16am UTC](https://forum.ghost.org/t/when-updating-config-production-json-with-mailgun-credentials-whole-website-crashes/35744/4 "2023-01-23T10:16:57Z")

</div>

You can always use an online validator, too, e.g.:

> **[JSON Formatter & Validator](https://jsonformatter.curiousconcept.com/#)**
>
> Format and validate JSON data so that it can easily be read by human beings.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [April 23, 2023, 10:17am UTC](https://forum.ghost.org/t/when-updating-config-production-json-with-mailgun-credentials-whole-website-crashes/35744/5 "2023-04-23T10:17:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
