techwithanirudh encountered issues after rebuilding Discourse on a DigitalOcean Droplet, including YAML syntax errors, 502 Bad Gateway errors, and SSL certificate problems. Initial troubleshooting by Falco focused on YAML indentation, but the issue persisted. Further investigation revealed a Ruby syntax error in the pups config, and despite reverting to a default app.yml, the site remained inaccessible. Tests with w3m confirmed a 502 error locally, pointing to backend or container issues. Canapin and JammyDodger suggested using a new subdomain to bypass Let’s Encrypt rate limits, while pfaffman recommended disabling Cloudflare’s proxy to isolate SSL issues. techwithanirudh switched to DNS-only mode but still faced 502 and connection errors. Even after verifying DNS records and running ./discourse-setup, the problem remained. The root cause was traced to the Discourse Chatbot plugin: its database index was present without the supporting library, preventing the container from starting. Following the official uninstall instructions resolved the issue. merefield confirmed the site was restored after removing the plugin’s index. techwithanirudh noted the lack of backups, prompting advice from Ed_S to always maintain backups. The resolution highlights the importance of plugin compatibility and proper cleanup during rebuilds.
I’ve been facing challenges with my Discourse setup:
YAML File and Syntax:
I’ve verified my YAML configuration using YamlLint; it didn’t flag any issues.
However, a syntax error popped up from a Ruby directory:
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/config.rb:148:in `block (2 levels) in run_commands': Invalid run command cd (SyntaxError)
...
from /usr/local/bin/pups:25:in `<main>'
Rebuild and Access:
I reverted to the default app.yml file and made some modifications. The rebuild was successful.
Yet, when I try accessing the site, I encounter these errors:
If you’re starting from scratch, you should try installing a fresh instance using a new subdomain. That should sidestep the letsencrypt rate limit if you’ve hit it.
Having cloudflare in front of your site is one way to see that let’s encrypt fails. I’d recommend using DNS-only until you’re sure that let’s encrypt is working correctly.
It sounds like the easy solution is to move to a different subdomain, or wait a week until let’s encrypt will give you a cert. The harder way is to add a second subdomain that points to your server and modify your app.yml to request a cert for both subdomains. Set up Let’s Encrypt with multiple domains. Since it appears that your problems started because you’re having trouble with YML formatting, this rather complicated solution might not work for you.
Latest Update: Post-execution of discourse-setup , navigating to home.techwithanirudh.com results in a “502 Bad Gateway” error. Here’s a snapshot of the error (referring to the attached image).
The giveaway here (atm) was the 502 due to the container not starting properly due to the index remaining in the db without supporting code in the postgres library. The uninstall instructions remove the index from the db so you can safely build without building the index library.