Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects without location are broken due to current version of go #2474

Closed
mstoykov opened this issue Apr 4, 2022 · 10 comments · Fixed by #2696
Closed

Redirects without location are broken due to current version of go #2474

mstoykov opened this issue Apr 4, 2022 · 10 comments · Fixed by #2696
Labels
Milestone

Comments

@mstoykov
Copy link
Contributor

mstoykov commented Apr 4, 2022

Summary:

Location header isn't required for any redirect (3xx), this was previously not correctly supported in go for 301-303 statuses, for which it was a requirement.

This has been fixed in the current gotip(possibly to be released in 1.19).

K6 did previously have a test for this that has been removed.

But this is still broken on all currently released version of go (up to 1.18).

Suggested fix:

Given that this is behavior from the stdlib fixing it seems impossible without forking it so - we are unlikely to fix it. We will just wait for go version with the fix to be released and use that.

So this issue mostly exist to document the fact that currently k6 isn't compliant with the RFC and will likely be closed when a version of k6 is released with a go version that fixes it.

Other "fixes:

As discussed in #2472 we could keep the broken behavior for a time even with a version of go that fixes it. This has been mostly been abandoned as an idea, but is linked for reference.

@agilob
Copy link
Contributor

agilob commented Sep 27, 2022

When can we expect a new image with go 1.19? Just hit this nasty bug in our tests

@na--
Copy link
Member

na-- commented Sep 27, 2022

k6 v0.41.0, the next official release that will be published around the end of October, will most likely use Go 1.19, unless we find some issue in the meantime. We will probably update the CI test and build files, and the Dockerfile soon and once that PR is merged, you should be able to use the official grafana/k6:master Docker image even before v0.41.0 is released. If you want, feel free to submit a PR and we can merge it sooner.

@agilob
Copy link
Contributor

agilob commented Sep 27, 2022

❯ podman run --rm -i grafana/k6:master version
k6 v0.40.0 (2022-09-27T10:12:18+0000/v0.40.0-7-gb5bbf7e9, go1.18.6, linux/amd64)

sorry if I misunderstood, but grafana/k6:master still uses buggy go?

@na--
Copy link
Member

na-- commented Sep 27, 2022

Yes, sorry for the confusion. The current CI and Dockerfile still use 1.18:

FROM golang:1.18-alpine as builder

DEFAULT_GO_VERSION: "1.18.x"

go-version: [1.18.x]

We need to update these before the master docker image (which gets built and updated on every master k6 commit) uses Go 1.19. We will probably do that soon, but you can also submit a PR and we can merge it even sooner.

@agilob
Copy link
Contributor

agilob commented Sep 27, 2022

This bug is pretty wild, because locally our k6 0.40 was working correctly, both on linux and mac, but scripts started failing when running in a container. 3 people wasted a day together trying to find bug in our helm, dockerfile or handing of __ENV in k6 code...

@na-- na-- added this to the v0.41.0 milestone Sep 28, 2022
@mstoykov
Copy link
Contributor Author

@agilob how did you install k6 build with 1.19.1 locally? I am pretty sure we should have build everything with 1.18 instead of 1.19 🤔

@agilob
Copy link
Contributor

agilob commented Sep 28, 2022

On archlinux it will be compiled from source and use latest version of go https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=k6

on max installed using brew:

❯ k6 version
k6 v0.40.0 ((devel), go1.19.1, darwin/amd64)

@agilob
Copy link
Contributor

agilob commented Sep 28, 2022

https://formulae.brew.sh/formula/k6#default brew "depends on go 1.19.1"

@mstoykov
Copy link
Contributor Author

I've opened #2699 for the brew recipe.

The arch aur package is not under our control but they should probably download the prebuild binary instead. As I have feeling requesting a particular go version in it will be a bit more involved then in brew, but I really don't know much about AUR 🤷

@agilob
Copy link
Contributor

agilob commented Sep 28, 2022

should probably download the prebuild binary instead

there is one that downloads bin, but it's out of date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants