influxdata / influxdata/influxdb

Panic: runtime error: index out of range,influxdb crash

Open
#20,245 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1.x kind/bug
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

i do not know what happend,my influxdb crash too many times today.every time it only work fews minutes.every time is the same error.
influxdb:1.8.0

ts=2020-12-03T04:27:28.805139Z lvl=info msg="Retention policy deletion check (start)" log_id=0QqgnOFG000 service=retention trace_id=0QqiXAeG000 op_name=retention_delete_check op_event=start
ts=2020-12-03T04:27:28.811008Z lvl=info msg="Deleted shard group" log_id=0QqgnOFG000 service=retention trace_id=0QqiXAeG000 op_name=retention_delete_check db_instance=telegraf db_shard_group=895 db_rp=umcs_policy
ts=2020-12-03T04:27:28.812257Z lvl=info msg="Deleted shard group" log_id=0QqgnOFG000 service=retention trace_id=0QqiXAeG000 op_name=retention_delete_check db_instance=telegraf_thd db_shard_group=896 db_rp=umcs_policy
ts=2020-12-03T04:27:28.851191Z lvl=info msg="Deleted shard" log_id=0QqgnOFG000 service=retention trace_id=0QqiXAeG000 op_name=retention_delete_check db_instance=telegraf_thd db_shard_id=896 db_rp=umcs_policy
panic: runtime error: index out of range [1] with length 0

goroutine 829 [running]:
encoding/binary.bigEndian.Uint16(...)
/usr/local/go/src/encoding/binary/binary.go:100
github.com/influxdata/influxdb/tsdb.ReadSeriesKeyMeasurement(...)
/go/src/github.com/influxdata/influxdb/tsdb/series_file.go:380
github.com/influxdata/influxdb/tsdb.parseSeriesKey(0x7f89985fd001, 0x1, 0x7f1fff, 0xc00b6700f0, 0x5, 0x5, 0xc00b6700f0, 0x5, 0x5, 0xc010c0a000, ...)
/go/src/github.com/influxdata/influxdb/tsdb/series_file.go:417 +0x534
github.com/influxdata/influxdb/tsdb.ParseSeriesKeyInto(...)
/go/src/github.com/influxdata/influxdb/tsdb/series_file.go:408
github.com/influxdata/influxdb/tsdb.(*Store).DeleteShard.func3(0x3c700)
/go/src/github.com/influxdata/influxdb/tsdb/store.go:771 +0xcf
github.com/influxdata/influxdb/tsdb.(*SeriesIDSet).ForEach(0xc00e7174a0, 0xc016a171e8)
/go/src/github.com/influxdata/influxdb/tsdb/series_set.go:181 +0xb3
github.com/influxdata/influxdb/tsdb.(*Store).DeleteShard(0xc000423200, 0x37b, 0x0, 0x0)
/go/src/github.com/influxdata/influxdb/tsdb/store.go:765 +0x5ca
github.com/influxdata/influxdb/services/retention.(*Service).run(0xc00001b5e0)
/go/src/github.com/influxdata/influxdb/services/retention/service.go:134 +0x1ff
github.com/influxdata/influxdb/services/retention.(*Service).Open.func1(0xc00001b5e0)
/go/src/github.com/influxdata/influxdb/services/retention/service.go:51 +0x61
created by github.com/influxdata/influxdb/services/retention.(*Service).Open
/go/src/github.com/influxdata/influxdb/services/retention/service.go:51 +0x1a9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tsdb/series_file.go at ReadSeriesKeyMeasurement, parseSeriesKey, and ParseSeriesKeyInto, then follow the call from tsdb/store.go DeleteShard and services/retention/service.go. Use the supplied retention-deletion crash as the starting case; done means shard deletion handles the reported series-key input without panicking, with regression coverage if the existing test structure identifies a suitable location.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.