Hi @yanokwa,
Thanks for your reply. Will I be right to assume the Ubuntu System I'm running off the WSL will land me in the same soup?
Hi @yanokwa.
I created an Ubuntu VM and started the process to get Central running as you suggested.
However, I ran into another issue. When I execute docker-compose build
, it ends this time with
Service 'nginx' failed to build: The command '/bin/sh -c apt-get update; apt-get install -y openssl netcat nginx-extras lua-zlib' returned a non-zero code: 100
I found this within the forum and tried docker-compose logs nginx
and git status
. Guess its better if I just show you/the community the output of those.
Any ideas?
A little update.
I opened the nginx.dockerfile
in the central
directory and executed the command that throws the error (RUN apt-get update; apt-get install -y openssl netcat nginx-extras lua-zlib
) as root but without the 'run'. Funny thing was, it run just fine without any issues but reported the same error when I tried to build the project afterwards. What could be the issue?
The errors that are being shown look like network errors from a poor network connection. Try another docker-compose build
.
Hi again @yanokwa,
Didn't think it was network related but I tried another docker-compose build
anyway. As expected, I got the same errors. I went further to try get the file that yielded the first of those errors via a web browser and sure enough, it was available for download.
I took things a step further and checked the closest debian.org server and used Ookla for a speed test to a random server in the same area. Results can be seen attached.
Anything else I could try?
Dear,
this can be fixed easily:
1- in nginx.dockerfile add /bin/sh to those 2 lines:
RUN /bin/sh ./files/prebuild/write-version.sh
RUN /bin/sh ./files/prebuild/build-frontend.sh
Then replace the Windows EOL by linux EOLin all the files (Git wrongly configured to use CRLF instead of LF when writing the files)
br
Worked like a charm!
Thanks @delcroip.
After editing the 2 lines (as root), I used sed -i.bak 's/\r$//' nginx.dockerfile
to change the Windows EOL to Linux EOL and to create a backup file nginx.dockerfile.bak (you can ignore the -i.bak
if you don't need the backup file).
Leaving this here in case someone faces this issue.
Going forward with my installation. Will let the community know how it goes.
Hi,
My message was actually to make the windows docker working but if it helped for the linux one I happy for you
br
Hi community,
after my last success, I encountered an issue when I ran docker-compose up -d
. It reports that Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
but a quick look at the activity on the port with lsof -i:80
(as root) shows that it is occupied by the nginx.
Any ideas?
Hello again community
I was able to solve that issue. Turns out, I had nginx running globally on my instance of Ubuntu. To check if you have the same (ie if you're facing the same issue) run ps waux | grep nginx
. If you see more than one instance of nginx, then you may have nginx running globally as well.
To kill nginx global and be on your merry way, you can run sudo nginx -s stop
.
Let us know if this helps.
Ciao!
Here I am again
New day, new error. After running docker-compose ps
nginx is marked as unhealthy.
Hi,
To troubleshoot it, connect to the nginx and run the healthcheck as defined in the docker-compose
nc -z localhost 443 || exit 1
by starting to test the left part
nc -z localhost 443
on my stack it doesn't return anything and it is shown as healthy
# nc -z localhost 443 || exit 1
# nc -z localhost 443
I should have asked you to check first hat was the HC result
docker inspect --format "{{json .State.Health }}" nginx
br
After executing command, this is what I got back.
{"Status":"unhealthy","FailingStreak":8333,"Log":[{"Start":"2020-09-21T04:55:17.372930056-04:00","End":"2020-09-21T04:55:17.474724042-04:00","ExitCode":1,"Output":"/bin/sh: 1: nc: not found\n"},{"Start":"2020-09-21T04:55:47.478806438-04:00","End":"2020-09-21T04:55:47.581083314-04:00","ExitCode":1,"Output":"/bin/sh: 1: nc: not found\n"},{"Start":"2020-09-21T04:56:17.584939398-04:00","End":"2020-09-21T04:56:17.688484183-04:00","ExitCode":1,"Output":"/bin/sh: 1: nc: not found\n"},{"Start":"2020-09-21T04:56:47.692954492-04:00","End":"2020-09-21T04:56:47.794798131-04:00","ExitCode":1,"Output":"/bin/sh: 1: nc: not found\n"},{"Start":"2020-09-21T04:57:17.7982906-04:00","End":"2020-09-21T04:57:17.901514048-04:00","ExitCode":1,"Output":"/bin/sh: 1: nc: not found\n"}]}
Then connect to the nginx container and install netcat
apt-get install netcat
This is not normal because netcat should be installed already (nginx.dockerfile) and it worked when you executed it manually (may be I am mistaken and you should install netcat on the host instead of the container)
RUN apt-get update; apt-get install -y openssl netcat nginx-extras lua-zlib
May be there is no link between nc and netcat, so you might want to update the health check in the docker-composer (line 40) but I doubt it
nginx:
container_name: nginx
build:
context: .
dockerfile: nginx.dockerfile
depends_on:
- service
- enketo
environment:
- SSL_TYPE=${SSL_TYPE}
- DOMAIN=${DOMAIN}
- CERTBOT_EMAIL=${SYSADMIN_EMAIL}
ports:
- "80:80"
- "443:443"
healthcheck:
test: [ "CMD-SHELL", "netcat -z localhost 443 || exit 1" ]
restart: always
br
Did you try to rebuild everything after you change the EOL? (this will remove all container and image, be careful if you have a bad internet connectivity, that means downloading them all over again)
docker-compose down --rmi all
br
A dialogue between terminal and yours truly...lol
: docker exec -it ebfaecfd15fb bash
: <got into root@ebfaecfd15fb>
: apt-get install netcat
: E: Unable to locate package netcat
: apt-get update --fix-missing
: Reading package lists... Done
: apt-get install netcat
: Setting up netcat (1.10-41.1) ...
: RUN apt-get update; apt-get install -y openssl netcat nginx-extras lua-zlib
: E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
: apt-get update --fix-missing
: Reading package lists... Done
: RUN apt-get update; apt-get install -y openssl netcat nginx-extras lua-zlib
:
bash: RUN: command not found
Reading package lists... Done
Building dependency tree
Reading state information... Done
netcat is already the newest version (1.10-41.1).
The following additional packages will be installed:
libgdbm-compat4 libgdbm6 libhiredis0.14 libluajit-5.1-2 libluajit-5.1-common
libnginx-mod-http-auth-pam libnginx-mod-http-cache-purge libnginx-mod-http-dav-ext
libnginx-mod-http-echo libnginx-mod-http-fancyindex libnginx-mod-http-geoip
libnginx-mod-http-headers-more-filter libnginx-mod-http-image-filter libnginx-mod-http-lua
libnginx-mod-http-ndk libnginx-mod-http-perl libnginx-mod-http-subs-filter
libnginx-mod-http-uploadprogress libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-nchan libnginx-mod-stream libperl5.28 netbase nginx-common perl
perl-base perl-modules-5.28
Suggested packages:
gdbm-l10n fcgiwrap nginx-doc ssl-cert perl-doc libterm-readline-gnu-perl
| libterm-readline-perl-perl make libb-debug-perl liblocale-codes-perl
The following packages will be REMOVED:
nginx nginx-module-geoip nginx-module-image-filter nginx-module-njs nginx-module-xslt
The following NEW packages will be installed:
libgdbm-compat4 libgdbm6 libhiredis0.14 libluajit-5.1-2 libluajit-5.1-common
libnginx-mod-http-auth-pam libnginx-mod-http-cache-purge libnginx-mod-http-dav-ext
libnginx-mod-http-echo libnginx-mod-http-fancyindex libnginx-mod-http-geoip
libnginx-mod-http-headers-more-filter libnginx-mod-http-image-filter libnginx-mod-http-lua
libnginx-mod-http-ndk libnginx-mod-http-perl libnginx-mod-http-subs-filter
libnginx-mod-http-uploadprogress libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-nchan libnginx-mod-stream libperl5.28 lua-zlib netbase nginx-common
nginx-extras perl perl-modules-5.28
The following packages will be upgraded:
openssl perl-base
2 upgraded, 30 newly installed, 5 to remove and 22 not upgraded.
Need to get 12.5 MB of archives.
After this operation, 47.2 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 perl-base amd64 5.28.1-6+deb10u1 [1514 kB]
Get:2 http://security.debian.org/debian-security buster/updates/main amd64 nginx-common all 1.14.2-2+deb10u3 [121 kB]
Err:3 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-auth-pam amd64 1.14.2-2+deb10u3
400 Bad Request [IP: 151.101.248.204 80]
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-cache-purge amd64 1.14.2-2+deb10u3 [95.1 kB]
Err:5 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-dav-ext amd64 1.14.2-2+deb10u3
400 Bad Request [IP: 151.101.248.204 80]
Get:6 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-echo amd64 1.14.2-2+deb10u3 [104 kB]
Get:7 http://deb.debian.org/debian buster/main amd64 perl-modules-5.28 all 5.28.1-6+deb10u1 [2873 kB]
Err:8 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-fancyindex amd64 1.14.2-2+deb10u3
400 Bad Request [IP: 151.101.248.204 80]
Get:9 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-geoip amd64 1.14.2-2+deb10u3 [94.0 kB]
Err:10 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-headers-more-filter amd64 1.14.2-2+deb10u3
400 Bad Request [IP: 151.101.248.204 80]
Get:11 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-image-filter amd64 1.14.2-2+deb10u3 [97.5 kB]
Get:12 http://deb.debian.org/debian buster/main amd64 libgdbm6 amd64 1.18.1-4 [64.7 kB]
Get:13 http://deb.debian.org/debian buster/main amd64 libgdbm-compat4 amd64 1.18.1-4 [44.1 kB]
Get:14 http://deb.debian.org/debian buster/main amd64 libperl5.28 amd64 5.28.1-6+deb10u1 [3894 kB]
Err:15 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-ndk amd64 1.14.2-2+deb10u3
501 Not Implemented [IP: 151.101.248.204 80]
Get:16 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-lua amd64 1.14.2-2+deb10u3 [238 kB]
Err:16 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-lua amd64 1.14.2-2+deb10u3
File has unexpected size (93232 != 237784). Mirror sync in progress? [IP: 151.101.248.204 80]
Hashes of expected file:
- SHA256:d7cb4d0582515209a6573e2f38114d235007c90ff0415628a91028116245cf19
- MD5Sum:9ef5b8b94974c3f206d915da72a97433 [weak]
- Filesize:237784 [weak]
Get:17 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-perl amd64 1.14.2-2+deb10u3 [105 kB]
Get:18 http://deb.debian.org/debian buster/main amd64 perl amd64 5.28.1-6+deb10u1 [204 kB]
Get:19 http://deb.debian.org/debian buster/main amd64 netbase all 5.6 [19.4 kB]
Get:20 http://deb.debian.org/debian buster/main amd64 libhiredis0.14 amd64 0.14.0-3 [33.8 kB]
Get:21 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-subs-filter amd64 1.14.2-2+deb10u3 [95.8 kB]
Get:22 http://deb.debian.org/debian buster/main amd64 libluajit-5.1-common all 2.1.0~beta3+dfsg-5.1 [46.7 kB]
Get:23 http://deb.debian.org/debian buster/main amd64 libluajit-5.1-2 amd64 2.1.0~beta3+dfsg-5.1 [230 kB]
Get:24 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-uploadprogress amd64 1.14.2-2+deb10u3 [99.4 kB]
Get:25 http://deb.debian.org/debian buster/main amd64 lua-zlib amd64 0.2+git+1+9622739-2.1 [9296 B]
Get:26 http://deb.debian.org/debian buster/main amd64 openssl amd64 1.1.1d-0+deb10u3 [844 kB]
Get:27 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-upstream-fair amd64 1.14.2-2+deb10u3 [95.9 kB]
Get:28 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.14.2-2+deb10u3 [95.8 kB]
Get:29 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-mail amd64 1.14.2-2+deb10u3 [126 kB]
Get:30 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-nchan amd64 1.14.2-2+deb10u3 [237 kB]
Get:31 http://security.debian.org/debian-security buster/updates/main amd64 libnginx-mod-stream amd64 1.14.2-2+deb10u3 [147 kB]
Get:32 http://security.debian.org/debian-security buster/updates/main amd64 nginx-extras amd64 1.14.2-2+deb10u3 [515 kB]
Fetched 11.8 MB in 1s (9322 kB/s)
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/n/nginx/libnginx-mod-http-auth-pam_1.14.2-2+deb10u3_amd64.deb 400 Bad Request [IP: 151.101.248.204 80]
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/n/nginx/libnginx-mod-http-dav-ext_1.14.2-2+deb10u3_amd64.deb 400 Bad Request [IP: 151.101.248.204 80]
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/n/nginx/libnginx-mod-http-fancyindex_1.14.2-2+deb10u3_amd64.deb 400 Bad Request [IP: 151.101.248.204 80]
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/n/nginx/libnginx-mod-http-headers-more-filter_1.14.2-2+deb10u3_amd64.deb 400 Bad Request [IP: 151.101.248.204 80]
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/n/nginx/libnginx-mod-http-ndk_1.14.2-2+deb10u3_amd64.deb 501 Not Implemented [IP: 151.101.248.204 80]
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/n/nginx/libnginx-mod-http-lua_1.14.2-2+deb10u3_amd64.deb File has unexpected size (93232 != 237784). Mirror sync in progress? [IP: 151.101.248.204 80]
Hashes of expected file:
- SHA256:d7cb4d0582515209a6573e2f38114d235007c90ff0415628a91028116245cf19
- MD5Sum:9ef5b8b94974c3f206d915da72a97433 [weak]
- Filesize:237784 [weak]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
: docker-compose down --rmi all
: Stopping nginx ... done Stopping service ... done Stopping enketo ... done Stopping mail ... done Stopping pyxform ... done Stopping enketo_redis_main ... done Stopping enketo_redis_cache ... done Stopping central_postgres_1 ... done Removing nginx ... done Removing service ... done Removing enketo ... done Removing mail ... done Removing pyxform ... done Removing enketo_redis_main ... done Removing enketo_redis_cache ... done Removing central_postgres_1 ... done Removing secrets ... done Removing network central_default Removing image postgres:9.6 Removing image itsissa/namshi-smtp:4.89-2.deb9u5 Removing image getodk/pyxform-http:v1.0.0 Removing image central_secrets Removing image redis:5 Removing image redis:5 WARNING: Image redis:5 not found. Removing image central_enketo Removing image central_service Removing image central_nginx
: docker ps
: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
: docker-compose build
: Service 'nginx' failed to build : The command '/bin/sh -c apt-get update; apt-get install -y openssl netcat nginx-extras lua-zlib' returned a non-zero code: 100
:
: