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

Can't write data into system #141

Closed
jeffdeville opened this issue Apr 28, 2016 · 7 comments
Closed

Can't write data into system #141

jeffdeville opened this issue Apr 28, 2016 · 7 comments

Comments

@jeffdeville
Copy link

I printed out the url and data being sent while trying to perform a write:

(the url path was the same for all)
/write?db=connectder_test&precision=s&u=root&p=root

This is the insert data (that works on the CLI directly)
"units_all,device_unit_id=UNIT_000 active_watts=5.0,consumed_energy=5.0,frequency=5.0,power_factor=5.0,reactive_watts=5.0,rms_voltage=5.0,temperature=5.0 1461848446"

"units_all,device_unit_id=UNIT_001 active_watts=5.0,consumed_energy=5.0,frequency=5.0,power_factor=5.0,reactive_watts=5.0,rms_voltage=5.0,temperature=5.0 1461852046"

"units_all,device_unit_id=UNIT_002 active_watts=5.0,consumed_energy=5.0,frequency=5.0,power_factor=5.0,reactive_watts=5.0,rms_voltage=5.0,temperature=5.0 1461855646"

"units_all,device_unit_id=UNIT_003 active_watts=5.0,consumed_energy=5.0,frequency=5.0,power_factor=5.0,reactive_watts=5.0,rms_voltage=5.0,temperature=5.0 1461859246"

"units_all,device_unit_id=UNIT_004 active_watts=5.0,consumed_energy=5.0,frequency=5.0,power_factor=5.0,reactive_watts=5.0,rms_voltage=5.0,temperature=5.0 1461862846"

For some reason, the result of these operations is to insert a single record, and if I run show series, I will see 5 distinct series in the system. Just only 1 data record.

@dmke
Copy link
Contributor

dmke commented Apr 28, 2016

I cannot reproduce your problem, and I've tested against the 0.10, 0.11 and 0.12 InfluxDB versions (see results).

Can you show your code and/or run my test code? (warning, it purges connector_test..units_all!)

@jeffdeville
Copy link
Author

jeffdeville commented Apr 28, 2016

Sure can:
https://gist.github.com/jeffdeville/0eb3d7e92c48f8676cd1bf1ab9ca5abb

Note that a few days ago, I was doing a quick PoC, and write_points seemed to be working fine. (I mention that because that's what your code is doing)

@jeffdeville
Copy link
Author

FWIW, your script is working fine for me as well. I updated it to look as much like mine as I could see, and it still worked. (I have your gist, tweaked, at the bottom of my gist, now)

@dmke
Copy link
Contributor

dmke commented Apr 28, 2016

Hm. I will have a more detailed look tomorrow... On a first glance, it looks like a side effect from an external source (maybe Virtus attributes are not serialized correctly or sth. similar, but that's just guessing).

@jeffdeville
Copy link
Author

Perhaps, but I'd take a look at my initial comment before delving into that too far. I altered the gem to print out the url and request body just before kicking the thing off to net/http. It looks pretty clean, and if I put 'insert' in front of those line queries in the CLI, the data went in just fine.

@jeffdeville
Copy link
Author

jeffdeville commented Apr 29, 2016

Hey guys, the problem was that my timestamps were in the future, and there appears to be an implicity 'where' time < now() going on. Once I changed the timestamps, everything worked.

Thanks for helping me debug!

@dmke
Copy link
Contributor

dmke commented Apr 29, 2016

D'oh, of course... Well I'm glad you figured it out :-)

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

2 participants