New install fails on Ubuntu 20.04.3 LTS

New install on new EC2 instance with standard setup fails. launched an EC2 instance on AWS of Ubuntu 20.04.3 did all the latest ubuntu updates. Ran the simple standard install found here

sudo -s
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse

./discourse-setup

The only nuance is that when setup ran it failed to connect to the server via HTTP(S) - I had forgotten to open up the two incoming ports on AWS. So I manually configured my app.yml file and ran ./launcher rebuild app after opening the ports on the AWS security group.

the browser is unable to connect and my production log shows this.

/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/message_bus-3.3.6/lib/message_bus.rb:729:in `block in new_subscriber_thread'
Job exception: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Job exception: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Job exception: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Job exception: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Job exception: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Job exception: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL) subscribe failed, reconnecting in 1 second. Call stack /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/redis-4.4.0/lib/redis/client.rb:384:in `rescue in establish_connection'

I launched a new EC2 because I was using a repurposed server also Ubuntu 20.04.3 that had the exact same issue when I installed discourse. The same errors in the production log. So I thought let me start from scratch and make this simple

Have you tried to reboot ?

Yes I started and stopped the instance and rebooted on the command line. no help

OK, now I am pretty convinced that there is a problem with the discourse installer when it comes to using Ubuntu 20.04.3 with the latest updates. I just ran through the installer again and this time I was sure to have the ports open so I never had to manually configure the app.yml file (removing human error). Everything seemed like it went smooth installed found the domain and all. However…no site. Production log shows

/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/message_bus-3.3.6/lib/message_bus.rb:729:in `block in new_subscriber_thread'
Job exception: Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL)

Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL) subscribe failed, reconnecting in 1 second. Call stack /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/redis-4.4.0/lib/redis/client.rb:384:in `rescue in establish_connection'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/redis-4.4.0/lib/redis/client.rb:365:in `establish_connection'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/redis-4.4.0/lib/redis/client.rb:117:in `block in connect'

This is too simple for me to have done anything wrong this time and I only ran the scripts.

Do you have another redis installed?

Goes much ram do you have? Did it create swap?

I don’t have anything installed. It’s a new EC2 instance t2.small so it’s 2gb ram. I have to see the standard swap it creates

Here’s the RAM and swap info. It is a vanilla newly launched AWS instance with all standard ubuntu updates it’s a EC2 - t2.small instance. Nothing was changed, added, configured or modified. Only commands used to update before installing were basic sudo apt update and sudo apt upgrade 3rd timed I tried the vanilla discourse install on two separate instances same OS (Ubuntu 20.04.3). That is why I am under the belief that there may be something wrong with the installer and the recent version.

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       973Mi       131Mi        36Mi       875Mi       855Mi
Swap:         2.0Gi       0.0Ki       2.0Gi

Disk space if that was of any concern

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        39G  7.8G   31G  20% /

I just ran an install on a new Digital Ocean droplet and it worked fine. It’s not the installer.

My best guess, but doesn’t make sense that you’d have the Redis error, is that you ran the installer enough times that you hit the let’s encrypt rate limit and that’w what the real problem is.

Try again with a different domain name (e.g., forum2.example.com).

2 Likes

Bingo! you are correct once more it worked.

OK, So I have been rebuilding a lot because i have been testing to transfer over a forum from an old server.

How the heck do i get around this problem. I don’t even use let’s encrypt. After the successful install I updated the app.yml file to change the domain and made sure the Lets encrypt template was commented out in the app.yml and rebuilt but that does not help and i get the same problem Redis failure, am I stuck because calling lets encrypt is baked into the installer?

Unless you are using a reverse proxy to provide https, then you can’t do that. You have to have https. And if you remove the lets encrypt you must also remove the https template (whatever it’s called).

I don’t quite understand why you’re getting the redis error; maybe you commented out redis when you commented out lets encrypt? That’s my best guess.

You can try following Setting up Let’s Encrypt with Multiple Domains to add a second domain name, or wait a week.

Well, if you read through the thread it did a simple install on a brand new instance so I couldn’t comment out anything as the installer, based on the questions is what creates the app.yml. So the Redis failure is directly related to the Let’s encrypt rate limit. if that can help the dev team in any way.

I am using a proxy or rather Cloudflare to serve the SSL Cert and connect/deliver only HTTPS.

I tested commenting out the https template - “templates/web.ssl.template.yml” and did a launcher rebuild app of course while having the let’s encrypt template commented out also and the same thing happened. Redis error. So I guess I am stuck, right? What a crappy installer decision, not to have a way to bypass the let’s encrypt calls. Unless you can provide me something else to try patience will be a virtue on this. I really appreciate all your help. I stay humbly frustrated.

1 Like

That makes things a lot more difficult and you’ll have some other trouble down the line unless you carefully search about how do use cloudflare without breaking Discourse.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.