containrrr / watchtower

A process for automating Docker container base image updates.
https://containrrr.dev/watchtower/
Apache License 2.0
19.05k stars 847 forks source link

Portainer "Events" spammed from Watchtower healthcheck #1785

Closed gabry45 closed 1 year ago

gabry45 commented 1 year ago

Describe the bug

I see a lot of activity in the "Events" tab of Portainer, seemingly generated by Watchtower healthcheck alone (see screenshot below). It is generating these logs every 30s. Is this expected behavior?

Steps to reproduce

I just ran a container from Docker CLI without any options added, basically following your documentation. This is the command that I am using to spin up the container now, with no difference whatsoever in reproducing the issue:

sudo docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock -v /etc/localtime:/etc/localtime:ro -e WATCHTOWER_DEBUG=true -e WATCHTOWER_ROLLING_RESTART=true -e WATCHTOWER_SCHEDULE=" 30 4 ? SUN" -e WATCHTOWER_TIMEOUT=60s containrrr/watchtower:latest

Expected behavior

Just seeing logs one time at the container startup and not this many times. I also have a Jellyfin container with Healtcheck implemented and it does seems not generate this many log entries.

Screenshots

Screenshot 2023-10-03 alle 14 10 08

Environment

Your logs

time="2023-10-03T14:07:59+02:00" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
time="2023-10-03T14:08:00+02:00" level=debug msg="Making sure everything is sane before starting"
time="2023-10-03T14:08:00+02:00" level=debug msg="Retrieving running containers"
time="2023-10-03T14:08:00+02:00" level=debug msg="Retrieving running containers"
time="2023-10-03T14:08:00+02:00" level=debug msg="There are no additional watchtower containers"
time="2023-10-03T14:08:00+02:00" level=debug msg="Watchtower HTTP API skipped."
time="2023-10-03T14:08:00+02:00" level=info msg="Watchtower 1.6.0"
time="2023-10-03T14:08:00+02:00" level=info msg="Using no notifications"
time="2023-10-03T14:08:00+02:00" level=info msg="Checking all containers (except explicitly disabled with label)"
time="2023-10-03T14:08:00+02:00" level=info msg="Scheduling first run: 2023-10-08 04:30:00 +0200 CEST"
time="2023-10-03T14:08:00+02:00" level=info msg="Note that the first check will be performed in 110 hours, 21 minutes, 59 seconds"

Additional context

No response

github-actions[bot] commented 1 year ago

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏

piksel commented 1 year ago

The default healthcheck interval is 30 seconds for docker. It looks like your event log contains as many healthcheck events from Jellyfin as for watchtower (the /watchtower --healthcheck are the ones that watchtower produces, and curl -Lk -fsS "${HEALTHCHECK_URL}" || exit 1 are the Jellyfin ones). Both seem to use the default interval of 30s. You can lower the interval by specifying --health-interval 1h on the docker run command line. See: https://docs.docker.com/engine/reference/run/#healthcheck

gabry45 commented 1 year ago

You're completely right, sorry about this. I've disabled it with --no-healthcheck, since I have no real use for it. Thanks a lot, have a good rest of your day.