InfluxDB showing invalid memory address when filtering value which donot exists

Wanted - Filter out the value in influxdb, for which a point does not exists

Expected behavior:
InfluxDB should show nothing (no error should come)

Actual behavior:
InfluxDB showing invalid memory address or nil pointer dereference

Environment info:

  • InfluxDB version: 2.0.9 where the query is working, and 2.4.0 where query is not working

Below is the query -

import "strings"
import "date"
import "regexp"
src_bucket = "test_bucket"
src_measurement = "gnb_om"
start_time = 2023-03-28T04:00:00Z
stop_time = 2023-03-28T05:00:00Z

from(bucket: src_bucket)
        |> range(start: start_time,stop: stop_time)
        |> filter(fn: (r) => r["_measurement"] == src_measurement)
        |> filter(fn: (r) => r["_field"] == "VS_HO_Msg3RcvdCountforSgNBAddition" or r["_field"] == "OR_ENDCPROCEDURE_SgnbAddAttemptCell" )
        |> truncateTimeColumn(unit: 1m)
        |> toFloat()
        |> group(columns: ["_time","NID","cell"])
        |> aggregateWindow(every: 1h, fn: count)
        //|> filter(fn: (r) => r["_value"] == 1)
        |> yield(name: "count")
        |> findRecord(fn: (key) => true, idx: 0)

Attached csv file -
2023-04-12-13-51_influxdb_data.txt (6.4 KB)

Hello @Pratik_Das_Baghel,
Thank you for sharing.
Can you please create an issue?

Is this issue preventing you from continuing your workflow? Can we try to find a solution around it? Whats the next step you’re looking to take?

Yes, this issue is a blocker for me. Can you suggest an alternative solution. All I want to is to make sure, I am getting same timestamps for both the oms, if timestamp differs I should be able to detect it. Eg, It will 11:00, 11:15, 11:30 and 11:45 for OM a and for OM b if it is 11:00, 11:20, 11:30 and 11:45, I should be able to know here, based on that, I will call another function.

I have created issue as well - InfluxDB showing invalid memory address when filtering value which donot exists · Issue #5411 · influxdata/flux · GitHub