502 Bad Gateway after failed upgrade

(Surya Sasmita) #1


My discourse upgrade failed just like on these posts

but I am still lost at 502 Bad Gateway.

After the upgrade failed, I read that I should restart the app. Unfortunately and stupidly I reboot the server then 502 bad gateway happened

How I can fix this? at least get me back to the site and maybe postpone the upgrade

yes, I am aware that my discourse installation is under the required memory spec

(Surya Sasmita) #2

Fixed it.

After trying furiously start, stop, restart the app and docker, even re-bootstraping. A simple rebuild is fixing my issue.

Now, how can I make sure the upgrade process won’t fail to allocate memories anymore? I am using 512 MB DO droplets and never had any problems till this upgrade (my community is still small and I will definitely upgrade to minimum required mem of 1 GB later as my community grows)

(Jeff Atwood) #3

Did you set up a swapfile?

(Surya Sasmita) #4

Yes, I have set swapfile, but free mem -m shows that swapfile is not used


This guide may be helpful to you.
Execute sudo swapon /swapfile and the swap file should be used. Just remember to edit fstab too.

(Surya Sasmita) #6

I am pretty sure I already turned on swapfile with that command, I’ll re-check and double check it again.

(Surya Sasmita) #7

I have checked that swapfile is enabled and already on fstab

swapon -s shows it is used, but on free mem shows it is not used

(Jeff Atwood) #8

It’s set to a low level of vm.swappiness, meaning it will only be used if memory gets urgent. Google that term if you need background.

It is weird to see no use at all over time though, there should be a little, especially on an unsupported ultra-low mem situation like yours…

(Surya Sasmita) #9

ah yes, the swappines,
If I set it as the tutorial I follow, it should be at 60. Anyway, now I understand how to prevent fails on future update. Thank you for your help and patient to deal with my problem