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

Impossible to set precision to micro seconds (>=v1.8.0) #38

Open
skladd opened this issue May 18, 2020 · 7 comments · May be fixed by #39
Open

Impossible to set precision to micro seconds (>=v1.8.0) #38

skladd opened this issue May 18, 2020 · 7 comments · May be fixed by #39

Comments

@skladd
Copy link

skladd commented May 18, 2020

At least since InfluxDB server v1.8.0 precision in client cannot be set to micro seconds. Using "u", validation fails in NewBatchPoints(), using "us", Write() fails:

precision 'u' failed: NewBatchPoints failed: time: unknown unit u in duration 1u
precision 'us' failed: Write failed: {"error":"invalid precision \"us\" (use n, u, ms, s, m or h)"}

In influxdata/influxdb@275b02e a verification rejecting write requests with precision "us" was added.

@skladd skladd changed the title Impossible to set precision to micro seconds (>1.8.0) Impossible to set precision to micro seconds (>=v1.8.0) May 18, 2020
@skladd
Copy link
Author

skladd commented May 18, 2020

InfluxDB server checks in httpd.serveWriteV1() by case "", "n", "ns", "u", "ms", "s", "m", "h":.

The client checks by time.ParseDuration("1" + conf.Precision), whose valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

@skladd
Copy link
Author

skladd commented May 18, 2020

InfluxDB API reference says precision=[ns,u,ms,s,m,h]

skladd added a commit to skladd/influxdb1-client that referenced this issue May 18, 2020
* use same verification introduced to InfluxDB server at version 1.8.0
* SetPrecision() now replaces "" by default "ns"
* fixes influxdata#38
@skladd skladd linked a pull request May 18, 2020 that will close this issue
@halfa
Copy link

halfa commented Jun 30, 2020

Same issue here, it actually broke one of my application. Can somebody from the team take a look ?

@skladd
Copy link
Author

skladd commented Aug 18, 2020

@jsternberg @docmerlin May anybody take a look?

@TMarietta
Copy link

I am also experiencing this issue after an unexpected reboot of our server. Is there any solution for this?

@skladd
Copy link
Author

skladd commented Feb 16, 2021

@TMarietta Do you really need this specific precision? If not, just use ns precision.

Nevertheless someone of the InfluxDB team should take a look at this PR.

@TMarietta
Copy link

@TMarietta Do you really need this specific precision? If not, just use ns precision.

Nevertheless someone of the InfluxDB team should take a look at this PR.

No. We tried ms and that seems to work fine for our application. Thanks for following up.

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