Redis port already taken


(Shadow Pauler) #1

This should be simple, but I cannot find it.

Does anyone know where I can change the Redis port for the Redis standalone server in the image with Discourse?

I keep rebuilding it and getting the port is already taken, but if I leave it like that, Discourse breaks itself and stops, becoming 100% non-responsive, deleting the errors and logs by itself.


(Jay Pfaffman) #2

Are you following discourse/INSTALL-cloud.md at master · discourse/discourse · GitHub? Do you have another redis running outside of the container?


(Shadow Pauler) #3

Yes I am, and I have no Redis Servers already running, that’s why I’m so confused and that’s why I wanna change the port number. I followed all instructions carefully. Once the entire image rebuilds, at the very end, it stops the Redis Server inside Discourse and completely shuts down.


(Felix Freiberger) #4

That is normal – at the end of bootstrapping, the container is shut down and the image is saved. Depending on which command you used, the resulting image is then started automatically. What is your problem, exactly? Can you post the full output of the command you ran?


(Jay Pfaffman) #5

I just ran a standard install and it worked fine.


(Jeff Atwood) #6

And I trust you would let us know if this ever changes in the future :wink:

If the standard install is broken we need to know ASAP!


(Jay Pfaffman) #7

Ever since the first time I broke discourse-setup I pay pretty close attention. :slight_smile:

When I see someone reporting a problem with an install I generally run my custom install script like this:

install-generator hostname

and copy and paste that output into a terminal; A droplet is created, mailgun is configured, DNS is set up, discourse-setup is run, and a few minutes later, I get an email and a new tab opens with the new Discourse instance that looks like this:

image

At some point I’ll spend a few more hours to save the dozen seconds it takes to copy and paste that output and just run the install, because


(Shadow Pauler) #8

All I ran was the rebuild command, in the Discourse directory, and it built it you know, and I use Portainer to watch the logs, and the top log, Redis stops when trying to connecting to the port, the install continues. I’m not on my PC at the moment. But it installs and everything, no errors, but at the end, it stops saying Redis has shut down, bye bye. and it stops. Nothing happens. It turns off, I turn it right back on, and the logs show nothing and they don’t even exist.


(Shadow Pauler) #9

Will do, I’ll try that.

Here are the Redis logs…

https://pastebin.com/TASU9Dha

Here are the installation logs…

Will be added in a few minutes


(Shadow Pauler) #10

I cannot get the logs. The container keeps deleting them after Redis shuts down.

So I have to wait an entire hour watching it if I need the logs :frowning:

But it did exit with exit code 1


(Jay Pfaffman) #11

An hour? Where are you doing this?

I suspect that the problem is something else.

What is the last thing that is printed in the ./launcher rebuild app?


(Shadow Pauler) #12

I am doing this on Docker on my PC, with Ubuntu Server, at the end it says “Redis is now ready to exit, bye bye”


(Jay Pfaffman) #13

And it doesn’t then print a line that starts like this:

+ /usr/bin/docker run -d --restart=always  .....

(Shadow Pauler) #14

That I last saw, no, it does not.

It shuts down, it doesn’t restart.

If I restart it, the logs don’t even exist.

If you wish, I can give you access to the container or server if you wanna check it out.

I was also able to get as much logs as I could earlier, but I didn’t have time to wait a full hour, so I left it running, but when I came back, the logs were gone.

https://pastebin.com/GZyuxwbN

Wait, I got something. But some reason trying to look at the log, I’m lagging out.


(Jay Pfaffman) #15

It just starts the docker container and stops.

Have you tried pointing a web browser at your server?

What does

docker ps

say?


(Shadow Pauler) #16

I rebuilt it, and I didn’t get this earlier, but I did modify the SSL Certificate locations, and I got this.

I, [2017-11-09T17:28:20.399004 #13]  INFO -- : Replacing (?-mix:location @discourse {) with location @discourse {
  limit_conn connperip $conn_per_ip;
  limit_req zone=flood burst=$burst_per_second nodelay;
  limit_req zone=bot burst=$burst_per_minute nodelay; in /etc/nginx/conf.d/discourse.conf
I, [2017-11-09T17:28:20.405225 #13]  INFO -- : > mkdir -p /shared/ssl/
mkdir: cannot create directory ‘/shared/ssl/’: File exists
I, [2017-11-09T17:28:20.493449 #13]  INFO -- : 
I, [2017-11-09T17:28:20.499844 #13]  INFO -- : Terminating async processes
I, [2017-11-09T17:28:20.500689 #13]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 42
2017-11-09 17:28:20.501 UTC [42] LOG:  received fast shutdown request
2017-11-09 17:28:20.502 UTC [42] LOG:  aborting any active transactions
2017-11-09 17:28:20.504 UTC [49] LOG:  autovacuum launcher shutting down
I, [2017-11-09T17:28:20.517555 #13]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 155
2017-11-09 17:28:20.569 UTC [46] LOG:  shutting down
2017-11-09 17:28:20.819 UTC [46] LOG:  database system is shut down

(Jay Pfaffman) #17

Oh. You never mentioned that.

Where did you modify them?


(Shadow Pauler) #18

Right after it failed for the 8th time. I did it a 9th time because I thought it was my SSL certificates since I did get in my browser that it did not respond with a https:// connection. The 8th time is when I got the Redis message at the very end. I can reverse my changes, want me too?


(Felix Freiberger) #19

Something is still weird here, I’m pretty sure you misunderstood one of the instructions. Can you write down what you do, exactly, when you retry bootstrapping / starting Discourse, and what happens?

What do you mean by this, exactly?

Where are you expecting the logs to be?


(Shadow Pauler) #20

Sorry, my mistake, it just takes about 3 minutes to load, but it lags badly.