Odk central stop work after trying to Move the Docker data directory to the new volume.
I follow the intruction to the nex link recommended in the installation documentation, and my server does not work after that, i try to fix but at thi moment i'm stuck in the proccess
I have managed to rebuild the server, but now I have an error with the nginx service, and check the long and is looking for some non-existent files in thir dir "/etc/dh/nginx.pem", copy the files to this location and still not lift the service correctly
Nginx Logs:
nginx_1 | writing a new nginx configuration file..
nginx_1 | starting nginx with certbot..
nginx_1 | Starting the Nginx service
nginx_1 | Starting the autorenewal service
nginx_1 | 2022/12/19 20:22:08 [emerg] 78#78: PEM_read_bio_DHparams("/etc/dh/nginx.pem") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: DH PARAMETERS)
nginx_1 | nginx: [emerg] PEM_read_bio_DHparams("/etc/dh/nginx.pem") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: DH PARAMETERS)
nginx_1 | writing a new nginx configuration file..
nginx_1 | starting nginx with certbot..
nginx_1 | Starting the Nginx service
nginx_1 | Starting the autorenewal service
nginx_1 | 2022/12/19 20:23:16 [emerg] 78#78: PEM_read_bio_DHparams("/etc/dh/nginx.pem") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: DH PARAMETERS)
nginx_1 | nginx: [emerg] PEM_read_bio_DHparams("/etc/dh/nginx.pem") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: DH PARAMETERS)
Docker compose Status:
root@mcticentral:~/central# docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------
central_enketo_1 docker-entrypoint.sh /bin/ ... Up 8005/tcp
central_enketo_redis_cache_1 docker-entrypoint.sh redis ... Up 6379/tcp
central_enketo_redis_main_1 docker-entrypoint.sh redis ... Up 6379/tcp
central_mail_1 /bin/entrypoint.sh exim -b ... Up 25/tcp
central_nginx_1 /bin/bash /scripts/odk-set ... Restarting
central_postgres_1 docker-entrypoint.sh postgres Up 5432/tcp
central_pyxform_1 gunicorn --bind 0.0.0.0:80 ... Up
central_secrets_1 docker-entrypoint.sh ./gen ... Exit 0
central_service_1 docker-entrypoint.sh ./wai ... Up 8383/tcp
root@mcticentral:~/central#
Error response from daemon: Container (Container name) is restarting, wait until the container is running
i manualy check my nginx.pem file and, yes the file are empty
if i try to run this other command:
docker-compose exec nginx rm /etc/dh/nginx.pem
the server response the same:
Error response from daemon: Container (Container name) is restarting, wait until the container is running
my odk central server it's up to date to the last version, the problem appeared when i try to move docker to another place in my server because in the root directory i don't have enough space to continue recolecting data for teh project.
can i copy an old file from some place to replace? or better, generate a new file?
after the new procedure that you suggesting me, and re-build my odk central server, the result was the next:
docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------------------------------
central_enketo_1 docker-entrypoint.sh /bin/ Up 8005/tcp
...
central_enketo_redis_cache_1 docker-entrypoint.sh redis Up 6379/tcp
...
central_enketo_redis_main_1 docker-entrypoint.sh redis Up 6379/tcp
...
central_mail_1 /bin/entrypoint.sh exim -b Up 25/tcp
...
central_nginx_1 /bin/bash /scripts/odk-set Up (unhealthy) 0.0.0.0:443->443/tcp,:::443-
... >443/tcp, 0.0.0.0:80->80/tcp
,:::80->80/tcp
central_postgres_1 docker-entrypoint.sh postgres Up 5432/tcp
central_pyxform_1 gunicorn --bind 0.0.0.0:80 Up
...
central_secrets_1 docker-entrypoint.sh ./gen Exit 0
...
central_service_1 docker-entrypoint.sh ./wai Up 8383/tcp
...
i was check the nginx logs with this command
docker-compose logs nginx
teh result was here:
Attaching to central_nginx_1
nginx_1 | diffie hellman private key does not exist; creating..
nginx_1 | Generating DH parameters, 2048 bit long safe prime, generator 2
nginx_1 | This is going to take a long time
if i try to connect by the local IP address, the web browser showme the portal, but when i try to log in with my user and pass the portal was rejecting me.
At this stage, you have to wait to docker-compose logs nginx to show successful generation of the key. It usually only takes a few minutes, even on slow machines.
Can you confirm that you changed the file back, so the rm command has been removed?
It sounds like your install is working well, but in your move of the docker data folder, you've lost the link to your old database. That's probably why you can't login, your install is probably pointing to a new database.
@diego_villanueva I think what might be easiest at this stage is if we get access to your server. I will send you an email so we can coordinate that process and update this public topic once we have a resolution.
I investigated the issues on this server, and unfortunately, I could not get the old database back.
My guess is that something went wrong when the Docker data directory was moved and without a whole machine backup or a backup of the data directory, there was no way to roll back. I've suggested extundelete and TestDisk as a last resort, but I'm not optimistic those will work.
Data loss is the worst and I feel terrible that this has happened. It's an unfortunate reminder that running production servers is hard work. We'll continue to strongly recommend that self-hosters set up backups so they have a safety-net.
If anyone has other ideas on how we can help prevent these kinds of issues, please share.