Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Cronjobber does not work with slim tzdata format #34

Open
scorsi opened this issue Oct 23, 2020 · 17 comments
Open

Cronjobber does not work with slim tzdata format #34

scorsi opened this issue Oct 23, 2020 · 17 comments
Labels
bug Something isn't working

Comments

@scorsi
Copy link

scorsi commented Oct 23, 2020

Hello,

I have a two CronJob the one set to 0 1 * * * in Europe/Paris which is running at 3 CEST, the other one scheduled at 0 3 * * * in Europe/Paris ran at 5 CEST...

Do you have any idea why it's not running at the time it was scheduled ?

Thanks,

@u6f6o
Copy link

u6f6o commented Oct 23, 2020

Hello,

Same issue here. We normally scale up our pods in the evening, yet they have been triggered in the morning today. I found the following text in the logs:

2020-10-23T08:43:58+0000 Local Time Zone database updated to version 2020c on /tmp/zoneinfo

Best,
u6f6o

@pscheid92
Copy link

Hello, @u6f6o and I have the exact same problem.

We have 4 different namespaces with 2 jobs each.
Of those jobs, 4 are scheduled for 19:50 PM and 4 are scheduled for 20:30 PM, each day.

Today, they all ran at exactly the same time (10:44 AM).
Maybe it is a coincidence, but the updatetz container logged the right before all jobs ran:

2020-10-23T08:43:58+0000 Local Time Zone database updated to version 2020c on /tmp/zoneinfo

Our local time zone is CEST (+0200), thus the database update was logged at 10:43:58 AM local time.

@scorsi
Copy link
Author

scorsi commented Oct 23, 2020

May be related to #24. Actually don't have the workload to investigate deeper. Switched to default Kubernetes CronJob while the issue is not fixed/investigated.

@obitech
Copy link

obitech commented Oct 23, 2020

Running into the same problem here. Now my TZCronJobs won't start at all, at least not during my specified time. I haven't been able to debug the tzdb inside the container, has there been an issue with the update?

@hiddeco
Copy link
Owner

hiddeco commented Oct 23, 2020

Sorry about this unexpected behaviour, and I hope it did not result in too much chaos. Can you all please confirm you are using the latest cronjobber-updatetz release (v0.1.1)? This helps me narrow my search.

@pscheid92
Copy link

Yes, we (@u6f6o, @obitech and me) used the v0.1.1 release (with sidecar.enabled=true; installed per Helm chart).

@apicht
Copy link

apicht commented Oct 25, 2020

Just noticed this is happening for us as well. Running cronjobber:0.2.0 and cronjobber-updatetz:0.1.0. Latest log message from updatetz is

2020-10-22T23:03:54+0000 Local Time Zone database updated to version 2020c on /tmp/zoneinfo

@maksimu
Copy link

maksimu commented Oct 25, 2020

Yeap, same for me. Hopefully it can be fixed soon

@maksimu
Copy link

maksimu commented Oct 25, 2020

When I look at the logs of the cronjobber I see this errors that keep repeating over and over again:

2020-10-25T07:09:06.312819787Z cronjobber E1025 07:09:06.312568       1 reflector.go:134] github.com/hiddeco/cronjobber/pkg/client/informers/externalversions/factory.go:117: Failed to list *v1alpha1.TZCronJob: tzcronjobs.cronjobber.hidde.co is forbidden: User "system:serviceaccount:bama-prod:cronjobber" cannot list resource "tzcronjobs" in API group "cronjobber.hidde.co" at the cluster scope
2020-10-25T07:09:07.182842095Z cronjobber E1025 07:09:07.182647       1 controller.go:122] can't list Jobs: jobs.batch is forbidden: User "system:serviceaccount:bama-prod:cronjobber" cannot list resource "jobs" in API group "batch" at the cluster scope
2020-10-25T07:09:07.316420688Z cronjobber E1025 07:09:07.316221       1 reflector.go:134] github.com/hiddeco/cronjobber/pkg/client/informers/externalversions/factory.go:117: Failed to list *v1alpha1.TZCronJob: tzcronjobs.cronjobber.hidde.co is forbidden: User "system:serviceaccount:bama-prod:cronjobber" cannot list resource "tzcronjobs" in API group "cronjobber.hidde.co" at the cluster scope

Maybe something is wrong w/ the service account? In fact my service account that was installed before was gone.

@obitech
Copy link

obitech commented Oct 25, 2020

@maksimu Your errors should be unrelated. Your service account seems to be missing the correct ClusterRole permissions.

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  name: cronjobber
rules:
- apiGroups: ['cronjobber.hidde.co']
  resources: ['*']
  verbs: ['*']
- apiGroups: ['batch']
  resources: ['jobs']
  verbs: ['*']
- apiGroups: ['']
  resources: ['events']
  verbs: ['create', 'patch', 'update']

@hiddeco
Copy link
Owner

hiddeco commented Oct 25, 2020

The problem is due to zic changing the default format from fat to slim since >=2020-b, this format is however not correctly understood by Go (golang/go#42138), resulting in an UTC fallback.

The best option here is likely to start using Go 1.15, and make use of the embedded timezone information there, which makes the timezone update utility obsolete.

@obitech
Copy link

obitech commented Oct 25, 2020

@hiddeco do you find time to fix this? Otherwise I can draft a PR.

@hiddeco hiddeco changed the title CronJobs running at the wrong time... tzupdate does not work with slim database format Oct 25, 2020
@hiddeco hiddeco changed the title tzupdate does not work with slim database format Cronjobber does not work with slim tzdata format Oct 25, 2020
@hiddeco
Copy link
Owner

hiddeco commented Oct 25, 2020

I have just crafted a release, once it has been pushed to the registry, using the https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/deploy.yaml manifest with quay.io/hiddeco/cronjobber:0.3.0 should solve this issue with a workaround.

I will track the Go issue to release a new version once it is able to understand the slim format as well, so the updatetz utility can be used again. Keeping this issue open until then.

@hiddeco hiddeco added the bug Something isn't working label Oct 26, 2020
@obitech
Copy link

obitech commented Oct 26, 2020

Works again with 0.3.0, thank you! 🙏

@hiddeco
Copy link
Owner

hiddeco commented Oct 29, 2020

The bug fix for this problem has landed in the release branch for Go 1.15.4, with the release scheduled for next week. Expect a patch release as soon as this version is available in container / image land. 🌻

@rmak-cpi
Copy link

I am just wondering when cronjobber is going to be patched with the golang fix (starting from 1.15.4) for handling slim tzdata given that we are already past the 2021 DST transition. Thanks!

@hiddeco
Copy link
Owner

hiddeco commented Jul 30, 2021

Hello all,

It is likely not what you hoped, but I do at present not have the bandwidth to further maintain this project. See #43 (comment) for more information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants