influxdata / influxdata/influxdb

runtime error: index out of range [4] with length 4 exception in Influx 2.1.1

Open
#23,448 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Hello, I'm new to influxdb, so there's a lot I don't know. I'll ask for a lot of advice!

Currently I am using InfluxDB to store Continuous Integration information.
I build several projects once a day and store the results in Influx periodically.
However, since a few days ago, I am getting the following error.

In the above situation, I took a temporary measure by deleting some stored information,
I want to solve the problem more clearly, but I don't know what action to take.
The issue below seems to have been resolved in 2.1.1, so maybe it has nothing to do with this issue?
- https://github.com/influxdata/influxdb/issues/12966

In Influx data explorer, a range exception is occurring in the query below, but I do not know at which point it is occurring.
error message : panic: runtime error: index out of range [4] with length 4

As the period changes, a range error sometimes occurs and sometimes it works normally.
I compared and analyzed the internal data of Influx, but couldn't find any singularities. Is there any way to analyze the root cause?

Summarizing the above, it is as follows:

**Steps to reproduce:**
List the minimal actions needed to reproduce the behavior. DISCLAIMER: not sure how to reproduce this behavior
1. execute the Influx DB Query
`build_result_model = from(bucket: "test")
|> range(start: -30d, stop: now())
|> filter(fn: (r) =>
r._measurement == "BuildModel"
)

pr_model = from(bucket: "test")
|> range(start: -30d, stop: now())
|> filter(fn: (r) =>
r._measurement == "PRModel"
)

join(
tables: {build_result: build_model, pr: pr_model},
on: ["pull_request_id"]
)
|> map(
fn: (r) => ({
"time": r._time_build_result
})
)`

Different search times result in different success / failure results.

**Expected behavior:**
Receive my value

**Actual behavior:**
an error occurred, "panic: runtime error: index out of range [4] with length 4"

**Environment info:**

System info:
InfluxDB version: https://helm.influxdata.com, influxdb2 2.0.9 (influxdb version is 2.1.1)

**Logs:
Panic log:**
`lvl=info msg="Invalid column reader received from predecessor" log_id=0aLpET7l000 service=storage-reads source="@17:6-25:4: map" error="mismatched column lengths: map[_field_build_result:string:33 _field_pr:string:11 _measurement_build_result:string:11 _measurement_pr:string:11 _start_build_result:time:11 _start_pr:time:11 _stop_build_result:time:11 _stop_pr:time:11 _time_build_result:time:11 _time_pr:time:11 _value_build_result:string:11 _value_pr:string:11 author:string:11 build_id:string:11 build_result_id:string:11 from_branch:string:11 pr_number:string:11 pr_type:string:11 project:string:11 pull_request_id:string:11 repository:string:11 to_branch:string:11]"
lvl=info msg="Dispatcher panic" log_id=0aLpET7l000 service=storage-reads component=dispatcher error="panic: runtime error: index out of range [4] with length 4" stacktrace="goroutine 27058900 [running]:\nruntime/debug.Stack()\n\t/home/circleci/.tools/go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/influxdata/flux/execute.(*poolDispatcher).Start.func1.1()\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/dispatcher.go:94 +0x205\npanic({0x3eb2040, 0xc011e75308})\n\t/home/circleci/.tools/go/src/runtime/panic.go:1038 +0x215\ngithub.com/apache/arrow/go/arrow/bitutil.BitIsNotSet(...)\n\t/home/circleci/go/pkg/mod/github.com/apache/arrow/go/arrow@v0.0.0-20210722123801-4591d76fce28/bitutil/bitutil.go:51\ngithub.com/apache/arrow/go/arrow/array.(*array).IsNull(...)\n\t/home/circleci/go/pkg/mod/github.com/apache/arrow/go/arrow@v0.0.0-20210722123801-4591d76fce28/array/array.go:112\ngithub.com/influxdata/flux/execute.ValueForRow({0x40e7bc8, 0xc00a9d97c0}, 0x20, 0x4)\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/table.go:435 +0xa85\ngithub.com/influxdata/flux/execute.(*rowFn).eval(0xc011ea88c0, {0x40a6b18, 0xc00e0e0a40}, 0xc00007e1e0, {0x40e7bc8, 0xc00a9d97c0}, 0x0)\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/row_fn.go:190 +0x171\ngithub.com/influxdata/flux/execute.(*RowMapPreparedFn).Eval(0xc011f023c0, {0x40a6b18, 0xc00e0e0a40}, 0xc011f023c0, {0x40e7bc8, 0xc00a9d97c0})\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/row_fn.go:285 +0x32\ngithub.com/influxdata/flux/stdlib/universe.(*mapTransformation).Process.func1({0x40e7bc8, 0xc00a9d97c0})\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/stdlib/universe/map.go:155 +0xd4\ngithub.com/influxdata/flux/execute.(*consecutiveTransportTable).Do.func1({0x40e7bc8, 0xc00a9d97c0})\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/transport.go:537 +0x542\ngithub.com/influxdata/flux/execute.(*ColListTable).Do(0x3e6d0a0, 0xc011eda101)\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/table.go:1328 +0x54\ngithub.com/influxdata/flux/execute.(*consecutiveTransportTable).Do(0xc00b73dea8, 0xc011ec73b0)\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/transport.go:519 +0x87\ngithub.com/influxdata/flux/stdlib/universe.(*mapTransformation).Process(0xc00b1ff9f0, {0x5f, 0x12, 0xb8, 0xe9, 0x8f, 0x5d, 0x56, 0xdf, 0x88, ...}, ...)\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/stdlib/universe/map.go:152 +0x10a\ngithub.com/influxdata/flux/execute.(*transformationTransportAdapter).ProcessMessage(0xc00d8e5470, {0x40a7720, 0xc00f40b520})\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/transport.go:617 +0x19b\ngithub.com/influxdata/flux/execute.(*consecutiveTransport).processMessage(0xc00c490580, {0x40a6b18, 0xc00e0e0a40}, {0x40a7720, 0xc00f40b520})\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/transport.go:262 +0x104\ngithub.com/influxdata/flux/execute.(*consecutiveTransport).processMessages(0xc00c490580, {0x40a6b18, 0xc00e0e0a40}, 0xa)\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/transport.go:217 +0xe6\ngithub.com/influxdata/flux/execute.(*poolDispatcher).doWork(0xc004e084d0, {0x40a6b18, 0xc00e0e0a40})\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/dispatcher.go:181 +0x19f\ngithub.com/influxdata/flux/execute.(*poolDispatcher).run(0xc004e084d0, {0x40a6b18, 0xc00e0e0a40})\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/dispatcher.go:159 +0x4f\ngithub.com/influxdata/flux/execute.(*poolDispatcher).Start.func1()\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/dispatcher.go:99 +0x86\ncreated by github.com/influxdata/flux/execute.(*poolDispatcher).Start\n\t/home/circleci/go/pkg/mod/github.com/influxdata/flux@v0.139.0/execute/dispatcher.go:76 +0x4d\n"
`

Could you give me some hints or information on which part I should focus on?
Thank you in advance.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied Flux query on InfluxDB 2.1.1, varying the time range as described. Read the stack-trace paths in flux/execute/table.go, flux/execute/row_fn.go, and flux/stdlib/universe/map.go, along with the Apache Arrow array/bitutil calls. Done means identifying a minimal failing case and preventing the query from panicking, with a regression test if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.