jpillora / csv-to-influxdb

Import CSV files into InfluxDB
80 stars 37 forks source link

Nil Pointer #39

Open raspyweather opened 5 years ago

raspyweather commented 5 years ago

Hi there, I get a nil pointer error for following command: csv-to-influxdb -s 192.168.99.100 -d databaseName -m local_sensors bme280_sensor.csv

This is the error message:

[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x4014e8]

goroutine 1 [running]:
panic(0x6d6660, 0xc42000e090)
        /app/.latestgo/go/src/runtime/panic.go:500 +0x1a1
main.main()
        /app/.heroku/go/src/github.com/jpillora/csv-to-influxdb/main.go:90 +0x4e8

That's the data format I'm trying to parse:

sensor_id;sensor_type;location;lat;lon;timestamp;pressure;altitude;pressure_sealevel;temperature;humidity
17265;BME280;8746;49.230;9.220;2019-05-13T00:00:53;101662.06;;;8.45;67.19
17260;BME280;8746;49.230;9.220;2019-05-13T00:03:20;101653.38;;;8.43;67.00
philippegabert commented 5 years ago

Got the same issue. Had a look at the code and the server is expected on this format: "http://localhost:8086"

So you should do: csv-to-influxdb -s http://192.168.99.100:8086 -d databaseName -m local_sensors bme280_sensor.csv