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

Panic on derivative() query #2956

Closed
dahankzter opened this issue Jun 12, 2015 · 10 comments
Closed

Panic on derivative() query #2956

dahankzter opened this issue Jun 12, 2015 · 10 comments
Milestone

Comments

@dahankzter
Copy link

Server dies with panic:

panic: interface conversion: interface is int64, not float64

goroutine 31 [running]:
github.com/influxdb/influxdb/influxql.func·021(0xc2080c8800, 0x1, 0x1, 0x0, 0x0)
/root/.gvm/pkgsets/go1.4.2/global/src/github.com/influxdb/influxdb/influxql/functions.go:1061 +0x2ea
github.com/influxdb/influxdb/influxql.(_MapReduceJob).processAggregate(0xc2080fee00, 0xc2080fa180, 0xc2080c87f0, 0xc208144000, 0x5a1, 0x5a1, 0x0, 0x0)
/root/.gvm/pkgsets/go1.4.2/global/src/github.com/influxdb/influxdb/influxql/engine.go:784 +0x33d
github.com/influxdb/influxdb/influxql.(_MapReduceJob).Execute(0xc2080fee00, 0xc208125ce0, 0x0)
/root/.gvm/pkgsets/go1.4.2/global/src/github.com/influxdb/influxdb/influxql/engine.go:170 +0x8ca
github.com/influxdb/influxdb/influxql.(_Executor).execute(0xc208072380, 0xc208125ce0)
/root/.gvm/pkgsets/go1.4.2/global/src/github.com/influxdb/influxdb/influxql/engine.go:926 +0xba
created by github.com/influxdb/influxdb/influxql.(_Executor).Execute
/root/.gvm/pkgsets/go1.4.2/global/src/github.com/influxdb/influxdb/influxql/engine.go:905 +0x5a

@jwilder
Copy link
Contributor

jwilder commented Jun 12, 2015

Looks like this may have been fixed via #2917

@dahankzter
Copy link
Author

Will there be builds for RHEL regularly? I can build by hand but I prefer the package manager and soon I will no longer manage our installs and I prefer our ops dealing with rpm's rather than building from source even if Go makes it very easy.

@dahankzter
Copy link
Author

No the latest master does not seem to fix it. A simple "select derivative(value) from theData" still gives:

panic: interface conversion: interface is int64, not float64

goroutine 116 [running]:
github.com/influxdb/influxdb/influxql.(_MapReduceJob).processRawQueryDerivative(0xc2081071f0, 0xc2083ff800, 0xc208482000, 0xd4, 0x100, 0x0, 0x0, 0x0)
/home/henrik/dev/src/github.com/influxdb/influxdb/influxql/engine.go:411 +0x2ff
github.com/influxdb/influxdb/influxql.(_MapReduceJob).processRawQuery(0xc2081071f0, 0xc2080d3aa0, 0x0)
/home/henrik/dev/src/github.com/influxdb/influxdb/influxql/engine.go:353 +0x9f2
github.com/influxdb/influxdb/influxql.(_MapReduceJob).Execute(0xc2081071f0, 0xc2080d3aa0, 0xc20814b700)
/home/henrik/dev/src/github.com/influxdb/influxdb/influxql/engine.go:81 +0x11ec
github.com/influxdb/influxdb/influxql.(_Executor).execute(0xc208127300, 0xc2080d3aa0)
/home/henrik/dev/src/github.com/influxdb/influxdb/influxql/engine.go:926 +0xba
created by github.com/influxdb/influxdb/influxql.(*Executor).Execute
/home/henrik/dev/src/github.com/influxdb/influxdb/influxql/engine.go:905 +0x5a

@dahankzter
Copy link
Author

On line 411 there is:

diff := v.Values.(float64) - lastValueFromPreviousChunk.Values.(float64)

Which I guess needs to be checked for type as well.
I don't mind putting in a PR, signing CLA and normal PR is what is needed?

@dahankzter
Copy link
Author

Care for a review @jwilder ?

@jwilder
Copy link
Contributor

jwilder commented Jun 15, 2015

Yeah, looks like there is another place expecting a float64. Can you submit a PR with just the fix? It looks like you added a non_integer_derivative function as well which is separate from this issue.

@dahankzter
Copy link
Author

I modded this one if it is ok? I just didn't really grok how it was architected when I did that. Thanks for pointing it out. Is it ok now?

@randywallace
Copy link

@dahankzter regarding your comment about master RPM builds and pushing the maintenance to ops, this ops guy suggests that you request from your ops guy/team a server provisioned with docker and that you draft a Dockerfile for InfluxDB that takes a ENV Variable/ARG option of a tag/branch/commit/fork/etc... which defaults to the latest HEAD of master of this repo; with this, managing the latest/preferred version of InfluxDB is easy for Ops and you, and doesn't require the InfluxDB maintainers to entertain the tooling of regular repo snapshots of HEAD.

@dahankzter
Copy link
Author

Yes @randywallace that would be awesome. We have this whole debate about tools like docker et al with ops and hosting providers. The dust has not settled yet unfortunately. I can probably convince them that it is not that hard to build Go code reliably but the change in mindset can be hard.

Good idea though and I will definitely bring it to the table, thanks!

@beckettsean beckettsean added this to the 0.9.1 milestone Jun 16, 2015
jwilder pushed a commit that referenced this issue Jun 25, 2015
jwilder pushed a commit that referenced this issue Jun 25, 2015
jwilder pushed a commit that referenced this issue Jun 25, 2015
Accidentally added due to ignorance really.
jwilder pushed a commit that referenced this issue Jun 25, 2015
dahankzter pushed a commit to dahankzter/influxdb that referenced this issue Jun 26, 2015
@dahankzter
Copy link
Author

I have created the PR #3150 for that tiny code style fix.

jwilder added a commit that referenced this issue Jun 29, 2015
Code style fix after review of #2956
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

4 participants