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

Fatal error about both interval and schedule being set, even though only interval is set #275

Closed
techknowlogick opened this Issue Apr 12, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@techknowlogick
Copy link
Contributor

commented Apr 12, 2019

Describe the bug
Unable to start watchtower due to error regarding both interval and schedule being set, however only interval is set.

To Reproduce
Compile watchtower based on latest commit in master, and run watchtower --debug --cleanup --host=unix:///var/run/docker.sock --interval=300 this fails with error below. As you can see only interval is set, schedule is not.

Expected behavior
Every 5 mins watchtower would check to see if anything needed updates.

Environment

  • Platform Digital Ocean Virtual Machine (OS: Ubuntu)
  • Architecture x86_64
  • Docker version 18.03.0-ce

Logs from running watchtower with the --debug option
time="2019-04-12T03:03:14Z" level=fatal msg="Only schedule or interval can be defined, not both."

@simskij

This comment has been minimized.

Copy link
Member

commented Apr 12, 2019

Thanks for reporting,

I've tried the exact same command after building a clean checkout of master and could not reproduce the error.

Please check whether you have WATCHTOWER_POLL_INTERVAL or WATCHTOWER_SCHEDULE set in your environment variables, as these are read as well in case the flag is omitted during launch.

And please let me know whether it solves your issue or not.

🙏

@techknowlogick

This comment has been minimized.

Copy link
Contributor Author

commented Apr 12, 2019

WATCHTOWER_SCHEDULE is set however it is empty. Would you accept a PR to change the conditional to instead of checking if it is set, instead it additionally checks if len(schedule) > 0?

I would add the additional conditional to these if statements https://github.com/containrrr/watchtower/blob/master/main.go#L70

@simskij

This comment has been minimized.

Copy link
Member

commented Apr 12, 2019

Sure! Go for it! Feel free to add some unit tests for it as well if you got the time and enough go experience! 👍🏻🙌🏻🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.