Search code examples
exportinfluxdbmigratetelegrafinflux-line-protocol

influx write command is throwing error: "unsupported protocol scheme"


I have exported my data from an InfluxDB bucket with the following command:

> influxd inspect export-lp --bucket-id d5f80730ede82d67 --engine-path ~\.influxdbv2\engine --output-path ~\Desktop\my-data.lp.gz --start 2022-11-01T00:00:00Z --end 2022-12-31T00:00:00Z --compress

I am following steps from this influxdb document.

enter image description here

The size of the exported file is ~8MB.

I use the below command to write the exported file back to my new bucket:

> influx write --bucket my-new-bucket --file ~\Desktop\my-data.lp.gz

I am following this InfluxDB document to write my data. enter image description here

Now when I try to write it back to the DB, I get an Error:

Error: failed to write data: Post "/api/v2/write?bucket=my-new-bucket&org=00ef2f123c4706fd&precision=ns": unsupported protocol scheme ""

I have even tried to export and import without compressing and using .txt format for my line protocol. Still for all my attempts I face this same error.

I even tried uploading the same exported file through Telegraf > Sources > Line Protocol. But that too fails with an Error:

Unable to Write Data

Failed to write data - invalid line protocol submitted.

I don't know why the file exported from InfluxDB's "export-lp" command fails when I try to write it back.


Solution

  • If it can help , you I have this error. because I no system variable for: INFLUX_HOST: InfluxDB host URL.-->export INFLUX_HOST=http://localhost:8086

    [root@Monitor influxdb]# export INFLUX_HOST=""

    [root@Monitor influxdb]# influx write --bucket buck01 --precision s "home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067400"

    Error: failed to write data: Post "/api/v2/write?bucket=buck01&org=xxx&precision=s": unsupported protocol scheme ""

    with the variables: influx write --bucket buck01 -host "http://localhost:8086" --precision s "home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067400" OK no error