influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.61k stars 3.54k forks source link

task runs manually but not scheduled #24154

Open xhejtman opened 1 year ago

xhejtman commented 1 year ago

Hello,

I have community influx 2.6.1, with the following task:

import "join"

option task = {name: "cq_cerit_cpu_used_perc_by_cluster", every: 1h, offset: 10m}

data_avail =
    from(bucket: "pbs-cerit")
        |> range(start: -3h, stop: now())
        |> filter(fn: (r) => r["_measurement"] == "av_state")
        |> filter(fn: (r) => r["_field"] == "cpu_avail")
        |> group(columns: ["cluster"])
        |> aggregateWindow(fn: sum, every: 1m)

data_used =
    from(bucket: "pbs-cerit")
        |> range(start: -3h, stop: now())
        |> filter(fn: (r) => r["_measurement"] == "av_state")
        |> filter(fn: (r) => r["_field"] == "cpu_used")
        |> group(columns: ["cluster"])
        |> aggregateWindow(fn: sum, every: 1m)

data_perc =
    join.tables(
        method: "inner",
        left: data_used,
        right: data_avail,
        on: (l, r) => l._time == r._time,
        as: (l, r) => ({l with avail: r._value}),
    )
        |> filter(fn: (r) => r["avail"] > 0 and r["_value"] >= 0)
        |> map(fn: (r) => ({r with _value: r._value * 100.0 / r.avail}))

data_perc
    |> aggregateWindow(fn: mean, every: 1h)
    |> map(fn: (r) => ({r with _field: "percent", _measurement: "cpu_used_perc_by_cluster"}))
    |> to(bucket: "pbs-cerit-agr")

it works ok, if I run it manually, but nothing is produced when running schedulled. If I remove the aggregateWindow(fn: mean, every: 1h), it works even schedulled.

Is this a bug?

RalphCodesTheInternet commented 3 weeks ago

I have almost exactly the same problem. Did you find a solution to this?

xhejtman commented 3 weeks ago

nope