Line protocol upload bug?

Hi, I’m trying to upload some test data to a test cloud instance using the line protocol upload tool.

I choose “seconds” as precision. If I choose the “enter manually” option and paste this test data into the textbox, it works:

telemetry,event=BWSC2023,class=Cruiser,team=Test\ Team,car=Test\ Vehicle,shortname=TESTING longitude=132.5715328,latitude=-32.0091821,altitude=32.330000000000002,distance=0.0,solarEnergy=0,batteryEnergy=1.8401494016654218 1695426260
telemetry,event=BWSC2023,class=Cruiser,team=Test\ Team,car=Test\ Vehicle,shortname=TESTING longitude=132.5715387,latitude=-32.009162700000005,altitude=29.4,distance=0.0,solarEnergy=0,batteryEnergy=1.9596901376654219 1695426270

However, if I put that in a text file and choose the “upload file” option, I get the error:

“Failed to write data - invalid line protocol submitted”.

I don’t have enough information to troubleshoot this; what do I do here?

I think the issue may be the backslash? Try encapsulating in quotes: “Test \”

Thanks I have tried with quotes but no difference - I wouldn’t expect a difference with quotes according to the spec.

telemetry,event=BWSC2023,class=Cruiser,team="Test Team",car="Test Vehicle",shortname=TESTING longitude=132.5715328,latitude=-32.0091821,altitude=32.330000000000002,distance=0.0,solarEnergy=0,batteryEnergy=1.8401494016654218 1695486260
telemetry,event=BWSC2023,class=Cruiser,team="Test Team",car="Test Vehicle",shortname=TESTING longitude=132.5715387,latitude=-32.009162700000005,altitude=29.4,distance=0.0,solarEnergy=0,batteryEnergy=1.9596901376654219 1695486270

It doesn’t make sense that it works when pasted in as text and not when attached as a text file. We can’t upload 10’s of thousands of lines easily by copying & pasting into a textarea.

@David_B I’m guessing it has something to do with the newline character sequence used. This is known to happen with files created in Windows, which uses a carriage return/newline sequence (\r\n), but it’s not necessarily specific to Windows.

Make sure your line protocol file just uses newline characters (\n) without carraige returns. When copying and pasting, I’m betting the carriage return gets stripped out, which is why it’s working.

Thanks Scott, yes that was it.

Output is generated by a python script on Windows, but:

ord('\n') and ord(f'''\n''')

both return ascii 10. What caused the damage was apparently and the default for the newline arg. being ‘\n\r’. Sigh.

Still, it feels like this kind could be added to the error message - the error message “Failed to write data - invalid line protocol submitted” was not helpful in locating the issue (or any issue really).