Issue after Rebuilding Discourse on Digital Ocean Droplet

AI-generated summary

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 successfully deployed Discourse on a Digital Ocean Droplet, but after initiating a rebuild, I encountered problems.

  • Logs: View Here - Notably, there’s an “x86_64 arch detected” message.
  • App.yml Configuration: View Here

Has anyone faced a similar issue? Would appreciate any insights or solutions.

Lines 99 til 101 are in the wrong indentation level, they need one more. See here for a proper example:

Done! I’m stilling getting the same issue, though

You can try passing the whole YAML file through a linter to check for more issues.

I’ve been facing challenges with my Discourse setup:

  1. 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>'
      
  2. Rebuild and Access:

  3. W3M Browser Test:

    • To further diagnose, I installed w3m, a terminal browser, on the droplet.
    • Accessing localhost resulted in a ‘502 bad gateway’ error:
  4. SSL Issues

    • I thought this might be a SSL issue and am now renewing the ssl certs

Any insights or help would be greatly appreciated!

My forum’s down from 2 days.

It might be, if you reached their request limit. How did your review end?

Do you have a backup of your forum, and did you try restoring it on another server? If my forum were down for 2 days, I’d take 30 minutes to try that.

I don’t have a backup of my forum, I’m very new to setting up discourse.

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. :+1:

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.

I already have users and data, I don’t want to lose everything and start from scratch

Thanks for the tip! It’s now on DNS only! :slightly_smiling_face:

Edit: I’m now also getting image error,

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.

Then you absolutely need to be sure you have a backup, and have it somewhere safe.

Thanks for the idea, I used a different subdomain now, but I’m having the same issue.

A ‘502’ and a ‘Connection Refused’.

Does your DNS for the subdomain point to that server IP address? And you don’t have any other A or AAAA records for the subdomain?

I recommend that you run ./discourse-setup that will check that incoming connections to your domain are reaching your server.

Can you ssh to your server by hostname with ssh user@subdomain.yoursite.com (or whatever your subdomain?

Yes, I’ve ensured the DNS for the subdomain points to the server IP address, and there are no other conflicting A or AAAA records for it.

I’ve executed the command and here’s the output

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).

Absolutely, SSH-ing into the server using the hostname works perfectly.

I worked with @techwithanirudh offline to resolve this … @techwithanirudh wasn’t aware of the chatbot uninstall instructions.

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.

@techwithanirudh’s site is now up and running.