502 Bad Gateway - Unable to rebuild

I searched through most of the past 502 error topics and haven’t gotten to the bottom of this problem.

I have tried multiple times to rebuild discourse but it’s saying I don’t have enough memory.

I have tried clearing memory with no luck.

For the past 5 - 6 months I haven’t had any issues with memory. Plus I haven’t really added all that much on to the discourse site. It’s just been sitting there while I build out a website.

Do I need to upgrade my memory or is there a way to clear out old updates. It has been a few weeks since the last time I updated Discourse and I believe this took up some space. I’m wondering what I can do to clear memory or if I should consider paying for more memory.

Ideally, I’d prefer to find a solution instead of spending more on space. I have 25 GB server at this moment.

You could try to add to your rebuild command the --skip-prereqs flag (but be sure to have downloaded a backup and your app.yml beforehand, just in case)

1 Like

If you are unable to shrink the 15GB in use your only option is more disk space. No matter what, there needs to be enough space for the tmp downloads during the rebuild process.

1 Like

I was able to resolve this.

Thank you @Benjamin_D & @MarcP for reaching out to me. I appreciate you guys taking the time to write to me.


Glad it’s sorted out. (I much prefer to say “storage” when I mean disk space, and “memory” when I mean RAM.) In this case, your problem was a lack of storage space - and indeed, a 25G instance is quite small, but still practical for a small forum. It’s always true that upgrading (updating, rebuilding) demands more resources than just running the forum.

As a tip for anyone in future, see perhaps here:

Or here: