Giter Club home page Giter Club logo

Comments (16)

Bessonov avatar Bessonov commented on May 27, 2024 3

Same issue. As a workaround I put following in the docker compose file:

    healthcheck:
      test: 'wget -O - http://127.0.0.1:$${MAILDEV_WEB_PORT}$${MAILDEV_BASE_PATHNAME}/healthz || exit 1'

from maildev.

zguig52 avatar zguig52 commented on May 27, 2024 3

@Nikola-Milovic , got this also when upgrading Rocky 9 to latest docker:

docker --version
Docker version 26.0.0, build 2ae903e

I got other issues with curl/wget localhost configured healthchecks. I had to replace localhost with 127.0.0.1. Other communications are based on self defined extra_hosts.

Seems there is also something with DNS resolution in this version.

from maildev.

pallost avatar pallost commented on May 27, 2024 2

Same issue here. It works for me locally (MacOS) and appears healthy. At CI though I receive the same "MailDev SMTP Server running at 0.0.0.0:1025" success message, but the container still shows as unhealthy. Can it be something related to changes in docker daemon or something like that? Also, maildev/maildev image hasn't changed in 8 months apparently

from maildev.

Nikola-Milovic avatar Nikola-Milovic commented on May 27, 2024 2

@zguig52 I think my specific issue is different from the one you mentioned, mine seems to be related to docker itself and some update in v26.0 (since for me more than maildev and healthcheck are affected). But I am leaving the issue open since others seem to have similar issues

from maildev.

cowclaw avatar cowclaw commented on May 27, 2024 2

I can confirm that it does not work with Docker version 26.0.0, build 2ae903e. It works with Docker version 25.0.5, build 5dc9bcc.

The root cause is that the wget (for healthcheck) tries ipv6 to connect.

From within the maildev container:

~ $ wget http://localhost:1080/
Connecting to localhost:1080 ([::1]:1080)
wget: can't connect to remote host: Connection refused

~ $ wget http://127.0.0.1:1080/
Connecting to 127.0.0.1:1080 (127.0.0.1:1080)
saving to 'index.html'
index.html           100% |*************************************************************************************************************************************************************************************************************************************************************|  8390  0:00:00 ETA
'index.html' saved

Once can confirm that using telnet (after installing it):

telnet -6 localhost 1080
Trying ::1...
telnet: Unable to connect to remote host: Connection refused

from maildev.

am97 avatar am97 commented on May 27, 2024 2

This issue is also present on Docker 20.10.24+dfsg1 (Debian 12) when IPv6 is manually enabled. It's possible to reproduce it by placing the following lines in your /etc/docker/daemon.json,

{
    "ipv6": true,
    "fixed-cidr-v6": "fd00::/64"
}

Maildev currently listens on IPv4 only:

~ $ netstat -lptn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:1025            0.0.0.0:*               LISTEN      1/node
tcp        0      0 0.0.0.0:1080            0.0.0.0:*               LISTEN      1/node

Maybe it should listen on IPv6 too

from maildev.

pallost avatar pallost commented on May 27, 2024 1

For us:

  • maildev container works locally in docker compose (both arm64 and amd64 images)
  • maildev container does not work in gitlab CI in docker compose (it logs that the UI would have started but its own health check fails)
  • maildev container works in gitlab CI when started as a sidecar (without environment variables)

I ended up removing maildev from the docker compose setup because realized that we do not need it (yet) for our e2e tests. The sidecar version without any environment variables still works and can be used with the unit tests.

I absolutely don't think this is related to maildev, really feels like there's some networking issue within the docker service itself. Good luck for further debugging!

from maildev.

 avatar commented on May 27, 2024 1

Downgrade docker-ce to older release (25.0.5) fix the issue.

from maildev.

zguig52 avatar zguig52 commented on May 27, 2024 1

Got same issue, seems more a recent bugfix in docker that starts to use the planned default healthcheck configured in the image.

Healthcheck configured doesn't work and docker does its job:

docker compose exec -it maildev wget -q http://127.0.0.1/healthz
wget: can't open 'healthz': File exists

I couldn't find any wget call that returns 200 code after beeing called a second time (always says this strange error can't open ...).

My fix was to force disabling healthcheck like this:

    healthcheck:
      disable: true

If you use docker compose up -d --wait command, you have to fake a healthy check. This could be performed like this:

    healthcheck:
      test: ["CMD", "touch", "health"]
      interval: 15s
      timeout: 5s
      retries: 5

from maildev.

jehon avatar jehon commented on May 27, 2024 1

Same problem, and also related to localhost being translated as ipv6 instead of ipv4...

from maildev.

Nikola-Milovic avatar Nikola-Milovic commented on May 27, 2024

@pallost Seems that its docker related, my services are also having weird dns issues, and they cannot resolve any address

from maildev.

zguig52 avatar zguig52 commented on May 27, 2024

Root cause is tracked here: #474

from maildev.

zguig52 avatar zguig52 commented on May 27, 2024

Could be related to this issue: moby/moby#47414

I had also some weird transient behavior recently even before this upgrade with v25 where sometimes my containers where unable to communicate between them after restart and I had to destruct them to restart them (multiple networks attached with self configured IPs through IPAM module). I saw that they did not had all networks instantiated thus not listening on expected IPs.

from maildev.

clementmouchet avatar clementmouchet commented on May 27, 2024

I've also defined my health check to support a self-signed certificate to run it over https:

    healthcheck:
      test: wget --no-check-certificate --user-agent='Docker healthcheck' -O /dev/null https://localhost:1080/healthz || exit 1
      interval: 10s
      timeout: 1s

Not a big deal, but it might be worth adding it to the documentation?

from maildev.

johnitvn avatar johnitvn commented on May 27, 2024

is this fixed on laster image?

from maildev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.