snikket-im / snikket-web-portal

This is the web portal for Snikket Chat services. To learn more about what Snikket Chat services are, check the website.
https://snikket.org
GNU Affero General Public License v3.0
33 stars 12 forks source link

BUG: netcat unavailable for HEALTHCHECK #156

Closed lilotter45 closed 1 year ago

lilotter45 commented 1 year ago

Description

netcat does not appear to be available in the snikket-portal container for the docker health check, despite being included in the dockerfile. Manually installing netcat in the container allows the command to run and the health state returns to "healthy."

My snikket-portal container was reporting an "unhealthy" state. While troubleshooting the issue, manually running the health check command (docker exec -it snikket-portal nc -zv 127.0.0.1 5280) returned the error OCI runtime exec failed: exec failed: unable to start container process: exec: "nc": executable file not found in $PATH: unknown.

Opening a shell in the container (docker exec -it snikket-portal sh) and running the same command (nc -zv 127.0.0.1 5280) resulted in the message sh: 1: nc: not found.

Running apt-get update && apt-get install netcat followed by the health check command, nc -zv 127.0.0.1 5280 results in the (presumably) expected result Connection to 127.0.0.1 5280 port [tcp/*] succeeded!.

To reproduce

Follow the instructions in the quick-start guide:

  1. Download the docker-compose.yml from https://snikket.org/service/resources/docker-compose.beta.yml
  2. Create snikket.conf in the same directory and update the domain name and admin email.
  3. For completeness (but probably not relevant to the issue): I also set SNIKKET_RETENTION_DAYS=28, SNIKKET_UPLOAD_STORAGE_GB=20, and SNIKKET_SITE_NAME=MySiteName
  4. Run the compose file docker compose up -d
  5. Check the status of containers docker container list

The following is returned:

CONTAINER ID   IMAGE                               COMMAND                  CREATED        STATUS                    PORTS     NAMES
75bbf49864b5   snikket/snikket-web-proxy:beta      "/usr/bin/tini /bin/…"   19 hours ago   Up 11 hours                         snikket-proxy
6815680122f5   snikket/snikket-cert-manager:beta   "/usr/bin/tini /bin/…"   19 hours ago   Up 23 minutes                       snikket-certs
a5a5b27a7ef7   snikket/snikket-server:beta         "/bin/entrypoint.sh"     19 hours ago   Up 11 hours (healthy)               snikket
c76574636443   snikket/snikket-web-portal:beta     "/bin/sh /entrypoint…"   19 hours ago   Up 11 hours (unhealthy)             snikket-portal

Manually install netcat:

CONTAINER ID   IMAGE                               COMMAND                  CREATED        STATUS                  PORTS     NAMES
75bbf49864b5   snikket/snikket-web-proxy:beta      "/usr/bin/tini /bin/…"   20 hours ago   Up 12 hours                       snikket-proxy
6815680122f5   snikket/snikket-cert-manager:beta   "/usr/bin/tini /bin/…"   20 hours ago   Up 10 minutes                     snikket-certs
a5a5b27a7ef7   snikket/snikket-server:beta         "/bin/entrypoint.sh"     20 hours ago   Up 12 hours (healthy)             snikket
c76574636443   snikket/snikket-web-portal:beta     "/bin/sh /entrypoint…"   20 hours ago   Up 12 hours (healthy)             snikket-portal

Install details

Zash commented 1 year ago

Thanks for the thorough report. This was already reported in #126 and fixed in #127 but the snikket/snikket-web-portal:beta image with id 997b1633a7ad is older than that. You could try with the snikket/snikket-web-portal:dev image with id 882d055ca3e0, it has netcat in it.

lilotter45 commented 1 year ago

Thanks for the info. Sorry about the duplicate issue, I guess I didn't include closed issues in my search.