containrrr / watchtower

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

cron: panic running job: duplicate metrics collector registration attempted #1864

Open 4-FLOSS-Free-Libre-Open-Source-Software opened 10 months ago

4-FLOSS-Free-Libre-Open-Source-Software commented 10 months ago

Describe the bug

Scheduling panic

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

check will be performed

Screenshots

No response

Environment

Your logs

time="2023-11-30T19:06:45+01:00" level=info msg="Watchtower 1.7.1"
time="2023-11-30T19:06:46+01:00" level=info msg="Using no notifications"
time="2023-11-30T19:06:46+01:00" level=info msg="Checking all containers (except explicitly disabled with label)"
time="2023-11-30T19:06:46+01:00" level=info msg="Scheduling first run: 2023-11-30 19:06:46 +0100 CET"
time="2023-11-30T19:06:46+01:00" level=info msg="Note that the first check will be performed in 0 seconds"
2023/11/30 19:06:53 cron: panic running job: duplicate metrics collector registration attempted
goroutine 82 [running]:
github.com/robfig/cron.(*Cron).runWithRecovery.func1()
        /home/runner/go/pkg/mod/github.com/robfig/cron@v1.2.0/cron.go:161 +0x69
panic({0xaec580, 0xc0003ae1a0})
        /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/panic.go:838 +0x207
github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0xc0001bb770?, {0xc0003a8870?, 0x1, 0x1?})
        /home/runner/go/pkg/mod/github.com/prometheus/client_golang@v1.17.0/prometheus/registry.go:405 +0x7f
github.com/prometheus/client_golang/prometheus/promauto.Factory.NewGauge({{0xc80de0?, 0xc0001bb770?}}, {{0x0, 0x0}, {0x0, 0x0}, {0xb7d533, 0x1d}, {0xb94759, 0x4b}, ...})
        /home/runner/go/pkg/mod/github.com/prometheus/client_golang@v1.17.0/prometheus/promauto/auto.go:297 +0xd3
github.com/prometheus/client_golang/prometheus/promauto.NewGauge(...)
        /home/runner/go/pkg/mod/github.com/prometheus/client_golang@v1.17.0/prometheus/promauto/auto.go:191
github.com/containrrr/watchtower/pkg/metrics.Default()
        /home/runner/work/watchtower/watchtower/pkg/metrics/metrics.go:55 +0x8d
github.com/containrrr/watchtower/pkg/metrics.RegisterScan(...)
        /home/runner/work/watchtower/watchtower/pkg/metrics/metrics.go:85
github.com/containrrr/watchtower/cmd.runUpgradesOnSchedule.func1()
        /home/runner/work/watchtower/watchtower/cmd/root.go:329 +0x105
github.com/robfig/cron.FuncJob.Run(0x0?)
        /home/runner/go/pkg/mod/github.com/robfig/cron@v1.2.0/cron.go:92 +0x1a
github.com/robfig/cron.(*Cron).runWithRecovery(0x0?, {0xc7e060?, 0xc0001cc5a0?})
        /home/runner/go/pkg/mod/github.com/robfig/cron@v1.2.0/cron.go:165 +0x62
created by github.com/robfig/cron.(*Cron).run
        /home/runner/go/pkg/mod/github.com/robfig/cron@v1.2.0/cron.go:199 +0x79f

Additional context

No response

github-actions[bot] commented 10 months 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 10 months ago

Please fill in the form. What configuration are you using? How are you starting watchtower? Did this work on a previous version?