0

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 yesterday 23:59.

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
  • 91
  • 1
  • 9

1 Answers1

0

I was able to track down the issue.

For some obscure reason (which I haven't found out yet) the timestamp handed over by influxdb-python to InfluxDB was off about six months (actually it was six months minus some days earlier) from Sep. 1, 2021 onwards as mentioned above.

By now handing over the timestamp as datetime.isoformat() instead of datetime.strftime("%d.%m.%Y, %H:%M:%S") everything is working again.

If you run into the same issue, don't forget to identify the incorrect entries that were actually inserted but probably overlooked as they were ~six months earlier and delete them if you want to have proper data.

LordOfTheSnow
  • 91
  • 1
  • 9