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

fix buffering middleware #5281

Merged
merged 2 commits into from Sep 3, 2019
Merged

Conversation

ldez
Copy link
Member

@ldez ldez commented Sep 2, 2019

What does this PR do?

fix buffering middleware

Motivation

DEBU[2019-09-02T15:52:55+02:00] Configuration received from provider file: {"http":{"routers":{"router0":{"entryPoints":["http"],"middlewares":["test-stripprefix"],"service":"service-foo","rule":"Path(`/bar`)"}},"middlewares":{"test-stripprefix":{"buffering":{"maxRequestBodyBytes":250000}}},"services":{"service-foo":{"loadBalancer":{"servers":[{"url":"http://127.0.0.1:3030"}],"passHostHeader":false}}}},"tcp":{},"tls":{}}  providerName=file
DEBU[2019-09-02T15:52:55+02:00] Creating middleware                           middlewareName=pipelining entryPointName=http routerName=router0@file serviceName=service-foo middlewareType=Pipelining
DEBU[2019-09-02T15:52:55+02:00] Creating load-balancer                        entryPointName=http routerName=router0@file serviceName=service-foo
DEBU[2019-09-02T15:52:55+02:00] Creating server 0 http://127.0.0.1:3030       routerName=router0@file serviceName=service-foo serverName=0 entryPointName=http
DEBU[2019-09-02T15:52:55+02:00] Added outgoing tracing middleware service-foo  routerName=router0@file entryPointName=http middlewareName=tracing middlewareType=TracingForwarder
ERRO[2019-09-02T15:52:55+02:00] Error in Go routine: runtime error: invalid memory address or nil pointer dereference 
ERRO[2019-09-02T15:52:55+02:00] Stack: goroutine 16 [running]:
runtime/debug.Stack(0xc000124000, 0x24bdd12, 0x17)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/containous/traefik/v2/pkg/safe.defaultRecoverGoroutine(0x208cf40, 0x3e64dc0)
	/go/src/github.com/containous/traefik/pkg/safe/routine.go:159 +0x9d
github.com/containous/traefik/v2/pkg/safe.GoWithRecover.func1.1(0x2598a00)
	/go/src/github.com/containous/traefik/pkg/safe/routine.go:150 +0x57
panic(0x208cf40, 0x3e64dc0)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/containous/traefik/v2/pkg/server/middleware.(*Builder).buildConstructor(0xc0001704e0, 0x290db80, 0xc0004c6d80, 0xc0002760a0, 0x15, 0xc0004c6d80, 0x0, 0x0)
	/go/src/github.com/containous/traefik/pkg/server/middleware/middlewares.go:126 +0x130
github.com/containous/traefik/v2/pkg/server/middleware.(*Builder).BuildChain.func1(0x28ae280, 0xc0004c6d50, 0x28ae280, 0xc0004c6d50, 0x0, 0x0)
	/go/src/github.com/containous/traefik/pkg/server/middleware/middlewares.go:73 +0x1e0
github.com/containous/alice.Chain.Then(0xc00014cbc0, 0x2, 0x2, 0x28ae000, 0xc00014cba0, 0x1, 0x1, 0x1, 0x0)
	/go/pkg/mod/github.com/containous/alice@v0.0.0-20181107144136-d83ebdd94cbd/chain.go:51 +0x8f
github.com/containous/traefik/v2/pkg/server/router.(*Manager).buildHTTPHandler(0xc000477b78, 0x290db80, 0xc0004c69f0, 0xc0004c65d0, 0xc000447a40, 0xc, 0xc0004c69f0, 0x1f72800, 0xc0005635c8, 0xc0005635c8)
	/go/src/github.com/containous/traefik/pkg/server/router/router.go:167 +0x576
github.com/containous/traefik/v2/pkg/server/router.(*Manager).buildRouterHandler(0xc000477b78, 0x290db80, 0xc0004c69f0, 0xc000447a40, 0xc, 0xc0004c65d0, 0xc0004c69f0, 0x2440980, 0xc0004841c0, 0xc0000236d0)
	/go/src/github.com/containous/traefik/pkg/server/router/router.go:127 +0xd2
github.com/containous/traefik/v2/pkg/server/router.(*Manager).buildEntryPointHandler(0xc000477b78, 0x290db80, 0xc0004c68a0, 0xc0004c6780, 0x1, 0x290db80, 0xc0004c68a0, 0xc0004c6750)
	/go/src/github.com/containous/traefik/pkg/server/router/router.go:97 +0x22e
github.com/containous/traefik/v2/pkg/server/router.(*Manager).BuildHandlers(0xc000477b78, 0x290db00, 0xc0000d2008, 0xc000170460, 0x2, 0x2, 0x0, 0x0)
	/go/src/github.com/containous/traefik/pkg/server/router/router.go:65 +0x1f4
github.com/containous/traefik/v2/pkg/server.(*Server).createHTTPHandlers(0xc000034340, 0x290db00, 0xc0000d2008, 0xc0004c6570, 0xc000170460, 0x2, 0x2, 0x2, 0xc000503fb0)
	/go/src/github.com/containous/traefik/pkg/server/server_configuration.go:105 +0x2eb
github.com/containous/traefik/v2/pkg/server.(*Server).loadConfigurationTCP(0xc000034340, 0xc0003dfda0, 0x3ead580)
	/go/src/github.com/containous/traefik/pkg/server/server_configuration.go:78 +0x283
github.com/containous/traefik/v2/pkg/server.(*Server).loadConfiguration(0xc000034340, 0x24977d4, 0x4, 0xc0004ca2a0)
	/go/src/github.com/containous/traefik/pkg/server/server_configuration.go:41 +0x11f
github.com/containous/traefik/v2/pkg/server.(*Server).listenConfigurations(0xc000034340, 0xc0001b22a0)
	/go/src/github.com/containous/traefik/pkg/server/server_configuration.go:244 +0x51
github.com/containous/traefik/v2/pkg/server.(*Server).Start.func3(0xc0001b22a0)
	/go/src/github.com/containous/traefik/pkg/server/server.go:172 +0x34
github.com/containous/traefik/v2/pkg/safe.(*Pool).Go.func1()
	/go/src/github.com/containous/traefik/pkg/safe/routine.go:90 +0x7b
github.com/containous/traefik/v2/pkg/safe.GoWithRecover.func1(0x2598a00, 0xc00026cff0)
	/go/src/github.com/containous/traefik/pkg/safe/routine.go:153 +0x57
created by github.com/containous/traefik/v2/pkg/safe.GoWithRecover
	/go/src/github.com/containous/traefik/pkg/safe/routine.go:147 +0x49 

More

  • Added/updated tests
  • Added/updated documentation

@ldez ldez added this to To review in v2 via automation Sep 2, 2019
@traefiker traefiker added this to the 2.0 milestone Sep 2, 2019
Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jbdoumenjou jbdoumenjou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@traefiker traefiker merged commit a917115 into traefik:v2.0 Sep 3, 2019
v2 automation moved this from To review to Done Sep 3, 2019
@ldez ldez deleted the fix/buffering-middleware branch September 3, 2019 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v2
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants