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

Traefik & Souin: TLS handshake error #95

Closed
tristanidoux opened this issue Jul 18, 2021 · 12 comments · Fixed by #99
Closed

Traefik & Souin: TLS handshake error #95

tristanidoux opened this issue Jul 18, 2021 · 12 comments · Fixed by #99

Comments

@tristanidoux
Copy link

tristanidoux commented Jul 18, 2021

Issue

Hey ! Sorry to create an issue but I'm having problems configuring Souin with Traefik.

First of all, thanks for the awesome project ! It's a great tool to now go fully Traefik with caching features (instead of using Haproxy).

Here goes the error. When I disable Souin, everything works fine and I can access my homeassistant remotely with correct certs generated by Lets encrypt etc. However, as soon as I configure Souin, I keep getting the errors below. My configuration is available below too.

reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.764Z","caller":"plugins/base.go:105","message":"Provider initialized"}
reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.781Z","caller":"plugins/base.go:109","message":"Transport initialized"}
reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.781Z","caller":"plugins/base.go:122","message":"Souin configuration is now loaded"}
reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.782Z","caller":"souin/main.go:102","message":"Waiting for an incoming request..."}
reverse-proxy-http-cache    | 2021/07/18 08:59:55 http: TLS handshake error from XXX:58720: remote error: tls: bad certificate
reverse-proxy-http-cache    | 2021/07/18 08:59:56 http: TLS handshake error from XXX:58728: remote error: tls: bad certificate

I tried disabling the redirection from http to https in Traefik but it didn't change anything. I'm using network_mode: host as I have some requirements for the homeassistant for that. In case you are wondering, I'm copying the configuration.yml using Dockerfile.

Any idea why this fails ? Maybe it doesn't resolve to localhost:81 ? I've checked using netstat and Traefik is available on port 81 & 444 in the host network. I've also checked the acme.json file and its filled & it's available in the souin container at the specified path.

Thanks for your time !

Configuration

docker-compose:

version: '2.4'

################################################################################
### SERVICES
################################################################################
services:
  https-proxy:
    build:
      context: ./traefik
      dockerfile: Dockerfile
    container_name: https-proxy
    restart: unless-stopped
    network_mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/homeassistant/traefik/acme:/etc/traefik/acme
    labels:
      - "traefik.enable=false"
    healthcheck:
      test: traefik healthcheck --ping
      start_period: 500s
      interval: 1800s
      timeout: 3s
      retries: 10

  reverse-proxy-http-cache:
    build:
      context: ./proxy-http-cache
      dockerfile: Dockerfile
    container_name: reverse-proxy-http-cache
    network_mode: host
    environment:
      GOPATH: /app
    volumes:
      - /opt/homeassistant/traefik/acme/acme.json:/ssl/traefik.json
      - /opt/homeassistant/proxy-http-cache/:/configuration
   
  hass: 
    ...

Souin configuration:

log_level: DEBUG
default_cache: # Required
  port: # Ports on which Souin will be exposed
    web: 80
    tls: 443
  ttl: 10s # Default TTL
reverse_proxy_url: 'http://localhost:81' # If it's in the same network you can use http://your-service, otherwise just use https://yourdomain.com
ssl_providers:
  - traefik

Traefik configuration (short extract):

entryPoints: 
  web:
    address: :81
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: :444
@darkweak
Copy link
Owner

Hi @tristanidoux, I'm working on it!

@darkweak
Copy link
Owner

I'll try my best to fix this asap. In the future, it should be okay when traefik will fix this issue traefik/yaegi#1172 and we would be able to use the cache system as plugin so the traefik behaviour won't be altered anymore.

@tristanidoux
Copy link
Author

Yes, sounds awesome, thanks !
Not sure if this is a bug or a misconfiguration from my part to be honest.

I'm back on haproxy in the meantime so no worries.

@darkweak
Copy link
Owner

Update: I'm currently working on the Souin implementation as træfik plugin.

@tristanidoux
Copy link
Author

That's nice to hear ! I'm really looking forward to it. I have several servers ready to migrate as soon as it's ready :)
Sorry for the late reply by the way.

@darkweak
Copy link
Owner

darkweak commented Aug 16, 2021

Now we have to wait the new release of the @traefiker and https://github.com/traefik/yaegi to fix the issue #108 because it works with the master version of Yægi interpreter.
(cc @traefik)

@darkweak darkweak reopened this Aug 16, 2021
@darkweak
Copy link
Owner

Update: Waiting for feedbacks from @ldez

@darkweak
Copy link
Owner

Available as træfik plugin now @tristanidoux

@tristanidoux
Copy link
Author

Awesome ! Thanks a lot for all the efforts & this great project !

@tristanidoux
Copy link
Author

Hmm just tried it & this is what I get. It may be a misconfiguration from my part though. Let me know if you would prefer I create another issue.

I'm using Traefik v2.5.1.

home-assistant   | 2021-08-24 20:49:20 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: met, hacs, binary_sensor.updater
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/vendor/github.com/darkweak/souin/rfc/bridge.go:38:21: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/vendor/github.com/darkweak/souin/rfc/bridge.go:113:37: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/main.go:182:11: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/base.go:59:6: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/main.go:178:2: panic
https-proxy      | time="2021-08-24T18:49:24Z" level=error msg="Recovered from panic in HTTP handler [108.177.64.155:39683 - /auth/token]: reflect.Set: value of type *http.Request is not assignable to type *struct { Transport http.RoundTripper; Provider interface {}; ConfigurationURL struct { TTL struct { Duration time.Duration } \"json:\\\"ttl\\\" yaml:\\\"ttl\\\"\"; Headers []string \"json:\\\"headers\\\" yaml:\\\"headers\\\"\" }; MarkCachedResponses bool; CoalescingLayerStorage *struct {}; YkeyStorage *struct { Keys map[string]struct { URL string \"json:\\\"url\\\" yaml:\\\"url\\\"\"; Headers map[string]string \"json:\\\"headers\\\" yaml:\\\"headers\\\"\" } } }" middlewareType=Recovery middlewareName=traefik-internal-recovery
https-proxy      | time="2021-08-24T18:49:24Z" level=error msg="Stack: goroutine 163 [running]:\ngithub.com/traefik/traefik/v2/pkg/middlewares/recovery.recoverFunc({0x7f81452dd8, 0x4003aea5c0}, 0x4003ae7e00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/recovery/recovery.go:46 +0x270\npanic({0x2661120, 0x4003ca3180})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003aecd10, 0x40028adb00, 0x4003cc6810)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003ca3180})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003da6210, 0x4000fd3700, 0x4003cc65f0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003ca3180})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003da6420, 0x40028c8b00, 0x4003cc63d0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003ca3180})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003c7d3f0, 0x4002316400, 0x4003cc61b0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003ca3180})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003cce0b0, 0x4002300600, 0x4003cc5f90)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003ca3180})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\nreflect.Value.assignTo({0x2cc6680, 0x4003cca1e0, 0x196}, {0x2dc7161, 0xb}, 0x400279d980, 0x0)\n\t/usr/local/golang/1.10.8/go/src/reflect/value.go:2797 +0x2cc\nreflect.Value.Set({0x400279d980, 0x4003cca280, 0x196}, {0x2cc6680, 0x4003cca1e0, 0x196})\n\t/usr/local/golang/1.10.8/go/src/reflect/value.go:1905 +0xa4\ngithub.com/traefik/yaegi/interp.call.func6(0x4003cce0b0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1272 +0xb38\ngithub.com/traefik/yaegi/interp.runCfg(0x4002300600, 0x4003cce0b0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003c7d3f0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x4002316400, 0x4003c7d3f0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003da6420)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x40028c8b00, 0x4003da6420)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003da6210)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x4000fd3700, 0x4003da6210)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003aecd10)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x40028adb00, 0x4003aecd10)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.genFunctionWrapper.func2.1({0x4003adf4a0, 0x2, 0x2})\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:951 +0x41c\ngithub.com/traefik/yaegi/stdlib._net_http_Handler.ServeHTTP(...)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/stdlib/go1_17_net_http.go:269\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.(*FieldHandler).ServeHTTP(0x400393fd40, {0x7f81452dd8, 0x4003aea5c0}, 0x4003d94000)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/field_middleware.go:38 +0x130\ngithub.com/gorilla/mux.(*Router).ServeHTTP(0x40028d40c0, {0x7f81452dd8, 0x4003aea5c0}, 0x4003ae7e00)\n\t/home/semaphore/go/pkg/mod/github.com/containous/mux@v0.0.0-20181024131434-c33f32e26898/mux.go:133 +0x268\ngithub.com/traefik/traefik/v2/pkg/middlewares/recovery.(*recovery).ServeHTTP(0x4003c37120, {0x7f81452dd8, 0x4003aea5c0}, 0x4003ae7e00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/recovery/recovery.go:32 +0x8c\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.AddOriginFields({0x7f81452e28, 0x4003aea5b8}, 0x4003ae7e00, {0x3361e20, 0x4003c37120}, 0x4003a8f980)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/field_middleware.go:55 +0x198\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.(*FieldHandler).ServeHTTP(0x400393fe40, {0x7f81452e28, 0x4003aea5b8}, 0x4003ae7e00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/field_middleware.go:36 +0x100\ngithub.com/traefik/traefik/v2/pkg/middlewares/requestdecorator.(*RequestDecorator).ServeHTTP(0x4003054ac0, {0x7f81452e28, 0x4003aea5b8}, 0x4003ae7d00, 0x400009f230)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/requestdecorator/request_decorator.go:47 +0x5e8\ngithub.com/traefik/traefik/v2/pkg/middlewares/requestdecorator.WrapHandler.func1.1({0x7f81452e28, 0x4003aea5b8}, 0x4003ae7d00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/requestdecorator/request_decorator.go:84 +0x70\nnet/http.HandlerFunc.ServeHTTP(0x4003c3acc0, {0x7f81452e28, 0x4003aea5b8}, 0x4003ae7d00)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2046 +0x40\ngithub.com/traefik/traefik/v2/pkg/middlewares/metrics.(*metricsMiddleware).ServeHTTP(0x4003c33880, {0x7f81452dd8, 0x4003aea5a0}, 0x4003ae7d00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/metrics/metrics.go:121 +0x754\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.(*Handler).ServeHTTP(0x40013548a0, {0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00, {0x3361da0, 0x4003c33880})\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/logger.go:227 +0x1110\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.WrapHandler.func1.1({0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/logger.go:71 +0x50\nnet/http.HandlerFunc.ServeHTTP(0x4003c3ad00, {0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2046 +0x40\ngithub.com/traefik/traefik/v2/pkg/server/router/tcp.(*Manager).buildEntryPointHandler.func1({0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/server/router/tcp/router.go:194 +0x188\nnet/http.HandlerFunc.ServeHTTP(0x4003c3aea0, {0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2046 +0x40\ngithub.com/traefik/traefik/v2/pkg/middlewares.(*HTTPHandlerSwitcher).ServeHTTP(0x400000ff50, {0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/handler_switcher.go:23 +0x70\ngithub.com/traefik/traefik/v2/pkg/middlewares/forwardedheaders.(*XForwarded).ServeHTTP(0x40006164b0, {0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/forwardedheaders/forwarded_header.go:183 +0xec\nnet/http.serverHandler.ServeHTTP({0x40002ca540}, {0x339e7e0, 0x4002b06fc0}, 0x4003ae7c00)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2878 +0x45c\nnet/http.(*conn).serve(0x4000c6d680, {0x33c18c0, 0x4000796390})\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:1929 +0xb54\ncreated by net/http.(*Server).Serve\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:3033 +0x4ac\n" middlewareType=Recovery middlewareName=traefik-internal-recovery
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/vendor/github.com/darkweak/souin/rfc/bridge.go:38:21: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/vendor/github.com/darkweak/souin/rfc/bridge.go:113:37: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/main.go:182:11: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/base.go:59:6: panic
https-proxy      | plugins-storage/sources/gop-1795076060/src/github.com/darkweak/souin/plugins/traefik/main.go:178:2: panic
https-proxy      | time="2021-08-24T18:49:24Z" level=error msg="Recovered from panic in HTTP handler [66.249.93.102:40613 - /api/google_assistant]: reflect.Set: value of type *http.Request is not assignable to type *struct { Transport http.RoundTripper; Provider interface {}; ConfigurationURL struct { TTL struct { Duration time.Duration } \"json:\\\"ttl\\\" yaml:\\\"ttl\\\"\"; Headers []string \"json:\\\"headers\\\" yaml:\\\"headers\\\"\" }; MarkCachedResponses bool; CoalescingLayerStorage *struct {}; YkeyStorage *struct { Keys map[string]struct { URL string \"json:\\\"url\\\" yaml:\\\"url\\\"\"; Headers map[string]string \"json:\\\"headers\\\" yaml:\\\"headers\\\"\" } } }" middlewareName=traefik-internal-recovery middlewareType=Recovery
https-proxy      | time="2021-08-24T18:49:24Z" level=error msg="Stack: goroutine 171 [running]:\ngithub.com/traefik/traefik/v2/pkg/middlewares/recovery.recoverFunc({0x7f81452dd8, 0x4003aeab48}, 0x4003d95a00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/recovery/recovery.go:46 +0x270\npanic({0x2661120, 0x4003d0f690})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003da6840, 0x40028adb00, 0x4003d38810)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003d0f690})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003da7b80, 0x4000fd3700, 0x4003d385f0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003d0f690})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003da7d90, 0x40028c8b00, 0x4003d383d0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003d0f690})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003d3a0b0, 0x4002316400, 0x4003d381b0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003d0f690})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\ngithub.com/traefik/yaegi/interp.runCfg.func1(0x4003d3ad10, 0x4002300600, 0x4003d37f90)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:184 +0x168\npanic({0x2661120, 0x4003d0f690})\n\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1038 +0x224\nreflect.Value.assignTo({0x2cc6680, 0x4003b02830, 0x196}, {0x2dc7161, 0xb}, 0x400279d980, 0x0)\n\t/usr/local/golang/1.10.8/go/src/reflect/value.go:2797 +0x2cc\nreflect.Value.Set({0x400279d980, 0x4003b028c8, 0x196}, {0x2cc6680, 0x4003b02830, 0x196})\n\t/usr/local/golang/1.10.8/go/src/reflect/value.go:1905 +0xa4\ngithub.com/traefik/yaegi/interp.call.func6(0x4003d3ad10)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1272 +0xb38\ngithub.com/traefik/yaegi/interp.runCfg(0x4002300600, 0x4003d3ad10)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003d3a0b0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x4002316400, 0x4003d3a0b0)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003da7d90)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x40028c8b00, 0x4003da7d90)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003da7b80)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x4000fd3700, 0x4003da7b80)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.call.func6(0x4003da6840)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:1283 +0x7ac\ngithub.com/traefik/yaegi/interp.runCfg(0x40028adb00, 0x4003da6840)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:190 +0x88\ngithub.com/traefik/yaegi/interp.genFunctionWrapper.func2.1({0x4003da8990, 0x2, 0x2})\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/interp/run.go:951 +0x41c\ngithub.com/traefik/yaegi/stdlib._net_http_Handler.ServeHTTP(...)\n\t/home/semaphore/go/pkg/mod/github.com/traefik/yaegi@v0.9.23/stdlib/go1_17_net_http.go:269\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.(*FieldHandler).ServeHTTP(0x400393fd40, {0x7f81452dd8, 0x4003aeab48}, 0x4003d95c00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/field_middleware.go:38 +0x130\ngithub.com/gorilla/mux.(*Router).ServeHTTP(0x40028d40c0, {0x7f81452dd8, 0x4003aeab48}, 0x4003d95a00)\n\t/home/semaphore/go/pkg/mod/github.com/containous/mux@v0.0.0-20181024131434-c33f32e26898/mux.go:133 +0x268\ngithub.com/traefik/traefik/v2/pkg/middlewares/recovery.(*recovery).ServeHTTP(0x4003c37120, {0x7f81452dd8, 0x4003aeab48}, 0x4003d95a00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/recovery/recovery.go:32 +0x8c\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.AddOriginFields({0x7f81452e28, 0x4003aeab40}, 0x4003d95a00, {0x3361e20, 0x4003c37120}, 0x4003da4700)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/field_middleware.go:55 +0x198\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.(*FieldHandler).ServeHTTP(0x400393fe40, {0x7f81452e28, 0x4003aeab40}, 0x4003d95a00)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/field_middleware.go:36 +0x100\ngithub.com/traefik/traefik/v2/pkg/middlewares/requestdecorator.(*RequestDecorator).ServeHTTP(0x4003054ac0, {0x7f81452e28, 0x4003aeab40}, 0x4003d95900, 0x4002ddb230)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/requestdecorator/request_decorator.go:47 +0x5e8\ngithub.com/traefik/traefik/v2/pkg/middlewares/requestdecorator.WrapHandler.func1.1({0x7f81452e28, 0x4003aeab40}, 0x4003d95900)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/requestdecorator/request_decorator.go:84 +0x70\nnet/http.HandlerFunc.ServeHTTP(0x4003c3acc0, {0x7f81452e28, 0x4003aeab40}, 0x4003d95900)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2046 +0x40\ngithub.com/traefik/traefik/v2/pkg/middlewares/metrics.(*metricsMiddleware).ServeHTTP(0x4003c33880, {0x7f81452dd8, 0x4003aeab38}, 0x4003d95900)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/metrics/metrics.go:121 +0x754\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.(*Handler).ServeHTTP(0x40013548a0, {0x339e7e0, 0x4002b07420}, 0x4003d95800, {0x3361da0, 0x4003c33880})\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/logger.go:227 +0x1110\ngithub.com/traefik/traefik/v2/pkg/middlewares/accesslog.WrapHandler.func1.1({0x339e7e0, 0x4002b07420}, 0x4003d95800)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/accesslog/logger.go:71 +0x50\nnet/http.HandlerFunc.ServeHTTP(0x4003c3ad00, {0x339e7e0, 0x4002b07420}, 0x4003d95800)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2046 +0x40\ngithub.com/traefik/traefik/v2/pkg/server/router/tcp.(*Manager).buildEntryPointHandler.func1({0x339e7e0, 0x4002b07420}, 0x4003d95800)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/server/router/tcp/router.go:194 +0x188\nnet/http.HandlerFunc.ServeHTTP(0x4003c3aea0, {0x339e7e0, 0x4002b07420}, 0x4003d95800)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2046 +0x40\ngithub.com/traefik/traefik/v2/pkg/middlewares.(*HTTPHandlerSwitcher).ServeHTTP(0x400000ff50, {0x339e7e0, 0x4002b07420}, 0x4003d95800)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/handler_switcher.go:23 +0x70\ngithub.com/traefik/traefik/v2/pkg/middlewares/forwardedheaders.(*XForwarded).ServeHTTP(0x40006164b0, {0x339e7e0, 0x4002b07420}, 0x4003d95800)\n\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/middlewares/forwardedheaders/forwarded_header.go:183 +0xec\nnet/http.serverHandler.ServeHTTP({0x40002ca540}, {0x339e7e0, 0x4002b07420}, 0x4003d95800)\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:2878 +0x45c\nnet/http.(*conn).serve(0x4000c6d860, {0x33c18c0, 0x4000796390})\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:1929 +0xb54\ncreated by net/http.(*Server).Serve\n\t/usr/local/golang/1.10.8/go/src/net/http/server.go:3033 +0x4ac\n" middlewareName=traefik-internal-recovery middlewareType=Recovery

Here is my docker-compose:

################################################################
# Providers configuration backend
################################################################
providers:
  docker:
    endpoint: unix:///var/run/docker.sock
    watch: true
    exposedByDefault: false


################################################################
# Dashboard configuration
################################################################
api:
  dashboard: true
  insecure: true


################################################################
# Pilot configuration
################################################################
pilot:
  token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"


################################################################
# Proxy HTTP cache
################################################################
experimental:
  plugins:
    souin:
      moduleName: "github.com/darkweak/souin"
      version: "v1.5.3"

traefik.yml:

services:
  https-proxy:
    build:
      context: ./traefik
      dockerfile: Dockerfile
    network_mode: host"
    labels:
      - "traefik.enable=false"


  homeassistant:
    build:
      context: ./homeassistant
      dockerfile: Dockerfile
    labels:
      # Basic configuration
      - "traefik.enable=true"
      - "traefik.http.routers.homeassistant.rule=Host(`${HOMEASSISTANT_FQDN}`)"
      - "traefik.http.routers.homeassistant.entrypoints=websecure"
      - "traefik.http.routers.homeassistant.service=homeassistant"
      - "traefik.http.routers.homeassistant.tls=true"
      - "traefik.http.routers.homeassistant.tls.certresolver=letsencrypt"
      - "traefik.http.routers.homeassistant.middlewares=http-cache,http-compress"
      - "traefik.http.services.homeassistant.loadbalancer.server.port=8123"

      # Compress middleware
      - "traefik.http.middlewares.http-compress.compress=true"

      # HTTP cache middleware
      - "traefik.http.middlewares.http-cache.plugin.souin.default_cache.headers=Authorization,Content-Type"
      - "traefik.http.middlewares.http-cache.plugin.souin.default_cache.ttl=10s"
      - "traefik.http.middlewares.http-cache.plugin.souin.log_level=debug"

@darkweak
Copy link
Owner

I will investigate on this tonight

@darkweak
Copy link
Owner

I guess you can create another issue to keep a trace.

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

Successfully merging a pull request may close this issue.

2 participants