Influxdb v2 panic with tsi1.assert

I installed InfluxDB v2.7.12 about a week ago, and since then, the service has been going down intermittently.

The logs are as follows:

ts=2025-06-11T06:47:14.297478Z lvl=info msg="Opened file" log_id=0x3Rj2ol000 service=storage-engine engine=tsm1 service=filestore path=/data/influxdb2/data/6b7f83275e749afe/autogen/3884/000002566-000000001.tsm id=9 duration=170.101ms
ts=2025-06-11T06:47:14.299095Z lvl=info msg="TSI level compaction (end)" log_id=0x3Rj2ol000 service=storage-engine index=tsi tsi1_partition=1 op_name=tsi1_compact_to_level tsi1_level=3 op_event=end op_elapsed=161.805ms
ts=2025-06-11T06:47:14.299340Z lvl=info msg="TSI level compaction (end)" log_id=0x3Rj2ol000 service=storage-engine index=tsi tsi1_partition=6 op_name=tsi1_compact_to_level tsi1_level=3 op_event=end op_elapsed=162.016ms
panic: assert failed: invalid zero-length tag value

goroutine 374 [running]:
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.assert(...)
    /root/project/tsdb/index/tsi1/tsi1.go:531
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*tagBlockValueIterator).Next(0xc07e721280)
    /root/project/tsdb/index/tsi1/tag_block.go:243 +0xf9
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*tagValueMergeIterator).Next(0xc07cc813b0)
    /root/project/tsdb/index/tsi1/tsi1.go:351 +0xd5
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.IndexFiles.writeTagsetTo({0xc05703a700, 0x2, 0x2}, {0x7f6fe602fc00, 0xc057f1e040}, {0x7f6eaa99be85, 0x4, 0x627a}, 0xc002283a58, 0xc002283a20)
    /root/project/tsdb/index/tsi1/index_files.go:320 +0x3e2
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.IndexFiles.writeTagsetsTo({0xc05703a700, 0x2, 0x2}, {0x7f6fe602fc00, 0xc057f1e040}, 0xc002283a58, 0xc002283a20)
    /root/project/tsdb/index/tsi1/index_files.go:281 +0x33c
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.IndexFiles.CompactTo({0xc05703a700, 0x2, 0x2}, {0x7f6fe602f298, 0xc0040a2000}, 0xc02ee60d70, 0x7f6fe4c16590?, 0x14?, 0xc052612070)
    /root/project/tsdb/index/tsi1/index_files.go:184 +0x285
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*Partition).compactToLevel(0xc04b912120, {0xc05703a700, 0x2, 0x2}, 0x3, 0xc052612070)
    /root/project/tsdb/index/tsi1/partition.go:1138 +0x953
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*Partition).compact.func2.1()
    /root/project/tsdb/index/tsi1/partition.go:1081 +0x45
created by github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*Partition).compact.func2 in goroutine 373
    /root/project/tsdb/index/tsi1/partition.go:1078 +0xb4
InfluxDB API at http://localhost:8086/ready unavailable after 5 attempts...
InfluxDB API at http://localhost:8086/ready unavailable after 6 attempts...
InfluxDB API at http://localhost:8086/ready unavailable after 7 attempts...
InfluxDB API at http://localhost:8086/ready unavailable after 8 attempts...

I have been restarting the service after deleting or moving the problematic file. Can you tell me why this issue is occurring? Is there a solution?

Thanks

There was another service outage today.
Here’s log

ts=2025-06-13T05:18:41.131866Z lvl=info msg="Opened file" log_id=0x5wSsq0000 service=storage-engine engine=tsm1 service=filestore path=/data/influxdb2/data/1078c803a0cea8c1/autogen/24/000000002-000000001.tsm id=1
duration=0.397ms
ts=2025-06-13T05:18:41.132231Z lvl=info msg="Opened file" log_id=0x5wSsq0000 service=storage-engine engine=tsm1 service=filestore path=/data/influxdb2/data/1078c803a0cea8c1/autogen/24/000000001-000000001.tsm id=0
duration=0.743ms
ts=2025-06-13T05:18:41.132516Z lvl=info msg="Reading file" log_id=0x5wSsq0000 service=storage-engine engine=tsm1 service=cacheloader path=/data/influxdb2/wal/1078c803a0cea8c1/autogen/24/_00016.wal size=9328157   
Command "print-config" is deprecated, use the influx-cli command server-config to display the configuration values from the running server
InfluxDB API at http://localhost:8086/ready unavailable after 1 attempts...
panic: runtime error: slice bounds out of range [-2:] [recovered]
        panic: [Index file: /data/influxdb2/data/1572102405367c16/autogen/6/index/2/L1-00000001.tsi] runtime error: slice bounds out of range [-2:]
 
goroutine 275 [running]:
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*IndexFile).Open.func1()
        /root/project/tsdb/index/tsi1/index_file.go:113 +0xb3
panic({0x7fd08569c4e0?, 0xc005e3a000?})
        /go/src/runtime/panic.go:791 +0x132
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.ReadTagBlockTrailer({0x7fd026b00000?, 0x30?, 0x7fd03298e760?})
        /root/project/tsdb/index/tsi1/tag_block.go:507 +0x310
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*TagBlock).UnmarshalBinary(0xc00238c1c0, {0x7fd026b00000, 0x0, 0x93dca})
        /root/project/tsdb/index/tsi1/tag_block.go:64 +0x48
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*IndexFile).UnmarshalBinary(0xc00222e140, {0x7fd026b00000,
0x93dca, 0x93dca})
        /root/project/tsdb/index/tsi1/index_file.go:210 +0x74e
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*IndexFile).Open(0xc00222e140)
        /root/project/tsdb/index/tsi1/index_file.go:125 +0xc8
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*Partition).openIndexFile(0xc005e2def8?, {0xc005e1a140, 0x4e})
        /root/project/tsdb/index/tsi1/partition.go:290 +0x8e
github.com/influxdata/influxdb/v2/tsdb/index/tsi1.(*Partition).Open(0xc000d5c360)
        /root/project/tsdb/index/tsi1/partition.go:232 +0x998
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /go/pkg/mod/golang.org/x/sync@v0.12.0/errgroup/errgroup.go:78 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 125
        /go/pkg/mod/golang.org/x/sync@v0.12.0/errgroup/errgroup.go:75 +0x96
InfluxDB API at http://localhost:8086/ready unavailable after 2 attempts...

Has anyone seen a similar issue ?