influxdata / influxdata/influxdb
Got a 204 response when writing data using HTTP/1.0, but no data is showing
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Steps to reproduce:__
`Send HTTP/1.0 POST-request with line protocol in request body to the /write endpoint`
```
curl --request POST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \
--header "Authorization: Token YOURAUTHTOKEN" \
--header "Content-Encoding: application/gzip" \
--data-raw "mem,host=host1 used_percent=23.43234543 1617612198" # timestamp of now
# got: HTTP/1.1 204 No Content
```
then query:
```
curl -i --request POST \
http://localhost:8086/api/v2/query?org=YOUR_ORG \
--header 'Authorization: Token YOURAUTHTOKEN' \
--header 'Accept: application/csv' \
--header 'Content-type: application/vnd.flux' \
--data 'from(bucket:"YOUR_BUCKET")
|> range(start: -100h)
|> filter(fn: (r) => r._measurement == "mem")
|> aggregateWindow(every: 1h, fn: mean)'
# got: HTTP/1.1 200 OK
```
But NOTHING will not print!
I first got this issue in the python API.
Sometime a measurement data will inject successfully, but sometimes not. (with same code!)
I tested this process with other ways(like above) and got the same result.
__Expected behavior:__
print result of query!
__Actual behavior:__
Nothing will be printed in the result for the quer
__Environment info:__
* System info: Linux 5.4.0-70-generic x86_64
* InfluxDB version: InfluxDB 2.0.4 (git: 4e7a59bb9a) build_date: 2021-02-08T17:47:02Z
Contributor guide
Research direction
Start by reproducing the HTTP/1.0 POST to the /write endpoint with the supplied curl command, then query the same bucket through /api/v2/query. Compare cases where the response is 204 but the measurement is absent, including the Python API path; done means successfully written data is returned by the query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100