# Create and test local plugin Error

**URL:** <https://community.traefik.io/t/create-and-test-local-plugin-error/17927>\
**Category:** Traefik v2\
**Tags:** plugin, middleware\
**Created:** [March 15, 2023, 4:22pm UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927 "2023-03-15T16:22:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/talevy/32/6803_2.png) [@talevy](https://community.traefik.io/u/talevy)\
**Post date:** [March 15, 2023, 4:22pm UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/1 "2023-03-15T16:22:57Z")

</div>

Hi,  
I'm trying to test my local plugin , and I get an error:

```auto
{“entryPointName”:“web”,“level”:“error”,“msg”:“plugin: unknown plugin type: requestid”,“routerName”:“backend-router@file”,“time”:“2023-03-15T16:08:10Z”}

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/9/96dc8bd5e51dcbb920c91e938e070488eda361c1.png)

Metadata:  
Traefik version: 2.9.5  
plugin name: requested  
location: plugins-local/src/github.com/traefik/requestid  
.traefik.yaml:

```auto
displayName: Request ID
type: middleware
import: github.com/traefik/requestid
summary: Adds a header to incoming requests

testData: {}

```

middleware config:

```auto
http:
      middlewares:
        requestid:
          plugin:
            requestid: {}

    experimental:
      localPlugins:
        requestid:
          moduleName: github.com/traefik/requestid

```

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [March 16, 2023, 1:04am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/2 "2023-03-16T01:04:53Z")

</div>

Hello,

I think you have mixed static configuration and dynamic configuration.

And your module name should not contain `github.com/traefik/`

Take a look at the documentation:

- [GitHub - traefik/plugindemo: This repository includes an example plugin, for you to use as a reference for developing your own plugins.](https://github.com/traefik/plugindemo#local-mode)

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/talevy/32/6803_2.png) [@talevy](https://community.traefik.io/u/talevy)\
**Post date:** [March 16, 2023, 8:02am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/3 "2023-03-16T08:02:29Z")

</div>

can you please help me focus on what should I change,  
my configuration looks exactly like described in the local mode example that you mentioned

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/0/058f5462dbf89cc4fe22b1ab7f545ac8c13fcad6.png)

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [March 16, 2023, 8:19am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/4 "2023-03-16T08:19:49Z")

</div>

The [dynamic configuration](https://docs.traefik.io/v2.9/getting-started/configuration-overview/#the-dynamic-configuration) and the [static configuration](https://docs.traefik.io/v2.9/getting-started/configuration-overview/#the-static-configuration) must be defined in separated files:

- [the-dynamic-configuration](https://docs.traefik.io/v2.9/getting-started/configuration-overview/#the-dynamic-configuration)
- [the-static-configuration](https://docs.traefik.io/v2.9/getting-started/configuration-overview/#the-static-configuration)

```auto
# Static configuration (traefik.yml)

experimental:
  localPlugins:
    example:
      moduleName: <your module name>

```

```auto
# dynamic configuration (related to the path of the file provider)

http:
  routers:
    my-router:
      rule: host(`demo.localhost`)
      service: service-foo
      entryPoints:
        - web
      middlewares:
        - my-plugin

  services:
   service-foo:
      loadBalancer:
        servers:
          - url: http://127.0.0.1:5000
  
  middlewares:
    my-plugin:
      plugin:
        example:
          <the configuration of your plugin>

```

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/talevy/32/6803_2.png) [@talevy](https://community.traefik.io/u/talevy)\
**Post date:** [March 16, 2023, 8:54am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/5 "2023-03-16T08:54:56Z")

</div>

the configuration is correct, is it just the place I've put it?  
I use the traefik helm chart to deploy it, can you relate me to the appropriate place for the experimental ?

> <https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml>

In the docs they uses [Traefik Labs · GitHub](http://github.com/traefik) also

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/4/485fb3557bc44cb972cb59ac02e759573f0debe5.png)

Thank you for your help 🙏 !

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [March 16, 2023, 9:07am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/6 "2023-03-16T09:07:42Z")

</div>

> [@talevy](#):
>
> is it just the place I've put it?

`experimental` is not a subset of `http`: the `http` configuration is a part of the dynamic configuration, and `experimental` is a part of the static configuration.

> [@talevy](#):
>
> I use the traefik helm chart to deploy it, can you relate me to the appropriate place for the experimental ?

- here: [https://github.com/traefik/traefik-helm-chart/blob/f91858ac0d4daa137cfcb76a9c0747e24787375a/traefik/values.yaml#L207-L210](https://github.com/traefik/traefik-helm-chart/blob/f91858ac0d4daa137cfcb76a9c0747e24787375a/traefik/values.yaml#L207-L210)

```auto
additionalArguments:
  - "--experimental.localPlugins.example.moduleName=<your module name>"

```

* * *

The documentation uses a module name with `github.com/traefik/` because it's our own plugin.  
I wrote the documentation, I wrote the demo plugin, and I also wrote the plugin system 😉

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/talevy/32/6803_2.png) [@talevy](https://community.traefik.io/u/talevy)\
**Post date:** [March 16, 2023, 9:52am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/7 "2023-03-16T09:52:21Z")

</div>

hahaha, the best person to ask! (:  
I thought the URL prefix in github is mandatory (traefik in path or anything else does not matter I guess )  
deployment parameter

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/5/5ebbe0d8689df4dd364a625eeaa0d5ac67719fa4.png)

plugins file:

```auto
    http:
      middlewares:
        requestid:
          plugin:
            requestid: {}

```

error:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bc42353f76320c744172200b8d614cdb084f9023.png)

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [March 16, 2023, 9:55am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/8 "2023-03-16T09:55:36Z")

</div>

please stop using our base module name (`github.com/traefik/`), it will work but it's a bad practice.

Can you provide all your Traefik configurations?

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/talevy/32/6803_2.png) [@talevy](https://community.traefik.io/u/talevy)\
**Post date:** [March 16, 2023, 10:02am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/9 "2023-03-16T10:02:07Z")

</div>

```auto
traefik --entrypoints.metrics.address=:9100/tcp 
--entrypoints.traefik.address=:9000/tcp 
--entrypoints.web.address=:8000/tcp 
--entrypoints.websecure.address=:8443/tcp
 --api.dashboard=true --ping=true 
--metrics.prometheus=true 
--metrics.prometheus.entrypoint=metrics 
--entrypoints.websecure.http.tls=true 
--log.format=json --log.level=DEBUG 
--providers.file.directory=/etc/traefik 
--providers.file.watch=false 
--api.insecure=true 
--experimental.localPlugins.requestid.moduleName=github.com/traefik/requestid

```

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [March 16, 2023, 10:02am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/10 "2023-03-16T10:02:54Z")

</div>

can you also provide the logs?

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/talevy/32/6803_2.png) [@talevy](https://community.traefik.io/u/talevy)\
**Post date:** [March 16, 2023, 10:37am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/11 "2023-03-16T10:37:30Z")

</div>

I looked into the logs and found the last issue

- .traefik.yml (file extension typo) 🙂

It works, thank you!!! 🙏

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [March 19, 2023, 10:38am UTC](https://community.traefik.io/t/create-and-test-local-plugin-error/17927/12 "2023-03-19T10:38:27Z")

</div>

Closed on March 19, 2023, 10:38am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
