InfluxDB: Couldn't write stats

  • I have installed the Influx and Grafana on separate server.
  • I trying to send K6 analytical data to that server
k6 run --out influxdb=https://admin:adminpassword@mydomain.localnet/influxdb/gv1 k6/k6-script.js

but it throws an error.

InfluxDB: Couldn't write stats`
405 Not Allowed`
ginx/1.16.1

Please help me on this.

Hi @arunaxp ,

This looks like a problem outside of k6 - either wrongly configured influxdb or some proxy/network problem. Can you try to write data with curl from the same machine k6 is running from (also from inside docker if you are using docker to run k6)?

If it works then it’s a k6 issue. But there looks to be logic for parsing the username and password from the url and it looks fine … You can also try using K6_INFLUXDB_USERNAME and K6_INFLUXDB_PASSWORD environmental variable to set the username and password, to see if this will at least help.

@mstoykov,

Thank you for your reply. Yes it was problem with firewall.
I fixed it thank you

solution is here : sudo firewall-cmd --add-port=8086/tcp --permanent