-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
net/url: mysql://signer@tcp(mysql:3306)/notarysigner no longer parses after 1.12.8 #33646
Comments
This was caused by CL 189258 fixing #29098. There’s actually an existing test covering exactly this case (as part of The change was intentional, but this might have been overlooked. The review comments on the CL indicate an okay-ness with breaking here. /cc @FiloSottile |
That's "interesting" 😅 Thanks; yes, reading the old discussion #12023 (comment), it seems like parsing DSN's with Is this something to be called out in the release notes as a breaking change? (Feel free to close this one if this was intentional, and the test is ok as-is; just thought it was good to bring it up here in case it was not intentional) |
Thanks for reporting this and sorry for the disruption. Indeed, this is unfortunate but I'm afraid necessary. DSNs like that are not well-formed URIs per RFC 3986, which is what net/url targets. All things being equal we will prefer backwards compatibility to standard compliance, but it became clear that allowing malformed ports was having a security impact on applications that assumed RFC 3986 compliance, so unless we break the world here we should stay on the stricter behavior. I mentioned this change in the golang-announce email, and had I noticed the test failure I would have opened an issue with github.com/go-sql-driver/mysql in advance. If somebody on this issue would like to open an issue there, I'd appreciate it, otherwise I'll look into which of their APIs are affected and let them know this evening. I will leave this issue open to fix the test. |
The good news is that github.com/go-sql-driver/mysql itself does not use net/url.Parse, so is unaffected. If other tools like github.com/golang-migrate/migrate try to parse the DSN before passing it to github.com/go-sql-driver/mysql they will fail though. |
The result of parsing STUN URI with invalid port like u.Host = u.Opaque
host, rawPort := u.Hostname(), u.Port() was my mistake. Now I'm getting |
The TestParseErrors test function was not strict with unwanted errors received from url.Parse(). It was not failing in such cases, now it does. Updates golang#33646 and golang#29098
Change https://golang.org/cl/191966 mentions this issue: |
Oh! Thought I left a reply, but apparently forgot 😓
👍 Thanks for confirming that; I did a cursory look at the RFC, but one quickly goes down the rabbit hole when reading those (could've missed an errata), so I wasn't 100% sure. 🤗,
I opened a ticket in that repository, and it was fixed there, so all is well 👍
👍 Thanks! |
The TestParseErrors test function was not strict with unwanted errors received from url.Parse(). It was not failing in such cases, now it does Fixes golang#33646 Updates golang#29098 Change-Id: I069521093e2bff8b1fcd41ffd3f9799f3108bc61 GitHub-Last-Rev: e6844c5 GitHub-Pull-Request: golang#33876 Reviewed-on: https://go-review.googlesource.com/c/go/+/191966 Run-TryBot: Filippo Valsorda <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]>
The TestParseErrors test function was not strict with unwanted errors received from url.Parse(). It was not failing in such cases, now it does Fixes golang#33646 Updates golang#29098 Change-Id: I069521093e2bff8b1fcd41ffd3f9799f3108bc61 GitHub-Last-Rev: e6844c5 GitHub-Pull-Request: golang#33876 Reviewed-on: https://go-review.googlesource.com/c/go/+/191966 Run-TryBot: Filippo Valsorda <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Not relevant
What did you do?
Updated to Go 1.12.8
What did you expect to see?
CI to pass after updating to Go 1.12.8 😅 notaryproject/notary#1485
What did you see instead?
This looks a similar regression as #12023
t.b.h., I don't know if such DSN's should be parseable by net/url (#12023 (comment)), but it's a change in behaviour, so I thought I'd report it
Reproducer: https://play.golang.org/p/cPiVWDRZ3G4
Looks like it only fails if there's a port specified:
Produces:
The text was updated successfully, but these errors were encountered: