Can not connect to Remote InfluxDB

I run the script k6 run --out influxdb=http://[ip]:8086/k6db apitest.js

The error was reported ERRO[0004] Couldn’t write stats error=“{"error":"unable to parse authentication credentials"}\n” output=InfluxDBv1

Hello @bobobkb,

which InfluxDB version are you using? Seems InfluxDB is asking for credentials, are you passing them using the available options?

Thanks @codebien ,can you give me an example of how to use the available options?

Hello @bobobkb,

you can find more details about how to use the options and different available ways to set them reading this documentation’s section.

If you are using a Unix-like OS, then in your case, an example could be similar to this:

K6_INFLUXDB_USERNAME=your-user-here K6_INFLUXDB_PASSWORD=your-password-here k6 run --out influxdb=http://localhost:8086/k6db apitest.js

Which InfluxDB version are you using? Currently, k6 doesn’t support InfluxDB v2.x so you should check that you are using InfluxDB v1.x.

Hello @codebien ,

I tried to authenticate to InfluxDB using the environment variables K6_… as you show. I’m on Ubuntu.

I didn’t work for me. Any ideas?

Hello @eriklange,
can you provide more context, please?

What k6 version are you using? What InfluxDB version? What command did you run (hide sensitive parts like passwords)?

1 Like