Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple watchtower instances stopped with remote host #1860

Open
TheRolfFR opened this issue Nov 26, 2023 · 2 comments
Open

Multiple watchtower instances stopped with remote host #1860

TheRolfFR opened this issue Nov 26, 2023 · 2 comments

Comments

@TheRolfFR
Copy link

Describe the bug

Hello there,

I have two instances of Watchtower running on the same host. One is for my docker host when the other one is for my remote host.
Even though they are technically on the same docker host, they do not treat the same host.

I use it as a beginner with no scopes at all (yes I know bad).

So I don't really know if it is a real "bug", but would it be possible to very simply differentiate those without using tons of scopes ?
And no I don't want to run watchtower on the host itself (I know it would solve the problem, but that is not the solution)

Steps to reproduce

  1. Have two hosts
  2. Create 1 watchtower container with remote docker host argument
  3. Create 1 watchtower container with local docker socket binding
  4. Check status stopped on local one
  5. Docker logs states that multiple instances detected and stopping itself.

Expected behavior

Verify host between instances and notice that they're different before shutting itself down.

Screenshots

No response

Environment

  • Platform : RPi 4 4GB
  • Architecture: irrelevant
  • Docker Version : 24.0.7

Your logs

time="2023-11-21T22:42:08Z" level=info msg="Watchtower 1.7.1"
time="2023-11-21T22:42:08Z" level=info msg="Using no notifications"
time="2023-11-21T22:42:08Z" level=info msg="Checking all containers (except explicitly disabled with label)"
time="2023-11-21T22:42:08Z" level=info msg="Scheduling first run: 2023-11-22 01:30:00 +0000 UTC"
time="2023-11-21T22:42:08Z" level=info msg="Note that the first check will be performed in 2 hours, 47 minutes, 51 seconds"
time="2023-11-22T01:30:18Z" level=info msg="Found new portainer/portainer-ce:latest image (ab0607294f5a)"
time="2023-11-22T01:31:53Z" level=info msg="Found new jc21/nginx-proxy-manager:latest image (296092b37bb3)"
time="2023-11-22T01:31:53Z" level=info msg="Stopping /nginx-proxy-manager (b8c7d3113dac) with SIGTERM"
time="2023-11-22T01:32:07Z" level=info msg="Stopping /portainer (9a221a0c39cd) with SIGTERM"
time="2023-11-22T01:32:08Z" level=info msg="Creating /portainer"
time="2023-11-22T01:32:09Z" level=info msg="Creating /nginx-proxy-manager"
time="2023-11-22T01:32:10Z" level=info msg="Removing image 8f5ac037179e"
time="2023-11-22T01:32:11Z" level=info msg="Removing image 08c207a4dd27"
time="2023-11-22T01:32:40Z" level=info msg="Session done" Failed=0 Scanned=5 Updated=2 notify=no
time="2023-11-23T01:30:05Z" level=info msg="Session done" Failed=0 Scanned=6 Updated=0 notify=no
time="2023-11-24T01:30:05Z" level=info msg="Session done" Failed=0 Scanned=6 Updated=0 notify=no
time="2023-11-25T01:30:30Z" level=info msg="Found new louislam/uptime-kuma:1 image (87d038efdc15)"
time="2023-11-25T01:30:31Z" level=info msg="Stopping /uptime-kuma (0ac82401db79) with SIGTERM"
time="2023-11-25T01:30:46Z" level=info msg="Creating /uptime-kuma"
time="2023-11-25T01:30:47Z" level=info msg="Removing image 5bab982b1141"
time="2023-11-25T01:30:51Z" level=info msg="Session done" Failed=0 Scanned=6 Updated=1 notify=no
time="2023-11-25T15:17:25Z" level=info msg="Found multiple running watchtower instances. Cleaning up."
time="2023-11-25T15:17:25Z" level=info msg="Stopping /watchtower (48bf5a59b9e0) with SIGTERM"
time="2023-11-26T14:48:31Z" level=info msg="Found multiple running watchtower instances. Cleaning up."
time="2023-11-26T14:48:31Z" level=info msg="Stopping /watchtower (48bf5a59b9e0) with SIGTERM"

Additional context

No response

@TheRolfFR
Copy link
Author

yeah the CI thingy failed

@piksel
Copy link
Member

piksel commented Dec 18, 2023

You can simply add a (unique) scope label to each of the watchtower instances. To be clear, don't add the --scope argument, just the label. This will prevent the watchtower instances from trying to close each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants