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

Direct SELECT FROM queries fail with "NoMethodError: undefined method `time_precision'" #13

Open
roldugin opened this issue Sep 9, 2015 · 5 comments

Comments

@roldugin
Copy link

roldugin commented Sep 9, 2015

I'm using influxdb-ruby 0.2.2 and can't seem to run queries that aren't wrapped in db.query(...).

$ influxdb-cli -u admin -p admin -d graphite --pretty --time-precision=ms
Connecting to {"host"=>"localhost", "port"=>8086, "username"=>"admin", "password"=>"admin", "database"=>"graphite", "ssl"=>false, "time_precision"=>"ms", "pretty"=>"pretty"}
✔ ready
[1] pry(main)> SELECT * FROM /.*/ LIMIT 1
NoMethodError: undefined method `time_precision' for #<InfluxDB::Client:0x007fda9581a548>
from /Users/grol/.gem/ruby/2.2.0/gems/influxdb-cli-0.1.4/bin/influxdb-cli:71:in `block in <top (required)>'
[1] pry(main)> db.query('SELECT * FROM /.*/ LIMIT 1')
=> [
    [   0] {
          "name" => "foo",
          "tags" => nil,
          "values" => [
            [0] {
                 "time" => "2015-09-09T01:29:44Z",
                "value" => 1
            }
        ]
    },
    ...

📌 #14

@phstc
Copy link
Owner

phstc commented Sep 14, 2015

hi @roldugin

Are you using the latest influxdb-cli?

@roldugin
Copy link
Author

I'm using the latest influxdb-cli available (0.1.4), not the one from GitHub.

@phstc
Copy link
Owner

phstc commented Sep 16, 2015

@roldugin great thanks. I'm not actively using influxdb-cli, but I will to check it. Meanwhile, would you be able to submit a PR?

All time_precision references: https://github.com/phstc/influxdb-cli/search?utf8=%E2%9C%93&q=time_precision

@luisdavim
Copy link

I have the same issue:

$ influxdb-cli --host influxapi.local --port 80 -d sensu
WARN: Unresolved specs during Gem::Specification.reset:
      unicode-display_width (>= 1.1.1, ~> 1.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Connecting to {"host"=>"influxapi.local", "port"=>"80", "username"=>"root", "password"=>"root", "database"=>"sensu", "ssl"=>false, "time_precision"=>"s"}
✔ ready
[1] pry(main)> SELECT max("elected") FROM "mesos-master" group by "host","mesos-role"
NoMethodError: undefined method `time_precision' for #<InfluxDB::Client:0x007fcdb58be608>
from /usr/local/lib/ruby/gems/2.4.0/gems/influxdb-cli-0.1.4/bin/influxdb-cli:71:in `block in <top (required)>'

@phstc
Copy link
Owner

phstc commented Jul 17, 2017

Hi @luisdavim

I tried to fix the time_precision error, but it seems like InfluxDB is all changed, it's no longer returning a hash here and write_point in the way I used to use is now failing InfluxDB::Error: {"error":"unable to parse 'tests ': invalid field format"}.

I started #14 to fix it, but since I'm no longer using InfluxDB, I can't provide any ETA for the fix. Any help would be more than appreciated, in case you can take over that PR.

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

Successfully merging a pull request may close this issue.

3 participants