K6 not creating database with InfluxDB

Thanks, to all the supports I have received so far. I appreciate the genius that had contributed.
K6, InfluxDb, and Grafana are working perfectly locally on my Windows system. Because I’ll need to showcase it to the stakeholders remotely, I have installed another set of InfluxDB and Grafana on a Ubuntu-20.04 server on Google Cloud, I want to run the test from my local machine and output the result on the remote InfluxDB and Grafana, but K6 could not create the database. I’m getting the following error output.

ERRO[0003] InfluxDB: Couldn't write stats                error="{\"error\":\"database not found: \\\"default\\\"\"}\n"
r
running (00m01.6s), 0/1 VUs, 1 complete and 0 interrupted iterations0
default ✓ [======================================] 1 VUs  00m01.5s/10m0s  1/1 iters, 1 per VU

    data_received..............: 11 kB 6.9 kB/s
    data_sent..................: 76 B  47 B/s
    http_req_blocked...........: avg=311.23ms min=311.23ms med=311.23ms max=311.23ms p(90)=311.23ms p(95)=311.23ms
    http_req_connecting........: avg=179.08ms min=179.08ms med=179.08ms max=179.08ms p(90)=179.08ms p(95)=179.08ms
    http_req_duration..........: avg=207.74ms min=207.74ms med=207.74ms max=207.74ms p(90)=207.74ms p(95)=207.74ms
    http_req_receiving.........: avg=5ms      min=5ms      med=5ms      max=5ms      p(90)=5ms      p(95)=5ms
    http_req_sending...........: avg=1ms      min=1ms      med=1ms      max=1ms      p(90)=1ms      p(95)=1ms
    http_req_tls_handshaking...: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s
    http_req_waiting...........: avg=201.73ms min=201.73ms med=201.73ms max=201.73ms p(90)=201.73ms p(95)=201.73ms
    http_reqs..................: 1     0.629347/s
    iteration_duration.........: avg=1.51s    min=1.51s    med=1.51s    max=1.51s    p(90)=1.51s    p(95)=1.51s
    iterations.................: 1     0.629347/s
    vus........................: 1     min=1 max=1
    vus_max....................: 1     min=1 max=1

ERRO[0004] InfluxDB: Couldn't write stats                error="{\"error\":\"database not found: \\\"default\\\"\"}\n"

I issued this on the command line
k6 run -o influxdb=http://test.domain.com:8086/default default.js

Have you tried creating the default database? Get started with InfluxDB OSS | InfluxDB OSS 1.8 Documentation

That part is handled automatically by the docker-compose.yml file we have in the k6 repo, but if you install InfuxDB on your own, you’d have to create the DB yourself as well.

1 Like