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

Conflicting router patterns when built with Go 1.23 #6972

Open
stefanb opened this issue Jul 2, 2024 · 6 comments
Open

Conflicting router patterns when built with Go 1.23 #6972

stefanb opened this issue Jul 2, 2024 · 6 comments
Labels
bug Something isn't working needs-attention An issue or PR has been sitting around and needs attention.

Comments

@stefanb
Copy link
Contributor

stefanb commented Jul 2, 2024

What's wrong?

Conflicting patterns detected when built with Go 1.23


$ grafana-agent --version
  panic: pattern "GET /debug/pprof/" (registered at net/http/pprof/pprof.go:100) conflicts with pattern "/debug/pprof/delta_heap" (registered at github.com/grafana/pyroscope-go/[email protected]/http/pprof/pprof.go:24):
  	GET /debug/pprof/ matches fewer methods than /debug/pprof/delta_heap, but has a more general path pattern

Steps to reproduce

When runing the tests for Homebrew/homebrew-core#175310 the Grafana agent test failed with:

  ==> Testing grafana-agent
  ==> /opt/homebrew/Cellar/grafana-agent/0.41.1/bin/grafana-agent --version
  panic: pattern "GET /debug/pprof/" (registered at net/http/pprof/pprof.go:100) conflicts with pattern "/debug/pprof/delta_heap" (registered at github.com/grafana/pyroscope-go/[email protected]/http/pprof/pprof.go:24):
  	GET /debug/pprof/ matches fewer methods than /debug/pprof/delta_heap, but has a more general path pattern
  
  goroutine 1 [running]:
  net/http.(*ServeMux).register(...)
  	net/http/server.go:2805
  net/http.HandleFunc({0x14000074e70?, 0x10587ac8a?}, 0x107723ea0?)
  	net/http/server.go:2799 +0x9c
  net/http/pprof.init.0()
  	net/http/pprof/pprof.go:100 +0x94

System information

All, irrelevant

Software version

Grafana Agent v0.41.1

Configuration

No response

Logs

No response

@stefanb stefanb added the bug Something isn't working label Jul 2, 2024
@stefanb stefanb changed the title Conflicting Go 1.23 support Go 1.23 support Jul 2, 2024
@stefanb stefanb changed the title Go 1.23 support Conflicting router patterns when built with Go 1.23 Jul 2, 2024
@stefanb
Copy link
Contributor Author

stefanb commented Jul 2, 2024

There were some changes in the routing patterns according to https://tip.golang.org/doc/go1.23#nethttppkgnethttp

The patterns used by ServeMux now allow one or more spaces or tabs after the method name. Previously, only a single space was permitted.

...but this should not cause such error.

stefanb added a commit to Homebrew/homebrew-core that referenced this issue Aug 2, 2024
Use "go" again when grafana/agent#6972 is resolved and released

To be merged after #175310
@gizmoguy
Copy link

Fixed in https://github.com/grafana/pyroscope-go/releases/tag/godeltaprof%2Fv0.1.8 by grafana/pyroscope-go@edd64fd

@llamafilm
Copy link

I got a very similar error trying to run Grafana Alloy with go 1.23. It works fine with go 1.22.

goroutine 1 [running]:
net/http.(*ServeMux).register(...)
net/http/server.go:2797
net/http.HandleFunc({0x14001af9800?, 0x109b3a330?}, 0x10baec9c0?)
net/http/server.go:2791 +0x9c
net/http/pprof.init.0()
net/http/pprof/pprof.go:100 +0x94
panic: pattern "GET /debug/pprof/" (registered at net/http/pprof/pprof.go:100) conflicts with pattern "/debug/pprof/delta_heap" (registered at [github.com/grafana/pyroscope-go/](http://github.com/grafana/pyroscope-go/)[[email protected]](mailto:[email protected])/http/pprof/pprof.go:24):
GET /debug/pprof/ matches fewer methods than /debug/pprof/delta_heap, but has a more general path pattern

Copy link
Contributor

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

@github-actions github-actions bot added the needs-attention An issue or PR has been sitting around and needs attention. label Sep 25, 2024
@daurnimator
Copy link

This is preventing the bump of grafana-agent in Arch Linux

sed-i added a commit to canonical/grafana-agent-snap that referenced this issue Nov 13, 2024
sed-i added a commit to canonical/grafana-agent-snap that referenced this issue Nov 14, 2024
* Add config for disable-reporting
* Revert "Build for arm64 on amd64"

This reverts commit d7a65e8.

* Pin go version to 1.22
grafana/agent#6972
@rvdheij
Copy link

rvdheij commented Dec 5, 2024

I tried to build 11.2.5 with go version 1.22 and see that it fails to build with

go: go.work requires go >= 1.22.7 (running go 1.22.1; GOTOOLCHAIN=local)

With go = 1.22.7 it builds again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-attention An issue or PR has been sitting around and needs attention.
Projects
None yet
Development

No branches or pull requests

5 participants