Hi,
We get an error (stream error: stream ID 1; HTTP_1_1_REQUIRED; received from peer) when trying to do a simple GET-request to one of our end-points (REST), no params or such are needed (i.e. very simple request). Executing the request with k6 (with --http-debug=full option) gives below result:
Obviously by looking at the debug from the request we are using HTTP/1.1 but still k6 gets the error regarding HTTP version (HTTP_1_1_REQUIRED). Why is this happening in k6 when through PowerShell it works fine?
Hi,
Thank you very much for your swift response and your suggestion.
Unfortunately the service we are sending the request to requires https, if using http we get automatically redirected to https because of security reasons. My company is using a proxy, I tried bypassing it and after that the request works in k6. However the issue is that k6 fails to complete the request with proxy, but PowerShell manages to complete it with proxy. Why can’t k6 handle requests through a proxy in this case?
k6 now has the ability to force HTTP/1.1 for the whole process through setting the env variable GODEBUG to http2client=0. On Linux you can do GODEBUG=http2client=0 k6 run testscript.js . Given the fact that this appear to be due to a PROXY usage I would expect you will need it disabled for all requests either way.
Hi,
Thank you very much for that information. Creating a system variable in Windows (in my case) called GODEBUG with value http2client=0 did the trick and now the requests work in k6 as well.
Have a great day and once again thank you very much for a quick reply.
Best regards
Fredrik
http2client=0 works great for me locally, but I’m back to the same error using K6 Cloud - I’ve trying adding as an environment variable through the cloud UI, but that doesn’t make a difference, any idea how to get past this for Cloud?
Unfortunately this is a workaround that does it for the whole process and does it through setting an env variable that does control a lot about the process, as k6 is written in go.
Given the above, we are not about to let users set this in the cloud, freely. And the env variables that are settable in the cloud are only for usage through __ENV.
The new HTTP API, currently in design, will address this without this or another env variable being needed.
Until then, you can contact cloud support for potential workarounds.
Sorry for the inconvenience, and hopefully this helps you at least understand the cause of this not working in the cloud.