K6 - Error - HTTP status code 0

We are facing an issue, K6 returns HTTP status code 0 and below error observed in the console. Observations - The server resets the connection every 5 seconds, and K6 is trying to reuse the connection and something is going wrong there, I believe. When we tried disabling of connection reuse there is zero error. We are using K6 version v0.35.0. The error occurs even for single user. At load, getting 20% error which seems to be high…

Any help here to resolve this issue?

WARN[0065] Request Failed error=“Post \https://<Application_URL> : EOF”
INFO[0065] Transaction failed with Error source=console
INFO[0065] Flow failed: <Flow_Name> source=console

Hi @kan !

Welcome to the community forum! :wave:

It sounds right that if the server resets the connection every 5 seconds, k6 could get EOF during the execution of the request.

Since it’s the server’s behavior, I believe using the k6 with an option not to re-use connection is the proper way. Do you have any concerns regarding that? :thinking:

If the question is why it shows status code 0, it’s simply because there were no HTTP responses to get any status since the connection was closed.

Cheers!

Thanks for the response.

other tools seems to handle the situation without any errors. We would like to reuse the connection, is there a way K6 can handle the connection/error gracefully?

@olegbespalov any thoughts?

other tools seems to handle the situation without any errors.

well, are the tools that you’re referring to generating the same number of requests and generally using the same test logic? :thinking:

As you said, the server drops the connection after a certain period, which means it is out of sync with the k6 execution. So imagine that k6 is in the middle of the request, and the server decides to drop the connection. In that case, k6 reports that the error happened.

I see your point about the connection re-using, but I’m afraid that currently, we don’t support such connection errors gracefully handling and re-starting it :frowning_face:

Cheers

@olegbespalov Thanks… one more point to consider, not seeing any connection in flight is failing… i think its more a case of already server closed the connection, and when k6 trying to start a new iteration on that closed connection…