413 Request too large error

I have the below K6 service in my docker compose file
k6_crud_tests:
container_name: crud_tests
image: loadimpact/k6:latest
ports:
- “6568:6568”
environment:
- K6_OUT=influxdb=https://myinfluxdb:8086/k6
- K6_INFLUXDB_CONCURRENT_WRITES=4
- K6_INFLUXDB_PUSH_INTERVAL=20s
- K6_INFLUXDB_PAYLOAD_SIZE=1000
volumes:
- ./scripts:/scripts
- ./utilities:/utilities
command: run //scripts//Tests.js

I have separate instances of influxdb v 1.8 and Grafana executing and available publicly on our domain. The env values for influxdb is as below
INFLUXDB_DATA_MAX_SERIES_PER_DATABASE=0
INFLUXDB_DATA_MAX_VALUES_PER_TAG=0
INFLUXDB_HTTP_MAX_CONCURRENT_WRITE_LIMIT=0
INFLUXDB_DB=k6
INFLUXDB_HTTP_MAX_BODY_SIZE=0
INFLUXDB_VERSION=1.8.10

I always get the error
“ERRO[0140] Couldn’t write stats error=”\r\n413 Request Entity Too Large\r\n\r\n

413 Request Entity Too Large

\r\n
nginx\r\n\r\n\r\n" output=InfluxDBv1"

I have also used tried using the conf file for influx db and the results are the same
[meta]
dir = “/var/lib/influxdb/meta”

[data]
dir = “/var/lib/influxdb/data”
max-values-per-tag = 0
max-series-per-database = 0
engine = “tsm1”
wal-dir = “/var/lib/influxdb/wal”
[http]
max-body-size = 0

any ideas pls??? Thank you!

Hi @21.prash,
the main reason why you’re seeing the reported error is the following option:

K6_INFLUXDB_PUSH_INTERVAL=20s

Why did you set it so high? In this way, you’re saying to the output to aggregate samples across 20 seconds and flush all at once. You should definitely use a lower value. The default value is 1s.

You should also consider migrating to the new official Docker image grafana/k6.

I used “- INFLUXDB_HTTP_MAX_BODY_SIZE=50000000” in the influxdb container that resolved the issue. I will also consider removing the push interval variable and the new image.
Thank you!

However, now I get a new issue

ERRO[0833] Couldn’t write stats error=“{"error":"timeout"}\n” output=InfluxDBv1
I have added timeout of 4m…pls see below

let res = http.post(appUrl, JSON.stringify(secretCreationBody), 
    {
        headers: { 'Content-Type' : 'application/json', 'Authorization' : 'Bearer ' + token},
        timeout: '4m'
    });

any idea?