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

Same code works fine in one environment but fails in another with error: wildcard segment conflicts with existing children #2942

Open
ravieze opened this issue Nov 18, 2021 · 1 comment

Comments

@ravieze
Copy link

ravieze commented Nov 18, 2021

Description

The below is the code which runs perfectly in our QA environment. However the same code when we depoyin production environment throws error

                 r := gin.Default()
...
...
		r.GET("/events/partial", func1)
		r.POST("/events/:eventid/g2w/roles/:role", func2)
		r.GET("/events/:eventid/g2w/roles/:role/status/list", func3)
line 176::		r.GET("/events/:eventid/g2w/status/list", func4)
		  r.GET("/events/:eventid/g2w/status", func5)

Error:

wildcard segment ':eventid' conflicts with existing children in path '/events/:eventid/g2w/status/list' stack:goroutine 143 [running]:
runtime/debug.Stack(0xc000830710, 0x11ce2e0, 0xc000568fd0)
...
main.HandlerInternal(0x16bb560, 0xc00067a690, 0xc0001994d0, 0x9, 0xc0001994e0, 0xe, 0xc0001994b8, 0x4, 0xc00067a6c0, 0xc00067a6f0, ...)
/home/ubuntu/src2/live-lambdas/live-admin-api/src/main.go:176 +0x21bd

To fix the above error we changed the end points to the below

                 r.GET("/events1/partial", func1)
		r.POST("/events2/:eventid/g2w/roles/:role", func2)
		r.GET("/events3/:eventid/g2w/roles/:role/status/list", func3)
		r.GET("/events4/:eventid/g2w/status/list", func4)
		r.GET("/events5/:eventid/g2w/status", func5)

We checked go.mod and go.sum files on both production and dev environments. They is no difference even by a character.

The only difference between the dev and production environment is the OS minor version difference.

ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20210415 → QA
ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200810 → prod

Is this some kind of known issue. Anything I have to check on why the same code works in dev environment but fails in prod environment?

@ravieze ravieze changed the title Same code works fine in one environment but fails with error: wildcard segment <> conflicts with existing children in path Same code works fine in one environment but fails in another with error: wildcard segment conflicts with existing children Nov 18, 2021
@Bisstocuz
Copy link
Contributor

Check it on v1.7.7

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

No branches or pull requests

2 participants