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

Write API Method returns 400 bad timestamp on multiple inserts #4551

Closed
jmorantebriones opened this issue Oct 23, 2015 · 3 comments
Closed

Comments

@jmorantebriones
Copy link

I was using influxdb 0.9.0 and it was working fine, but I have upgraded to 0.9.4.2 and it returns "bad timestamp" error when sending multiple inserts (that don't include timestamp). I am running Influx in a Linux server (Linux 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux) and I installed the software using the RPM file.

If I try to send one by one it works fine, but when I send multiple lines it fails sometimes (not always). It shouldn't be an issue related with "\n" because it works fine with 0.9.0. I have double checked it, I have installed a new server with 0.9.0 and confirmed that with that version it works fine.

I send the following content in the POST call:

metric,agentname="JMB_test2210",name="rtPerUrl",parent="Welcome\ to\ Tomcat",path="tags" value=1.0,units="ms"
metric,agentname="JMB_test2210",name="hitsPerUrl",parent="Welcome\ to\ Tomcat",path="tags" value=1.0,units="hits"
metric,agentname="JMB_test2210",name="cpuPerUrl",parent="Welcome\ to\ Tomcat",path="tags" value=0.0,units="%"

And I am calling the following URL: http://127.0.0.1:8086/write?db=tests_db

For the tests of the API I am using DHC Chrome application:

image

image

@beckettsean
Copy link
Contributor

Your line protocol syntax is incorrect, unless you want the double-quotes to actually be stored as part of the value.

Try submitting the points with the following syntax instead:

metric,agentname=JMB_test2210,name=rtPerUrl,parent=Welcome\ to\ Tomcat,path=tags value=1.0,units="ms"
metric,agentname=JMB_test2210,name=hitsPerUrl,parent=Welcome\ to\ Tomcat,path=tags value=1.0,units="hits"
metric,agentname=JMB_test2210,name=cpuPerUrl,parent=Welcome\ to\ Tomcat,path=tags value=0.0,units="%"

@beckettsean
Copy link
Contributor

Also check your file to make sure you don't have any 0x0D (carriage return) characters in your file. That is common when the file has passed through a Windows machine and will cause issues when submitting to InfluxDB.

@jmorantebriones
Copy link
Author

Many thanks Sean!! After removing the quotes of tags it is working fine!!

I was adding quotes because I thought that it was required as for the string values. I read again the documentation and noticed that it is not required to add quotes as the tags are always stored as strings.

FYI. I have confirmed that only the tags with escaped spaces are failing with the quotes. I suppose that something has changed since 0.9.0 as it was working in that version.

I proceed to close the issue.

Thanks again!

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