Central installation - docker-compose ps returned status

Good evening,

I just performed a first, fresh central install following the clear documentation page :slight_smile:
The server seems to be ok but docker-compose ps returns an exit0 status for the "secrets" container.

root@scw-central:~/central# docker-compose ps
       Name                     Command                   State                         Ports                  
---------------------------------------------------------------------------------------------------------------
central_postgres_1   docker-entrypoint.sh postgres    Up               5432/tcp                                
enketo               docker-entrypoint.sh /bin/ ...   Up               8005/tcp                                
enketo_redis_cache   docker-entrypoint.sh redis ...   Up               6379/tcp                                
enketo_redis_main    docker-entrypoint.sh redis ...   Up               6379/tcp                                
mail                 /bin/entrypoint.sh exim -b ...   Up               25/tcp                                  
nginx                /bin/bash /scripts/odk-set ...   Up (unhealthy)   0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
pyxform              waitress-serve --port=80 - ...   Up                                                       
secrets              docker-entrypoint.sh ./gen ...   Exit 0                                                   
service              docker-entrypoint.sh ./wai ...   Up               8383/tcp   

Is that normal ?

Hi

I've got the same output as yours - including the unhealthy nginx container. So maybe a bug?

hey all.

what happens when you restart the service (systemctl restart docker-compose@central), give it a little time to settle down, then run

docker-compose logs nginx

in the central/ directory?

Hi Issa,

is a docker-compose restart ok too ?
Here are nginx's logs (I deleted the line created before restart)

nginx                 | writing a new nginx configuration file..
nginx                 | starting nginx with certbot..
nginx                 | symlinking scripts from /etc/nginx/user.conf.d to /etc/nginx/conf.d
nginx                 | no /etc/nginx/user.conf.d, nothing to do.
nginx                 | Done with startup
nginx                 | Run certbot
nginx                 | ++ parse_domains
nginx                 | ++ for conf_file in /etc/nginx/conf.d/*.conf*
nginx                 | ++ xargs echo
nginx                 | ++ sed -n -e 's&^\s*ssl_certificate_key\s*\/etc/letsencrypt/live/\(.*\)/privkey.pem;&\1&p' /etc/nginx/conf.d/certbot.conf
nginx                 | ++ for conf_file in /etc/nginx/conf.d/*.conf*
nginx                 | ++ xargs echo
nginx                 | ++ sed -n -e 's&^\s*ssl_certificate_key\s*\/etc/letsencrypt/live/\(.*\)/privkey.pem;&\1&p' /etc/nginx/conf.d/odk.conf
nginx                 | + for domain in $(parse_domains)
nginx                 | + is_renewal_required central.sicen.fr
nginx                 | + last_renewal_file=/etc/letsencrypt/live/central.sicen.fr/privkey.pem
nginx                 | + '[' '!' -e /etc/letsencrypt/live/central.sicen.fr/privkey.pem ']'
nginx                 | + one_week_sec=604800
nginx                 | ++ date -d now +%s
nginx                 | + now_sec=1599806685
nginx                 | ++ stat -c %Y /etc/letsencrypt/live/central.sicen.fr/privkey.pem
nginx                 | + last_renewal_sec=1599511077
nginx                 | + last_renewal_delta_sec=295608
nginx                 | + is_finshed_week_sec=309192
nginx                 | + '[' 309192 -lt 0 ']'
nginx                 | + echo 'Not run certbot for central.sicen.fr; last renewal happened just recently.'
nginx                 | Not run certbot for central.sicen.fr; last renewal happened just recently.
nginx                 | + auto_enable_configs
nginx                 | + for conf_file in /etc/nginx/conf.d/*.conf*
nginx                 | + keyfiles_exist /etc/nginx/conf.d/certbot.conf
nginx                 | ++ parse_keyfiles /etc/nginx/conf.d/certbot.conf
nginx                 | ++ sed -n -e 's&^\s*ssl_certificate_key\s*\(.*\);&\1&p' /etc/nginx/conf.d/certbot.conf
nginx                 | + return 0
nginx                 | + '[' conf = nokey ']'
nginx                 | + for conf_file in /etc/nginx/conf.d/*.conf*
nginx                 | + keyfiles_exist /etc/nginx/conf.d/odk.conf
nginx                 | ++ parse_keyfiles /etc/nginx/conf.d/odk.conf
nginx                 | ++ sed -n -e 's&^\s*ssl_certificate_key\s*\(.*\);&\1&p' /etc/nginx/conf.d/odk.conf
nginx                 | + for keyfile in $(parse_keyfiles $1)
nginx                 | + currentfile=/etc/letsencrypt/live/central.sicen.fr/privkey.pem
nginx                 | + '[' '!' -f /etc/letsencrypt/live/central.sicen.fr/privkey.pem ']'
nginx                 | + return 0
nginx                 | + '[' conf = nokey ']'
nginx                 | + sleep 5
nginx                 | + kill -HUP 16
nginx                 | + set +x

and docker-compose ps

       Name                     Command                  State                        Ports                  
-------------------------------------------------------------------------------------------------------------
central_postgres_1   docker-entrypoint.sh postgres    Up             0.0.0.0:5432->5432/tcp                  
enketo               docker-entrypoint.sh /bin/ ...   Up             8005/tcp                                
enketo_redis_cache   docker-entrypoint.sh redis ...   Up             6379/tcp                                
enketo_redis_main    docker-entrypoint.sh redis ...   Up             6379/tcp                                
mail                 /bin/entrypoint.sh exim -b ...   Up             25/tcp                                  
nginx                /bin/bash /scripts/odk-set ...   Up (healthy)   0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
pyxform              waitress-serve --port=80 - ...   Up                                                     
secrets              docker-entrypoint.sh ./gen ...   Exit 0                                                 
service              docker-entrypoint.sh ./wai ...   Up             8383/tcp        

I get exactly the same output, with nginx showing as Up (unhealthy) and secrets as Exit 0. Help!

I think this is the expected behavior but @issa will need to confirm. It's what I see on my servers as well.

The secrets container is used generate an API key and encryption keys to pass on for the Enketo build. It runs a script and then is no longer needed. There's no ongoing foreground process so its status is Exit 0.

What happens when you try to access your servers, @Morck, @AlexCF?

@mathieubossaert were you always able to access yours? The more troubling part about your initial ps output was the unhealthy state for nginx but I don't think you asked about that. Either way, @issa's suggestion seemed to resolve it which is good.

Yes my server works fine...

1 Like

yeah 0 indicates a normal Exit. i will amend the documentation for next release to include this.

3 Likes

I also experienced the same but after some time (30 minutes) i rebooted the server and the status changed to healthy...

1 Like