crazy-max / diun

Receive notifications when an image is updated on a Docker registry
https://crazymax.dev/diun/
MIT License
3.08k stars 115 forks source link

error pinging docker registry - i/o timeout #285

Closed Forbish closed 3 years ago

Forbish commented 3 years ago

Behaviour

All checks are failing with Diun configured as per recommended specifications. Seems to be network related issue "i/o timeout". Works fine when I configure host networking against the container, so seems to be specific to bridged networking?

Steps to reproduce this issue

  1. Setup Diun using recommended config from "https://crazymax.dev/diun/install/docker/"
  2. Run image
  3. Check logs

Expected behaviour

Checks complete successfully. It works if I hook this container up to host networking, so it would seem the rest of my config is correct

Actual behaviour

Checks fail

Configuration

version: "3.5"

services:
  diun:
    image: crazymax/diun
    container_name: diun
    volumes:
      - "/volume1/docker/diun:/data"
      - "/volume1/docker/diun/diun.yml:/diun.yml:ro"
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - "TZ=***"
      - "LOG_LEVEL=info"
      - "LOG_JSON=false"
    restart: unless-stopped
  • environment variables
  • diun config file
watch:
  schedule: "0 */6 * * *"

notif:
  mail:
    host: smtp.sendgrid.net
    port: 587
    username: apikey
    password: ***
    from: ***
    to: ***

regopts:
  - name: "docker.io"
    selector: image
    username: ***
    password: ***

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    watchByDefault: true
    watchStopped: true

Logs

Sun, 28 Feb 2021 01:35:37 AEST DBG [containers/image] Ping https://registry-1.docker.io/v1/_ping err Get "https://registry-1.docker.io/v1/_ping": dial tcp: lookup registry-1.docker.io on 127.0.0.11:53: read udp 127.0.0.1:49745->127.0.0.11:53: i/o timeout (&url.Error{Op:"Get", URL:"https://registry-1.docker.io/v1/_ping", Err:(*net.OpError)(0xc00049c910)})

Sun, 28 Feb 2021 01:35:37 AEST WRN Cannot get remote manifest error="Cannot get image digest from HEAD request: error pinging docker registry registry-1.docker.io: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 127.0.0.11:53: read udp 127.0.0.1:58052->127.0.0.11:53: i/o timeout" image=docker.io/crazymax/diun:latest provider=docker

Sun, 28 Feb 2021 01:35:37 AEST INF Jobs completed added=0 failed=7 skipped=0 unchanged=0 updated=0

crazy-max commented 3 years ago

@Forbish Looks like a DNS issue linked to your Docker network config and not something with Diun itself. What is the output of this command: docker run --rm -it busybox nslookup registry-1.docker.io?

Forbish commented 3 years ago

@crazy-max Thanks for the suggestion, I have confirmed this was an issue with my host as per the command you provided, and not Diun. Unsure why it only turned up with this container as I have others on bridge networks. Such is life!

Turns out it was a firewall issue on the host, I added an allow rule for the Docker bridge IP ranges and it started working.

Appreciate your help anyway, have a good one.