influxdata / influxdb-python

Python client for InfluxDB
MIT License
1.7k stars 522 forks source link

No more values inserted into InfluxDB since Sep 1, 2021 0:00 UTC #900

Closed LordOfTheSnow closed 3 years ago

LordOfTheSnow commented 3 years ago

Since today Sep 1, 2021, 0:00 UTC some of the write requests I send to an InfluxDB (1.8) are not stored anymore while others are working fine.

I write data from different applications to different databases:

tool database stored in database?
telegraf telegraf yes
rtl_433 rtl_433 yes
Python script via package influxdb 5.3.1 fritzbox no

The Python script runs via cron every five minutes and worked seemlessly until August 31, 2021 23:59 UTC.

The only difference I see in the InfluxDB logfiles are, that the Python script has the word "root" in the logfile, whereas the other two tools do not.

[httpd] 172.17.0.1 - - [01/Sep/2021:15:13:39 +0000] "POST /write?db=telegraf HTTP/1.1 " 204 0 "-" "Telegraf/1.19.2 Go/1.16.6" some-UUID 22674

[httpd] 172.17.0.1 - - [01/Sep/2021:15:13:45 +0000] "POST /write?db=rtl_433 HTTP/1.1 " 204 0 "-" "-" some-UUID 13045

[httpd] 172.17.0.1 - root [01/Sep/2021:15:15:06 +0000] "POST /write?db=fritzbox HTTP/1.1 " 204 0 "-" "python-requests/2.26.0" some-UUID 7088

How do I suppress the "root" "tag" in the Python requests? (I don't know if that is the problem, but that is the only idea that I currently have...)

Update Sep 2, 2021

I have captured the network traffic so hopefully somebody can track down the problem:

POST /write?db=fritzbox HTTP/1.1
Host: raspberrypi4:8086
User-Agent: python-requests/2.26.0
Accept-Encoding: gzip, deflate
Accept: application/x-msgpack
Connection: keep-alive
Content-Type: application/octet-stream
Content-Length: 123
Authorization: Basic cm9vdDpyb290

ains,ain=087610010433,name=FRITZ!DECT\ Wohnzimmer energy=324378i,power=780i,state="1",temperature=23.5 1612891545000000000
HTTP/1.1 204 No Content
Content-Type: application/x-msgpack
Request-Id: d03b1431-0c12-11ec-af0f-0242ac110005
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.8.9
X-Request-Id: d03b1431-0c12-11ec-af0f-0242ac110005
Date: Thu, 02 Sep 2021 17:25:48 GMT 
LordOfTheSnow commented 3 years ago

The timestamp interpreted by influxdb-python is off around six months (and I mean around, not exactly six months but six months plus a couple of days). I am currently investigating that further.

LordOfTheSnow commented 3 years ago

By using datetime.isoformat() instead of datetime.strftime(...) the timestamp is correct again. Still I have no idea, why it was off since Sep 1, 0:00 UTC and was working fine before that.