When I schedule a cron-based task in InfluxDB it does not run at system time the first time that it has to be executed (as per documentation says the cron option is based on system time).
The first time it runs in UTC time.
From the second time onwards it runs with the same hour as the system time how it's supposed to always happen.
We use Docker in my company so InfluxDB live within a container with Debian (with Alpine Linux also fails).
Minimal actions needed to reproduce the behavior:
docker pull influxdb
docker run -p 8086:8086 --name influxdb --privileged influxdb
Initial Setup influxDB GUI with username, password, org and initial bucket
Create the following task:
option task = {name: "Task1", cron: "0 14 * * *"}option v1 = {timeRangeStart: -7h, timeRangeStop: now()}data = from(bucket: "initialBucket")|> range(start: v1.timeRangeStart, stop: v1.timeRangeStop)|> filter(fn: (r) => (r._measurement == "something"))(No matter that the task doesn't make sense, it's just for the purpose of checking its execution)
My hardware clock and the system time looks like this in the container:
/etc # hwclock2021-03-10 18:06:31.945795+01:00/etc # dateWed Mar 10 18:06:34 CET 2021
I think the time zone is as it should be.
My time zone is "Europe/Madrid", +01:00 right now (+02:00 in summer with DST).
The task should run at 14:00 local time (system time), however the first time it will run at 14:00 UTC (15:00 local time).
From the second run the execution time is correct (14:00 local time).
I've researched and read everywhere and I'm not able to find a reason or if it's happening to someone else.
Environment info:
System info: Linux 4.19.104-microsoft-standard x86_64
When I schedule a cron-based task in InfluxDB it does not run at system time the first time that it has to be executed (as per documentation says the cron option is based on system time). The first time it runs in UTC time. From the second time onwards it runs with the same hour as the system time how it's supposed to always happen.
We use Docker in my company so InfluxDB live within a container with Debian (with Alpine Linux also fails).
Minimal actions needed to reproduce the behavior:
docker pull influxdb
docker run -p 8086:8086 --name influxdb --privileged influxdb
ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime
option task = {name: "Task1", cron: "0 14 * * *"}
option v1 = {timeRangeStart: -7h, timeRangeStop: now()}
data = from(bucket: "initialBucket")
|> range(start: v1.timeRangeStart, stop: v1.timeRangeStop)
|> filter(fn: (r) => (r._measurement == "something"))
(No matter that the task doesn't make sense, it's just for the purpose of checking its execution)My hardware clock and the system time looks like this in the container:
/etc # hwclock
2021-03-10 18:06:31.945795+01:00
/etc # date
Wed Mar 10 18:06:34 CET 2021
I think the time zone is as it should be. My time zone is "Europe/Madrid", +01:00 right now (+02:00 in summer with DST).
The task should run at 14:00 local time (system time), however the first time it will run at 14:00 UTC (15:00 local time). From the second run the execution time is correct (14:00 local time).
I've researched and read everywhere and I'm not able to find a reason or if it's happening to someone else.
Environment info: