HTTP -> HTTPS redirect Rockon breaking WebUI on boot

Basically, it appears that this Rockon is binding port 80 before nginx can, making the WebUI fail to load on a reboot.
If I SSH into the box, stop the docker, and then run systemctl restart rockstor nginx, and the WebUI, fires right up.

For anyone else getting this weirdness the two commands you’ll want are docker ps to show running containers and docker stop [container id] to kill the Rockon.

Not really sure how to fix this one; happy to provide any logs.

Running stable 3.9.0-0

@wraeuk Hello again. Nice find and thanks for the report; but if nginx is no longer requesting port 80 I’m puzzled on why it’s fussed that it’s not available. Also I wasn’t able to reproduce this:

No rock-ons Rockstor admin UI OK (https only)
install http->https redirect (using suggested 80 port)
admin UI OK still (but also worked via http)
reboot
admin UI OK still by http & https

and after the reboot I also have:

docker ps
CONTAINER ID        IMAGE                   COMMAND              CREATED             STATUS              PORTS                NAMES
d1860402e5d7        geldim/https-redirect   "/bin/sh -c nginx"   About an hour ago   Up 21 minutes       0.0.0.0:80->80/tcp   redirect-http-to-https

second reboot and no change.

However my test setup was a KVM virtual machine using DHCP.
Not sure what could be going on.
Have you looked at your:

/var/log/nginx/error.log

for any clues?

The Rockstor version I tested this on was my current dev release which is ahead of testing but don’t think there has been any network or docker related changes since 3.9.0 anyway.

With the Rock-on switched off I get:

curl -i -k "http://rockdev.local"
curl: (7) Failed to connect to rockdev.local port 80: Connection refused

and with it switched back on again I get:

curl -i -k "http://rockdev.local"
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Sun, 14 May 2017 12:23:05 GMT
Content-Type: text/html
Content-Length: 184
Connection: keep-alive
Location: https://rockdev.local/

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

And Rockstor’s version of nginx is much newer:

yum info nginx | grep 'Version'
Version     : 1.10.2

Hears a thing though:

curl -I -k "https://rockdev.local"
HTTP/1.1 200 OK
Date: Sun, 14 May 2017 12:34:34 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=20
Server: gunicorn/0.16.1
Vary: Cookie
...

Note the Server: gunicorn/0.16.1
So looking to your:

/opt/rockstor/var/log/gunicorn.log

Might be of use also.

Hopefully this will help with diagnosing things further, but I don’t get the same admin UI blocking behaviour you describe here.

nginx

2017/05/14 15:42:16 [emerg] 14468#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 15:42:17 [emerg] 14510#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 15:42:19 [emerg] 14540#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 15:42:22 [emerg] 14585#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 15:55:16 [emerg] 25066#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 15:55:17 [emerg] 25142#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 15:55:19 [emerg] 25529#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 15:55:22 [emerg] 25930#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:02:23 [emerg] 8618#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:02:24 [emerg] 9611#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:02:26 [emerg] 10680#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:03:20 [emerg] 10681#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:14 [emerg] 15847#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:15 [emerg] 15881#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:17 [emerg] 16171#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:20 [emerg] 16346#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:29 [emerg] 16517#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:30 [emerg] 16552#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:32 [emerg] 16554#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:12:35 [emerg] 16555#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:20:58 [emerg] 16857#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:20:59 [emerg] 16910#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:21:01 [emerg] 17317#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:21:04 [emerg] 17697#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to 0.0.0.0:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to [::]:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to 0.0.0.0:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to [::]:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to 0.0.0.0:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to [::]:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to 0.0.0.0:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to [::]:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to 0.0.0.0:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: bind() to [::]:80 failed (98: Address already in use) 2017/05/14 16:22:12 [emerg] 17777#0: still could not bind() 2017/05/14 16:24:29 [emerg] 18198#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:24:30 [emerg] 18232#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:24:32 [emerg] 18400#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:24:35 [emerg] 18618#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:25:15 [emerg] 19101#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:25:16 [emerg] 19136#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:25:18 [emerg] 19137#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:25:21 [emerg] 19138#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:26:13 [emerg] 19168#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:26:14 [emerg] 19202#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address) 2017/05/14 16:26:16 [emerg] 19204#0: bind() to 192.168.1.22:443 failed (99: Cannot assign requested address)

My gunicorn logs end in 2016, so nothing useful there.