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 · 2 comments
Open

Conflicting router patterns when built with Go 1.23 #6972

stefanb opened this issue Jul 2, 2024 · 2 comments
Labels
bug Something isn't working

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/godeltaprof@v0.1.7/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/godeltaprof@v0.1.7/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants