Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.10.0] panic: runtime error: index out of range when executing continuous query #5734

Closed
malaakso opened this issue Feb 18, 2016 · 3 comments

Comments

@malaakso
Copy link

I yesterday upgraded from 0.9.6 to 0.10.0 (did not convert old data to tsm), and added a new CQ. At midnight InfluxDB paniced:

[continuous_querier] 2016/02/18 00:00:00 executing continuous query r (2016-02-17 00:00:00 +0000 UTC to 2016-02-18 00:00:00 +0000 UTC)
[query] 2016/02/18 00:00:00 SELECT count(a) + count(b) INTO s."default".c FROM s."default".d WHERE time >= '2016-02-17T00:00:00Z' AND time < '2016-02-18T00:00:00Z' GROUP BY time(1d), SIN
panic: runtime error: index out of range

goroutine 135548 [running]:
github.com/influxdb/influxdb/models.scanTo(0xc209367f78, 0x2, 0x8, 0x0, 0xc20935a03d, 0x41d413, 0xc20935a008, 0x410868, 0x7f87086eee60)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/models/points.go:892 +0xad
github.com/influxdb/influxdb/models.newFieldsFromBinary(0xc209367f78, 0x2, 0x8, 0xc20935a040)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/models/points.go:1396 +0x10d
github.com/influxdb/influxdb/models.(*point).unmarshalBinary(0xc20829b050, 0xc2090bf6e0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/models/points.go:1298 +0x3b
github.com/influxdb/influxdb/models.(*point).Fields(0xc20829b050, 0xc2094810b0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/models/points.go:1211 +0x41
github.com/influxdb/influxdb/tsdb.(*Shard).validateSeriesAndFields(0xc2082fb760, 0xc209367fc0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/tsdb/shard.go:413 +0x7e5
github.com/influxdb/influxdb/tsdb.(*Shard).WritePoints(0xc2082fb760, 0xc209367fc0, 0x1, 0x1, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/tsdb/shard.go:202 +0xa6
github.com/influxdb/influxdb/tsdb.(*Store).WriteToShard(0xc208088160, 0xbc, 0xc209367fc0, 0x1, 0x1, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/tsdb/store.go:442 +0x14e
github.com/influxdb/influxdb/cluster.func<C2><B7>002(0xbc, 0x1, 0xc209367fc0, 0x1, 0x1)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cluster/points_writer.go:316 +0x103
created by github.com/influxdb/influxdb/cluster.(*PointsWriter).writeToShard
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cluster/points_writer.go:352 +0x31a
@jonseymour
Copy link
Contributor

G'day @malaakso.

This looks like a duplicate of #5664.

This issue has been partially fixed by #5697 (which is in master). Depending on what is causing it in your particular case, you may also need one or more of #5732 (being developed by the influx guys). My fix #5716 also addresses this issue in a different way.

To take advantages of these fixes right now you need to create a local build.

The issue is caused in part by empty column names that are currently created when you do maths on an aggregate with a SELECT INTO query, something like:

select count(value)/100 into "downsample" time > now() - 4d group by time(1h)

A workaround is to add aliases to all columns which do maths of SELECT INTO statements in your CQs, in this case:

select count(value)/100 as sampled into "downsample" time > now() - 4d group by time(1h)

The workaround may be the easiest thing to try at this point.

@malaakso
Copy link
Author

Thanks, I'll add an alias to the CQ.

@e-dard
Copy link
Contributor

e-dard commented Feb 18, 2016

Closing as dupe of #5664.

@malaakso as @jonseymour says, adding an alias is a good work around at the moment.

@e-dard e-dard closed this as completed Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants