Pavel Druzhinin
Pavel Druzhinin

Reputation: 155

Traefik: no space left on device

I'm trying to enable file provider for registering dynamic configuration, but I get the error:

Cannot start the provider *file.Provider: error adding file watcher: no space left on device

Traefik uses fsnotify for adding new watchers and it get a limit from variable of Linux: /proc/sys/fs/inotify/max_user_watches

I tried to change the variable inside the docker container by sudo:

sudo sysctl -w fs.inotify.max_user_watches=12288

but I'm getting a error:

sysctl: error setting key 'fs.inotify.max_user_watches': Read-only file system

Traefik configuration:

entryPoints:
    web:
        address: ":80"

    websecure:
        address: ":443"

providers:
  docker: {}
  file:
    directory: '/config'
    watch: true

api:
    dashboard: true

certificatesResolvers:
  le:
    acme:
      email: [email protected]
      storage: acme.json
      httpChallenge:
        entryPoint: web

Traefik version: 2.2.1

When I run traefik on another machine or my Mac or when I set a watch of configuration to false then it works like a charm, but I need to watch file changes

Please, tell me how I can change the variable by sudo in Alpine container or how to solve this issue in another way

Upvotes: 0

Views: 2407

Answers (1)

Pavel Druzhinin
Pavel Druzhinin

Reputation: 155

Well, I try to change max_user_watches inside docker container. It was a wrong idea. I need to change max_user_watches inside my linux machine where I run docker containers.

After run command:

sudo sysctl -w fs.inotify.max_user_watches=12288

it worked fine

Upvotes: 2

Related Questions