Influx 2 uploader error 400 or no error but no data

Hey, I looked at the other error 400 posts, but it seems to be something different.

Iotawatt 2_08_03

Set up a new influx 2.7.6 self hosted instance.

New bucket called energy, I have also deleted the bucket and recreated to test.

used the all access API for testing

Created a new API with bucket access to test, also did another try with all settings.

It just stays here:
image

stopping and starting it sometimes gives error 400
image

no settings were changed.

I have also tried to delete all the measurements but 1, remove the tag and made sure to not use $device. Not sure what the next step is.

It looks as if the IoTaWatt cannot access your influx server. I haven’t looked at this for a long time (my influx2 uploader goes to the influx AWS service via a https proxy) so save me the trouble of looking it up again and verify that port 9086 is the correct port on your server (rPi?). Also, again with no real experience with self-hosted installs, are you sure it is setup to accept HTTP and not restricted to HTTPS?

I have an older influx 1.8 running on 8096 so I have the influx 2 instance mapped to 9086. It was a docker clone of the influx 1.8 so I don’t believe that it’s limited to only secure ports. This is a unraid server.

Let me burn the docker and set it up again from another source since my influx docker is extremely old. This will help eliminate any errors and I will get back to the thread.

1 Like

Ok rebuilt the docker from scratch with a new config. I set it to its own IP with the default ports and put the new orgid and token in, and I am still getting error 400. Removed all but 1 measurement as well for testing.

Wireshark would be my next move.

error in building plan while starting program: cannot query an empty range

that is the error 400 with

code:invalid

OK, can you post the query and the influx response?

Sorry, still new to wireshark.

POST /api/v2/query?orgID=4b3a8f19f98762ca HTTP/1.1\r\n

Doing some googling it looks like when I was trying to upload data the date was before the data was being logged. I moved the start time to when I know there was data and it’s uploading.

Yea, I figured that was at issue but wanted to see what the problem looks like so I can fix it. If you still have the wireshark, can you expand Frame 440 so I can see the query body, and also expand “HTTP chunked response” a dozen or so lines down.

Here is the full chunk 440 HTTP

Frame 440: 416 bytes on wire (3328 bits), 416 bytes captured (3328 bits) on interface \Device\NPF_{79849B7F-06DC-4EEA-86E3-AB28B86B212A}, id 0
Ethernet II, Src: 02:42:c0:a8:00:63 (02:42:c0:a8:00:63), Dst: Espressif_08:8e:59 (44:17:93:08:8e:59)
Internet Protocol Version 4, Src: 192.168.0.99, Dst: 192.168.1.89
Transmission Control Protocol, Src Port: 8086, Dst Port: 60507, Seq: 1, Ack: 551, Len: 362
Hypertext Transfer Protocol, has 2 chunks (including last chunk)
HTTP/1.1 400 Bad Request\r\n
[Expert Info (Chat/Sequence): HTTP/1.1 400 Bad Request\r\n]
[HTTP/1.1 400 Bad Request\r\n]
[Severity level: Chat]
[Group: Sequence]
Response Version: HTTP/1.1
Status Code: 400
[Status Code Description: Bad Request]
Response Phrase: Bad Request
Content-Type: application/json; charset=utf-8\r\n
Vary: Accept-Encoding\r\n
X-Influxdb-Build: OSS\r\n
X-Influxdb-Version: v2.7.6\r\n
X-Platform-Error-Code: invalid\r\n
Date: Wed, 01 May 2024 20:58:19 GMT\r\n
Transfer-Encoding: chunked\r\n
\r\n
[HTTP response 1/1]
[Time since request: 0.003342000 seconds]
[Request in frame: 438]
[Request URI: http://192.168.0.99:8086/api/v2/query?orgID=4b3a8f19f98762ca]
HTTP chunked response
Data chunk (105 octets)
Chunk size: 105 octets
Chunk data: 7b22636f6465223a22696e76616c6964222c226d657373616765223a226572726f7220696e206275696c64696e6720706c616e207768696c65207374617274696e672070726f6772616d3a2063616e6e6f7420717565727920616e20656d7074792072616e6765227d
Chunk boundary: 0d0a
End of chunked encoding
Chunk size: 0 octets
\r\n
File Data: 105 bytes
JavaScript Object Notation: application/json
Object
Member: code
[Path with value: /code:invalid]
[Member with value: code:invalid]
String value: invalid
Key: code
[Path: /code]
Member: message
[Path with value: /message:error in building plan while starting program: cannot query an empty range]
[Member with value: message:error in building plan while starting program: cannot query an empty range]
String value: error in building plan while starting program: cannot query an empty range
Key: message
[Path: /message]

1 Like

Thanks. I’ll try to recreate that.

1 Like