influxdata / influxdata/influxdb
InfluxDB 2.4 Closes TCP Connection On Receiving Bad HTTP Request
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Hi Friends,
We are planning to use InfluxDB for our upcoming project for storing realtime tools data. Our tools sends data at every 20 milliseconds to InfluxDB using HTTP 1.1 over TCP. Our software is built using QT/ C++. It seems everything working fine until our program sends bad data/requests due to formatting issues or tool malfunctioning or any other reason. In that case InfluxDB closes TCP connection and stop collecting data. My question is, Is there any way I can override this behaviour so, InfluxDB ignore bad requests, keeps TCP connection open and keeps collecting data? I looked into InfluxDB documents, open/close questions, tutorials but could not find any answer.
Here's the details about problem:
**O.S. :** Ubuntu 20.04
**InfluxDB Version:** 2.4 Installed from packages
**Query Type:** Write Request
**Http Response:**
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.4.0
X-Platform-Error-Code: invalid
Date: Fri, 11 Nov 2022 07:52:28 GMT
Transfer-Encoding: chunked
a74
{"code":"invalid","message":"unable to parse 'POST /api/v2/write?org=ABC\u0026bucket=Mocart\u0026precision=ns HTTP/1.1\r': invalid boolean\nunable to parse 'Host: localhost:8086\r': invalid field format\nunable to parse 'Connection: Keep-Alive\r': invalid field format\nunable to parse 'Authorization: ....... ### **_Response is very long_**}
0
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
**Connection: close**
Please let me know if you need more information. Due to company policy, I wont be able to post any code. I hope you understand.
Thanks In Advance,
Amit
Contributor guide
Research direction
The report identifies the /api/v2/write endpoint and a Qt/C++ client but does not name an InfluxDB source file or test. Start by reproducing the malformed write request against InfluxDB 2.4 and trace the HTTP handling for the 400 response; done means establishing whether closing the connection is intended and documenting or testing the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100