# Failed to open the plugin manifest /.traefik.yml. traefik can't find or read the manifest

**URL:** <https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812>\
**Category:** Traefik v2\
**Tags:** plugin\
**Created:** [March 18, 2022, 9:10am UTC](https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812 "2022-03-18T09:10:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![panah](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/panah/32/5076_2.png) [@panah](https://community.traefik.io/u/panah)\
**Post date:** [March 18, 2022, 9:10am UTC](https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812/1 "2022-03-18T09:10:31Z")

</div>

I'm new to Traefik. I'm trying to develop a plugin and "connect" it to my webserver using Docker Compose. I use docker compose for development. When I try to run the Docker Compose I encountered this error:

```bash
/dev/echo-docker-compose $ docker-compose up --build
Starting echo-server ... done
Recreating traefik ... done
Attaching to echo-server, traefik
echo-server | Echo server listening on port 8080.
traefik | time="2022-03-18T07:40:11Z" level=info msg="Configuration loaded from flags."
traefik | time="2022-03-18T07:40:11Z" level=info msg="Traefik version 2.6.1 built on 2022-02-14T16:50:25Z"
traefik | time="2022-03-18T07:40: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\":{},\"udp\":{\"timeout\":\"3s\"}},\"web\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"udp\":{\"timeout\":\"3s\"}}},\"providers\":{\"providersThrottleDuration\":\"2s\",\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmModeRefreshSeconds\":\"15s\"}},\"api\":{\"insecure\":true,\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"},\"pilot\":{\"dashboard\":true},\"experimental\":{\"localPlugins\":{\"traefik-plugin-example\":{\"moduleName\":\"github.com/usergithub/traefik-plugin-example\"}}}}"
traefik | time="2022-03-18T07:40: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"
traefik | 2022/03/18 07:40:11 traefik.go:79: command traefik error: 1 error occurred:
traefik | * failed to open the plugin manifest plugins-local/src/github.com/usergithub/traefik-plugin-example/.traefik.yml: open plugins-local/src/github.com/usergithub/traefik-plugin-example/.traefik.yml: no such file or directory
traefik | 
traefik | 
traefik exited with code 1

```

I think I can conclude that the cause of this error is that it can't find the `.traefik.yml` file which is quite obvious. But, I already have the file in that directory.

This is my full directory structure

```auto
dev/plugins-local/
    └── src
        └── github.com
            └── traefik
                └── traefik-plugin-example
                    ├── plugin.go
                    ├── plugin_test.go
                    ├── .traefik.yml
                    ├── go.mod
                    ├── Dockerfile
                    ├── Makefile
    ├── traefik
    ├── traefik-plugin.go
    ├── rules-plugin.go
dev/echo-docker-compose/
    └── docker-compose.yml
    └── cmd
        └── ....

```

For some reasons, I think Docker Compose can't read `.traefik.yml`. But, it's also the same case when I try to run `./traefik --configfile traefik-plugin.yml` from `dev/plugins-local`. It also throws the same error where it can't read the `.traefik.yml`.

Anyone knows how to fix this problem?

This is the relevant codes:

On server repo

```nohighlight
# dev/echo-docker-compose/.env
PLUGIN_MODULE=github.com/usergithub/traefik-plugin-example
PLUGIN_NAME=traefik-plugin-example

# dev/echo-docker-compose/docker-compose.yml
version: "3.3"

services:
  traefik:
    image: "traefik:v2.6"
    container_name: "traefik"
    command:
      - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--experimental.localPlugins.${PLUGIN_NAME}.moduleName=${PLUGIN_MODULE}"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

  echo-server:
    image: "usergithub/echo-server"
    container_name: "echo-server"
    labels:
      - "traefik.enable=true"
      # The domain the service will respond to
      - "traefik.http.routers.echoserver.rule=Host(`echoserver.localhost`)"
      # Allow request only from the predefined entry point named "web"
      - "traefik.http.routers.echoserver.entrypoints=web"
      - "traefik.http.routers.echoserver.entrypoints=web"
      - "traefik.http.routers.echoserver.middlewares=echoserver-demo"
      - "traefik.http.middlewares.echoserver-demo.plugin.${PLUGIN_NAME}.headers.DoesPluginWork=YES"
      - "traefik.http.routers.echoserver.tls.certresolver=default"

```

On plugin repo

```nohighlight
# dev/plugins-local/traefik-plugin.go
pilot:
    token: "token"

api:
  dashboard: true
  insecure: true

experimental:
  localPlugins:
    traefik-plugin-example:
      moduleName: github.com/usergithub/traefik-plugin-example

entryPoints:
  http:
    address: ":8000"
    forwardedHeaders:
      insecure: true
  
providers:
  file:
    filename: rules-plugin.yaml 

```

```nohighlight
# dev/plugins-local/src/github.com/usergithub/traefik-plugin-example/.traefik.yml
displayName: Traefik Example Plugin
type: middleware

import: github.com/usergithub/traefik-plugin-example

summary: 'Write plugin'

testData:
  userAgent:
    - Firefox
    - Mozilla/5.0

```

---

<div class="post-metadata">

**Author:** ![tommoulard](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tommoulard/32/2997_2.png) [@tommoulard](https://community.traefik.io/u/tommoulard)\
**Post date:** [March 18, 2022, 9:55am UTC](https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812/2 "2022-03-18T09:55:20Z")

</div>

Hello @panah,

It might be due to a missing volume on docker compose to add the local plugin inside your docker container.

Hope it helps

---

<div class="post-metadata">

**Author:** ![panah](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/panah/32/5076_2.png) [@panah](https://community.traefik.io/u/panah)\
**Post date:** [March 18, 2022, 12:23pm UTC](https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812/3 "2022-03-18T12:23:30Z")

</div>

Thanks. Tried adding it to the volumes, but now it gives a different error.

```bash
failed to decode the plugin manifest plugins-local/src/github.com/usergithub/traefik-plugin-example/.traefik.yml: yaml: input error: read plugins-local/src/github.com/usergithub/traefik-plugin-example/.traefik.yml: is a directory

```

It cant decode the manifest because it thinks it's a directory. Any solution?

---

<div class="post-metadata">

**Author:** ![tommoulard](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tommoulard/32/2997_2.png) [@tommoulard](https://community.traefik.io/u/tommoulard)\
**Post date:** [March 18, 2022, 12:51pm UTC](https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812/4 "2022-03-18T12:51:30Z")

</div>

I think you get mixed up in volumes, your volume should be:

```yaml
services:
  traefik:
    ...
    volumes:
      ...
      - "./dev/plugins-local/:/plugins-local/"

```

You need to have the plugin source code in your docker container.

> [@panah](#):
>
> It cant decode the manifest because it thinks it's a directory. Any solution?

This is due to mapping a directory as a file in a volume.

---

<div class="post-metadata">

**Author:** ![panah](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/panah/32/5076_2.png) [@panah](https://community.traefik.io/u/panah)\
**Post date:** [March 18, 2022, 4:52pm UTC](https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812/5 "2022-03-18T16:52:19Z")

</div>

Thanks! I'm gonna try playing around with it. I've gotta admit I'm not really great with docker. I thought it was Traefik's issue.

---

<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 21, 2022, 4:52pm UTC](https://community.traefik.io/t/failed-to-open-the-plugin-manifest-traefik-yml-traefik-cant-find-or-read-the-manifest/13812/6 "2022-03-21T16:52:26Z")

</div>

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