Line 481 error for ./discourse-setup

AI-generated summary

The discussion revolves around a “Line 481 error” encountered when running the ./discourse-setup file. Daily_SHOCK initially reported the issue, mentioning that the same setup guide worked a few days prior. watchmanmonitor identified the problem as stemming from a recent commit and submitted a pull request to fix it.

Further investigation by Daily_SHOCK revealed that the issue is related to the Let’s Encrypt setup. The pull request was merged by mpalmer, resolving the issue. codinghorror acknowledged the mistake, explaining that it was caused by an attempt to remove unnecessary verbosity, which resulted in an empty if statement not allowed in bash.

Hey guys,

I was prompted with this error when i am trying to run discourse-setup file:

root@forum:/var/discourse# ./discourse-setup
./discourse-setup: line 481: syntax error near unexpected token `else'
./discourse-setup: line 481: `      else'

Oddly enough, i did exactly the same guide from github a few days ago and it worked perfectly.

My server is a 2GB RAM server on Ubuntu 16.04 from Vultr.

Please note, i have tried this on various servers but it didn’t work :-s Not sure what i did wrong tbh.

Thanks in advance guys.

just in case this actually make any difference, the reason that i reinstall Discourse is because i just finished the full verification from mailgun today.

To save myself from trouble, i am trying to reinstall everything.

It’s from a recent commit, I’ve submitted a PR here

I’m not sure if that’s desired direction for the fix

https://github.com/discourse/discourse_docker/pull/342

Oh it seems this only happens today, as i checked the discourse-setup file it seems it is related to letsencrypt set up.

My set up a few days ago was 100% smooth with 0 error, so i guess you are right :smiley:

PR merged; thanks @watchmanmonitor.

Sorry my bad, I wanted to remove some extra verboseness that @pfaffman added (we don’t need to be notified of every single expected default) and I did not realize an empty if then statement was not allowed in bash. Thanks for the fix.