Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traefik.yaml: is a directory #140

Open
DW4y opened this issue Feb 17, 2024 · 9 comments
Open

traefik.yaml: is a directory #140

DW4y opened this issue Feb 17, 2024 · 9 comments
Assignees
Labels
problem Fixing a problem

Comments

@DW4y
Copy link

DW4y commented Feb 17, 2024

Hi,

I used your template and Youtube and running in this issue:

2024/02/17 12:10:38 command traefik error: read /etc/traefik/traefik.yaml: is a directory

Docker-Compose:

---
networks:
  frontend:
    external: true
  backend:
    external: true
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    ports:
      - 80:80
      - 443:443
      - 8080:8080
    volumes:
      - ./config:/etc/traefik/
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      - NJALLA_TOKEN=XYZ
    networks:
      - frontend
      - backend
    restart: unless-stopped

traefik.yaml:

global:
  checkNewVersion: true
  sendAnonymousUsage: false

# -- (Optional) Change Log Level and Format here...
#     - loglevels [DEBUG, INFO, WARNING, ERROR, CRITICAL]
#     - format [common, json, logfmt]
# log:
#  level: ERROR
#  format: common
#  filePath: /var/log/traefik/traefik.log

# -- (Optional) Enable Accesslog and change Format here...
#     - format [common, json, logfmt]
# accesslog:
#   format: common
#   filePath: /var/log/traefik/access.log

# -- (Optional) Enable API and Dashboard here, don't do in production
# api:
#   dashboard: true
#   insecure: true

# -- Change EntryPoints here...
entryPoints:
  web:
    address: :80
    # -- (Optional) Redirect all HTTP to HTTPS
    # http:
    #   redirections:
    #     entryPoint:
    #       to: websecure
    #       scheme: https
  websecure:
    address: :443
  # -- (Optional) Add custom Entrypoint
  # custom:
  #   address: :8080

# -- Configure your CertificateResolver here...
# certificatesResolvers:
#   staging:
#     acme:
#       email: [email protected]
#       storage: /etc/traefik/certs/acme.json
#       caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
#       -- (Optional) Remove this section, when using DNS Challenge
#       httpChallenge:
#         entryPoint: web
#       -- (Optional) Configure DNS Challenge
#       dnsChallenge:
#         provider: your-resolver (e.g. cloudflare)
#         resolvers:
#           - "1.1.1.1:53"
#           - "8.8.8.8:53"
#   production:
#     acme:
#       email: [email protected]
#       storage: /etc/traefik/certs/acme.json
#       caServer: "https://acme-v02.api.letsencrypt.org/directory"
#       -- (Optional) Remove this section, when using DNS Challenge
#       httpChallenge:
#         entryPoint: web
#       -- (Optional) Configure DNS Challenge
#       dnsChallenge:
#         provider: your-resolver (e.g. cloudflare)
#         resolvers:
#           - "1.1.1.1:53"
#           - "8.8.8.8:53"

# -- (Optional) Disable TLS Cert verification check
# serversTransport:
#   insecureSkipVerify: true

# -- (Optional) Overwrite Default Certificates
# tls:
#   stores:
#     default:
#       defaultCertificate:
#         certFile: /etc/traefik/certs/cert.pem
#         keyFile: /etc/traefik/certs/cert-key.pem
# -- (Optional) Disable TLS version 1.0 and 1.1
#   options:
#     default:
#       minVersion: VersionTLS12

providers:
  docker:
    # -- (Optional) Enable this, if you want to expose all containers automatically
    exposedByDefault: false
  file:
    directory: /etc/traefik
    watch: true

traefik folder:
Screenshot 2024-02-17 131844

Thanks
Pierre

@ChristianLempa ChristianLempa self-assigned this Feb 19, 2024
@ChristianLempa
Copy link
Owner

ChristianLempa commented Feb 19, 2024

@DW4y, updated the docker-compose.yaml file in the main branch. Can you check if it works?

@ChristianLempa ChristianLempa added the problem Fixing a problem label Feb 19, 2024
@danielschlick
Copy link

@ChristianLempa i tried the new docker-compose and followed your tutorial and still got the same message as @DW4y.
Folder structure of course the same as in the first question

@cschug
Copy link
Collaborator

cschug commented Mar 2, 2024

I fail to see how the screenshot titled "traefik folder" relates to the rest because the docker-compose.yaml doesn't use an /etc/traefik sub-directory on the host (and the screenshot strongly suggests to show /etc/traefik on the Docker hosts rather than showing the situation inside the container).

The docker-compose.yaml of this repository also doesn't use /etc/traefik on the host, it has done historically though, but that changed per commit a81b954 more than 6 months ago.

@svenmang2
Copy link

got the same issue on a ubuntu server for me since i have multiple docker instance's i hopped to one using Debian and it worked like expected

@cschug
Copy link
Collaborator

cschug commented Mar 3, 2024

@svenmang2 is it possible you had an old volume of earlier installation attempts around on your Ubuntu machine which did not play well with the changes done over the last few months? Did you try ...

$ docker compose down --remove-orphans --volumes
$ docker compose up --detach

?

@svenmang2
Copy link

svenmang2 commented Mar 3, 2024

i could try but it was a fresh installed VM for testing purpose's so it shouldn't have any thing on it except portainer wich was also freshly installed

@blockiyt
Copy link

Getting the same error, any soloutions?

@svenmang2
Copy link

svenmang2 commented May 6, 2024

hey sorry for the verry late response spun up another sytem using this boiler plate(as a template)

using vs code i saw that it was indeed a diractory i made the yml file using touch under a diffent file name
then used CP to use the original file nmae but then portainer said it had some wierd flags on that file so i pointed the ccompase to the a file named traefik-conf this fixed it for me (- /etc/traefik/config/traefik-conf.yml:/etc/traefik/traefik.yml:ro)

the error i got when i cp-ed the file over:

"/etc/traefik/config/traefik.yml" to rootfs at "/etc/traefik/traefik.yml": mount /etc/traefik/config/traefik.yml:/etc/traefik/traefik.yml (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

@svenmang2
Copy link

@svenmang2 is it possible you had an old volume of earlier installation attempts around on your Ubuntu machine which did not play well with the changes done over the last few months? Did you try ...

$ docker compose down --remove-orphans --volumes
$ docker compose up --detach

?

unfortunately i had some Nass issue's and reused the VM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Fixing a problem
Projects
None yet
Development

No branches or pull requests

6 participants