Skip to content

Instantly share code, notes, and snippets.

@Morozzzko
Created May 23, 2023 11:32
Show Gist options
  • Select an option

  • Save Morozzzko/dc9d0e8bece8fbf4f3fc9513b333fd54 to your computer and use it in GitHub Desktop.

Select an option

Save Morozzzko/dc9d0e8bece8fbf4f3fc9513b333fd54 to your computer and use it in GitHub Desktop.
Traefik plugin download issue

CSP plugin download reproduction

So hey y'all

That's an adjusted version of traefik training repo

So I'm facing a problem that a plugin fails to download due to error 500. There's a similar error in GitHub

This script is a reproduction.

To reproduce:

  1. Clone all of the files
  2. Run docker stack deploy -c docker-compose.csp.yml traefik
  3. Once all is up, navigate to http://catapp.local
  4. You won't see the cats
  5. However, if you docker logs into the traefik container, it'll show an error that it failed to download the plugin

Any tips are appreciated

version: '3'
services:
traefik:
image: traefik:v2.10
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/traefik.yml
- ./dynamic-conf.yml:/etc/traefik/dynamic-conf.yml
catapp:
image: mikesir87/cats:1.0
http:
routers:
catapp:
rule: "Host(`catapp.localhost`)"
middlewares:
- "rewrite-foo"
service: "catapp"
entrypoints:
- "web"
services:
catapp:
loadBalancer:
servers:
- url: http://catapp:5000
middlewares:
rewrite-foo:
plugin:
rewrite-body-csp:
lastModified: true
placeholder: DhcnhD3khTMePgXw
logLevel: -1
monitoring:
methods:
- GET
types:
- text/html
time="2023-05-23T11:22:11Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
time="2023-05-23T11:22:11Z" level=info msg="Traefik version 2.10.1 built on 2023-04-27T14:52:35Z"
time="2023-05-23T11:22:11Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"traefik\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}},\"web\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}},\"websecure\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}}},\"providers\":{\"providersThrottleDuration\":\"2s\",\"file\":{\"watch\":true,\"filename\":\"/etc/traefik/dynamic-conf.yml\"}},\"api\":{\"insecure\":true,\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"},\"experimental\":{\"plugins\":{\"rewrite-body-csp\":{\"moduleName\":\"github.com/joinrepublic/traefik-csp-middleware\",\"version\":\"v2.2.0\"}}}}"
time="2023-05-23T11:22:11Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://doc.traefik.io/traefik/contributing/data-collection/\n"
time="2023-05-23T11:22:11Z" level=debug msg="loading of plugin: rewrite-body-csp: github.com/joinrepublic/[email protected]"
time="2023-05-23T11:22:12Z" level=error msg="Plugins are disabled because an error has occurred." error="failed to download plugin github.com/joinrepublic/traefik-csp-middleware: error: 500: {\"error\":\"Failed to get plugin github.com/joinrepublic/[email protected]\"}\n"
time="2023-05-23T11:22:12Z" level=info msg="Starting provider aggregator aggregator.ProviderAggregator"
...
api:
dashboard: true
insecure: true
providers:
file:
filename: /etc/traefik/dynamic-conf.yml
log:
level: DEBUG
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
experimental:
plugins:
rewrite-body-csp:
moduleName: "github.com/joinrepublic/traefik-csp-middleware"
version: "v2.2.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment