Open samcro1967 opened 1 month ago
Hi,
At startup, the cron value is printed; is the parsed value correct?
May you try to enclose the env var with quotes?
- "WUD_WATCHER_LOCAL_CRON=0 1 * * *"
I see the following int he logs:
08:32:24.194 INFO whats-up-docker/watcher.docker.local: Cron started (0 1 * * *)
You are providing a timezone via environment variable and by mounting your servers timezone into the container. Any chance those two are different? Maybe that could cause weird behavior? I'd remove one of those regardless.
They are not different, but I have removed the volume mount for timezone and will see if it makes any difference.
Removing the volume mount made no difference.
WUD ran at midnight last night which is the same time a script kicks off that runs the plextraktsync container. The container ran for about 3 mins. It appears that every time a new container comes on line, goes offline, or is removed, WUD is performing a new scan and ignoring the cron schedule. The WUD log below shows it knows what time it is supposed to run, but seems to have ignored the schedule and ran anyway.
04:00:11.285 INFO whats-up-docker/watcher.docker.local: Cron started (0 1 * * *)
04:03:15.643 INFO whats-up-docker/watcher.docker.local: Cron started (0 1 * * *)
It appears that every time a new container comes on line, goes offline, or is removed, WUD is performing a new scan
That's likely because of the WUD_WATCHER_{watcher_name}_WATCHEVENTS
property.
If you want wud to scan only with the cron, you need to disable it. Can you try?
That seems to have made an impact. When WUD_WATCHER_{watcher_name}_WATCHEVENTS
is not set and defaults to true, WUD scans when a container is removed and readded. It does not when it is set to false.
A few suggestions (take them or leave them) I have would be as follows:
Update the log entry from Cron started
to something indicating that it is scanning due to a docker event and not due to the cron schedule. From the log message it appears the scan was initiated by the cron schedule instead of a docker event.
Consider changing the default for WUD_WATCHER_{watcher_name}_WATCHEVENTS
to false given the upcoming changes to Docker Hub rate limits. I run 100+ containers on the host and had 43,000+ line items show up in the docker pull request report in a 24 hour period. Not sure what Docker is considering a pull request as I did not have 43,000+ container updates in a 24 hour period. It was probably more like 10 container updates. Must count a docker pull to see if there is a new image and not just the actual pull of a new image as a pull request.
Another possibility could be to add a WATCHEVENTS to each registry type so it could be controlled by registry, but that seems a bit more complex to implement. In that scenario each event would have to be processed, determine which registry the event belongs to, see if the it is set to true or false, and then scan or not based on _WATCHEVENTS.
One last question, I noticed that the logs only contain the time and not the date. I am not seeing anything in the docs about configuring the content of a log message to be able to include the date. Am I missing something or is date just not added to the logs by design?
I believe I have WUD configured correctly yo run each day at 1:00 AM, but it is running multiple times a day. It has been up 2 days and has run 122 times instead of 2. Hoping someone can help point me to what I am missing in the config.
Docker compose for WUD
docker ps -a --filter "name=whatsupdocker"
docker logs whatsupdocker 2>&1 | grep 'Cron finished'