influxdata / influxdata/influxdb
Line Protocol Bug. When you sent the data in MS and got the status code 200 OK means the data is stored in Influxdb but boom no data has been stored in DB.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Steps to reproduce:__
1. Use python Fast API and create a simple endpoint which will sent the data in line protocol format.
2. Create the influxDB bucket and Python API token, connect it using the writeapi function(without the write precision) of influxdb client
3. sent the data, following the line protocol format and mention the timestamp in UNIX epoch MS to recreate this behavior.
__Expected behavior:__
Either show the syntax error in the line protocol that `use the timestamp in NS not in the MS or something similar to it so we can at least have the better understanding of what we did wrong and debug it`. or may be this is a warning.
__Actual behavior:__
It will show the status code of 200 OK , in the terminal /postman /swaggerUI. When you use the line protocol with MS and influxdb will not store the data. but another weird thing i faced. That when you sent some random garbage data either with timestamp(correct NS format) or without timestamp it'll hold the new upcoming data and the previous data also but just the measurement or maybe in some case tags also but no further data in it. which is quite weird and challenging too tackle.
- So you sent the data with MS ... Cool Done
- Influxdb is not storing the data .. umm weird
- now change the syntax of line protocol(like without timestamp or use the global `mem` measurement) now you'll have the mem data and the previous measurement which were not there a minute ago.
__Environment info:__
* Did used `uvicorn` , `uvicorn 0.18.3` to run the python script.
* Python 3.10.6
* InfluxDB version: `InfluxDB v2.4.0 (git: de247bab08) build_date: 2022-08-18T19:41:15Z`
* InfluxDB Client `Version: 1.32.0`
__Config:__
TOKEN = "API TOKEN"
ORG = "org_name"
BUCKET = "bucket_name"
URL = "localhost:8086"
This will be enough to recreate this behavior. you can use anything to sent the data in line protocol format -- postman body / swagger UI / py script using request etc.
__Note__
I did read the official influxdb docs and you guys mentioned that line protocol accept the NS timestamp but still, why it is showing the 200 OK everywhere and not a warning. like is there any validation check is going on or not? just curious about it. but it was quite difficult to address the problem like where we are doing something wrong and why it is not storing the data even when it is showing the 200 OK, so can you please look into it. and try to fix this for everyone.
if it just shows the warning or a syntax error maybe it'll be quite helpful.
it can be fixed by `influxdb client write precision` where you can mention, what type of timestamp you want to store in the inflfuxdb.
Contributor guide
Research direction
No repository file or test is named. Reproduce the report with the Python FastAPI endpoint, the InfluxDB client writeapi call, and millisecond timestamps against the stated InfluxDB version; compare the 200 response with stored data and the configured write precision. Done means the behavior is explained and the issue’s requested validation, warning, or error outcome is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100