CLI -Import command does not seem to be working in 1.7.4

I’m running Influx 1.7.4 on a Windows OS and can’t get the “influx -Import” command to work. I even tried this example shown below in the Influx Docs and many other variations with no luck.

https://docs.influxdata.com/influxdb/v1.7/tools/shell/#import-data-from-a-file-with-import

Is anyone else having this issue? I can figure out what I’m missing or if there’s a bug. Here’s the error…

C:…\Influx\influxdb-1.7.4-1>influx -import -path=datarrr.txt -precision=s
2019/02/22 15:47:53 error writing batch: {“error”:"unable to parse ‘treasures,captain_id=dread_pira
te_roberts value=801 1550865814\r’: bad timestamp\nunable to parse ‘treasures,captain_id=flint value
=29 1550865814\r’: bad timestamp\nunable to parse ‘treasures,captain_id=sparrow value=38 1550865814
r’: bad timestamp\nunable to parse ‘treasures,captain_id=tetra value=47 1550865814\r’: bad timestamp
"}

2019/02/22 15:47:53 treasures,captain_id=dread_pirate_roberts value=801 1550865814
treasures,captain_id=flint value=29 1550865814
treasures,captain_id=sparrow value=38 1550865814
treasures,captain_id=tetra value=47 1550865814

ERROR: 4 points were not inserted

I’m also getting this error…

C:…\Influx\influxdb-1.7.4-1>influx -import -path=LPData00001.txt
2019/02/22 15:51:37 error: error parsing query: found ?, expected SELECT, DELETE, SHOW, CREATE, DROP
, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
2019/02/22 15:51:37 error: error parsing query: found JimsMeasurement01649, expected SELECT, DELETE,
SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
2019/02/22 15:51:37 error: error parsing query: found JimsMeasurement01649, expected SELECT, DELETE,
SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1

Where LPData00001.txt = …

DML

CONTEXT-DATABASE: JimsDB2

JimsMeasurement01649,EngUnit=PPM Status=“Good”,Value=52.1166419620319 1420088400000000000
JimsMeasurement01649,EngUnit=PPM Status=“Good”,Value=94.9015425680828 1420088410000000000

Hi Jim ,

the first problem looks like some special characters in your file
around the timestamp ?

the second problem probably too because I assume you have # in your file
like this ( without the single quotes to make the # visible in this post ) ?
'# DML
'# CONTEXT-DATABASE: JimsDB2

have a nice weekend ,
Marc

Hi Marc,

Thanks for the reply. I’m still stuck on this issue which seems like a very basic task. I’m uploading a data file and BAT file for your review. Let me know if you see anything wrong.

Edit.BAT.txt (45 Bytes)

datarrr.txt (261 Bytes)

Here’s the error…

C:…\Influx\influxdb-1.7.4-1>influx -import -path=datarrr.
2019/02/25 15:53:09 error writing batch: {“error”:“unable to parse ‘Measurement
88400\r’: bad timestamp\nunable to parse ‘Measurement01649 Value=94 1420088410\r
able to parse ‘Measurement01649 Value=8 1420088420\r’: bad timestamp\nunable to
649 Value=50 1420088430\r’: bad timestamp\nunable to parse 'Measurement01649 Val
bad timestamp”}

2019/02/25 15:53:09 Measurement01649 Value=52 1420088400

Measurement01649 Value=94 1420088410

Measurement01649 Value=8 1420088420

Measurement01649 Value=50 1420088430

Measurement01649 Value=94 1420088440

ERROR: 5 points were not inserted

Hi ,
with your uploaded files it works in Linux without any problem,
I tried it on windows , and even if I insert the data manually ,
export it in windows , the exported file cannot be imported it gives the same error.

I have read that “Windows support is considered “experimental” for all components except Telegraf,”

here …

https://www.influxdata.com/blog/running-the-tick-stack-on-windows/

Marc:

Thanks a lot for testing this. I did a bit more research and found this…

I converted the file to Unix style line endings and it now works fine on the Windows instance.

2 Likes