# Upgrade to 2.28.1, 502 on image upload

**URL:** <https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721>\
**Category:** Installation\
**Created:** [August 18, 2019, 4:45pm UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721 "2019-08-18T16:45:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiksy](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kiksy/32/4321_2.png) [@kiksy](https://forum.ghost.org/u/kiksy)\
**Post date:** [August 18, 2019, 4:45pm UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/1 "2019-08-18T16:45:14Z")

</div>

Just updated to the latest version and everything is working except cannot upload images to posts. Usually I’d say this is a permissions issue, but the error I’m getting is a 502 Bad Gateway. Note this is only when uploading images, not when saving posts or anything.

- What version of Ghost are you using?  
2.28.1

- What configuration?  
DO , but manually installed. Running for ~2 years.

- What browser?  
5xx error so not relevant

- What errors or information do you see in the console?

Ghost log shows me:

```
[2019-08-18 16:37:35] INFO "GET /ghost/assets/img/contributors/kevinansfield-925606c55bc2f3f2f05c0fa58b953ad1.jpeg" 200 2ms
[2019-08-18 16:37:35] INFO "GET /ghost/assets/img/contributors/GeorginaLusby-6cea5defddee3c4ea7320e580521e832.jpeg" 200 1ms
[2019-08-18 16:38:31] INFO "GET /ghost/api/canary/admin/posts/?limit=30&page=1&filter=status%3A%5Bdraft%2Cscheduled%2Cpublished%5D" 200 233ms
[2019-08-18 16:38:33] INFO "GET /ghost/api/canary/admin/posts/5d5979893e583d15add332b7/?status=all" 200 45ms
[2019-08-18 16:38:33] INFO "GET /ghost/api/canary/admin/tags/?limit=all" 200 70ms
[2019-08-18 16:38:33] INFO "GET /ghost/api/canary/admin/users/?limit=all&include=roles" 200 69ms
[2019-08-18 16:38:53] INFO Ghost is running in production...
[2019-08-18 16:38:53] INFO Your site is now available on https://www.website/
[2019-08-18 16:38:53] INFO Ctrl+C to shut down
[2019-08-18 16:38:53] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-08-18 16:38:53] WARN Tries: 0
[2019-08-18 16:38:53] WARN Retrying...
[2019-08-18 16:38:53] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-08-18 16:38:53] WARN Tries: 1
[2019-08-18 16:38:53] WARN Retrying...
[2019-08-18 16:38:54] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-08-18 16:38:54] WARN Tries: 2
[2019-08-18 16:38:54] WARN Retrying...
[2019-08-18 16:38:54] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-08-18 16:38:54] INFO Ghost boot 3.848s

```

I’m guessing this is some kind of Nginx-\>Ghost proxy config issue?

Ghost doctor shows everything is ok, and like I say, I can browse the site and save posts fine, just cannot upload images.

**UPDATE:**  
So it looks similar to this issue: [502 Error after updating to v2 - #9 by tonyxu](https://forum.ghost.org/t/502-error-after-updating-to-v2/8552/9)  
but also Im getting an issue similar to:

> <https://github.com/TryGhost/Ghost/issues/7753>
>
> \### Issue Summary
> 
> I'm running Ghost on a Digital Ocean 512mb server.
> I have …a popular article with about 25 high res images (2560p).
> When I have those images on the article, it crashes. 
> I've managed to fix the issue by replacing the images with an imgur album link.
> 
> \### Technical details:
> 
> \* Ghost Version: 0.11.3
> \* Node Version: 4.4.5
> \* Database: Default

**UPDATE 2:**  
so the blog seems to be restarting at seemingly random intervals.

`ps aux | grep node`

gives me:  
`ghost 1880 22.4 9.1 1896148 93072 ? Sl 07:58 0:03 /usr/bin/node current/index.js`

after a crash the pid changes. (as expected)…

My version history is:  
1.23.0 1.25.5 2.0.2 2.28.1 2.4.0

I’ve tried disabling AMP and removed all old versions.

**UPDATE 3:**  
running

`ghost run`

Everything works. I can upload images , and the node process stays up.

Any ideas why `ghost run` would be fine but `ghost start` not?

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daviddarnes/32/3533_2.png) [@DavidDarnes](https://forum.ghost.org/u/DavidDarnes)\
**Post date:** [August 19, 2019, 8:36am UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/2 "2019-08-19T08:36:49Z")

</div>

Hi there. Sorry you’re having trouble. Might be worth keeping track of the other thread in the hope their issue is the same as yours:

> [@502 Error after updating to v2](https://forum.ghost.org/t/502-error-after-updating-to-v2/8552/9):
>
> So we’re hosing Ghost on a separate droplet (and as a subdirectory). This error log is from the main site’s nginx.

---

<div class="post-metadata">

**Author:** ![kiksy](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kiksy/32/4321_2.png) [@kiksy](https://forum.ghost.org/u/kiksy)\
**Post date:** [August 19, 2019, 10:32am UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/3 "2019-08-19T10:32:34Z")

</div>

Thanks.

My current solution is running:

`sudo NODE_ENV=production nohup node current/index.js &`

To keep it running in the same way `ghost run` does.

any attempt to run `ghost start` just seems to cause issues with the 502s due to the process dying and restarting.

---

<div class="post-metadata">

**Author:** ![naz](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/naz/32/30666_2.png) [@naz](https://forum.ghost.org/u/naz)\
**Post date:** [September 23, 2019, 8:36am UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/5 "2019-09-23T08:36:02Z")

</div>

@kiksy did you have a chance to figure out the problem? Did you try bumping the file size limit as advised in the GH issue:

> <https://github.com/TryGhost/Ghost/issues/11129#issuecomment-532077159>
>
> I'm having a similar issue as \[#3827\](https://github.com/TryGhost/Ghost/issues/3…827) and the post on the forum \[here\](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/3).
> 
> I just updated to 2.31.1 and now whenever I upload an image I get a 502 error. I'm using a DO droplet.
> 
> I tried debugging with \`ghost run\` but then it works. However, when I go back to \`ghost start\` it gives me 502s again.
> 
> \### Technical details:
> 
> \* Ghost Version: 2.31.1
> \* Node Version: 10.16.3

Btw, closed the GH issue to keep it clean there. We can reopen it if the bug is confirmed to be a Ghost core issue 😉

---

<div class="post-metadata">

**Author:** ![andreborud](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/andreborud/32/1237_2.png) [@andreborud](https://forum.ghost.org/u/andreborud)\
**Post date:** [October 7, 2019, 10:12am UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/6 "2019-10-07T10:12:32Z")

</div>

I’m having the same issue as the one mentioned by @naz.

I’m running ghost 2.31.1 with node 10.16.0.

Everything about running ghost seems to be working. Except when I try to upload images, then I get a message in ghost saying “something went wrong :(”. Inspecting the page only shows the following error “POST [https://andreborud.com/ghost/api/canary/admin/images/upload/](https://andreborud.com/ghost/api/canary/admin/images/upload/) 502” with no more info.

I have checked logs in ghost and nginx, no specific errors linked with this.

Uploading a theme however works fine with now complaints.

just tried stopping ghost and starting it with `ghost run` instead, then uploading the image works without problems.

What I have tried is to give all permissions to the ghost user of the content folder. Disable SELinux. And some different NGINX configurations. Nothing works. But `ghost run` did work. What does ghost run do differently over ghost start?

---

<div class="post-metadata">

**Author:** ![andreborud](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/andreborud/32/1237_2.png) [@andreborud](https://forum.ghost.org/u/andreborud)\
**Post date:** [October 8, 2019, 6:17am UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/7 "2019-10-08T06:17:13Z")

</div>

@naz what information could I add to make the issue worthy of reopening?

---

<div class="post-metadata">

**Author:** ![kiksy](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kiksy/32/4321_2.png) [@kiksy](https://forum.ghost.org/u/kiksy)\
**Post date:** [October 8, 2019, 8:17am UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/8 "2019-10-08T08:17:11Z")

</div>

I haven’t had chance to look into this any further. For me the upload issue was a bit of a red herring. The using ‘ghost run’ causes the process to die and restart regularly. Trying to upload seems to trigger a process death, but it will die without trying to upload, it’s just less noticeable as the process starts up so quick. ‘ghost run’ does not cause this behavior for me.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [October 28, 2019, 3:38pm UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/9 "2019-10-28T15:38:52Z")

</div>

Going to close this topic as it’s a duplicate of [502 Error after updating to v2 - #24 by ekerstein](https://forum.ghost.org/t/502-error-after-updating-to-v2/8552/24) - please post there if you have more info to share.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [October 28, 2019, 3:38pm UTC](https://forum.ghost.org/t/upgrade-to-2-28-1-502-on-image-upload/8721/10 "2019-10-28T15:38:57Z")

</div>

Closed on October 28, 2019, 3:38pm UTC


