traefik / plugindemo

This repository includes an example plugin, for you to use as a reference for developing your own plugins
https://plugins.traefik.io/plugins/628c9ee2108ecc83915d7764/demo-plugin
Apache License 2.0
140 stars 45 forks source link

Failed to open the plugin manifest #16

Closed poloyacero closed 2 years ago

poloyacero commented 2 years ago

Context: I tried to run the plugindemo in localmode following the necessary instructions in the documentation - https://github.com/traefik/plugindemo#local-mode

Static Config ```yml entryPoints: web: address: :9000 api: dashboard: true insecure: true log: level: DEBUG experimental: localPlugins: example: moduleName: github.com/traefik/plugindemo providers: file: filename: dynamic_config.yaml ```
Dynamic Config ```yml http: routers: my-router: rule: Path(`/`) service: service-foo entryPoints: - web middlewares: - testHeader services: service-foo: loadBalancer: servers: - url: http://127.0.0.1:5000/ middlewares: my-plugin: plugin: example: headers: Foo: Bar ```

Issue:

time="2022-10-05T10:43:12+04:00" level=error msg="Plugins are disabled because an error has occurred." error="1 error occurred:\n\t* failed to open the plugin manifest plugins-local\\src\\github.com\\traefik\\plugindemo\\.traefik.yml: open plugins-local\\src\\github.com\\traefik\\plugindemo\\.traefik.yml: The system cannot find the path specified.\n\n"

time="2022-10-05T10:43:13+04:00" level=error msg="invalid middleware \"my-plugin@file\" configuration: invalid middleware type or middleware does not exist" entryPointName=web routerName=my-router@file
Directory structure ![image](https://user-images.githubusercontent.com/9990246/194043086-f08f5433-594e-442e-a6ce-5c0833b48da6.png) ![image](https://user-images.githubusercontent.com/9990246/194043637-226579da-46f4-43d7-a038-4a0c66289b00.png)

Traefik version: 2.8.7

Is there something that I missed? Please let me know. Thanks.

ldez commented 2 years ago

Hello,

How do you run Traefik?

ldez commented 2 years ago

The expected structure:

.
├── traefik.exe
├── traefik.yml # Static configuration
├── dynamic_config.yml
└── plugins-local
        └── src
            └── github.com
                └── traefik
                    └── plugindemo
                        ├── demo.go
                        ├── demo_test.go
                        ├── go.mod
                        ├── LICENSE
                        ├── Makefile
                        └── readme.md

You have to run traefik from the parent of plugins-local directory.

poloyacero commented 2 years ago

Hello,

How do you run Traefik?

./traefik --configfile static_config.yaml

poloyacero commented 2 years ago

It works now. Thank you so much.