tiredofit / docker-traefik-cloudflare-companion

Automatically Create CNAME records for containers served by Traefik
MIT License
400 stars 65 forks source link

`fmt` is not defined. #90

Open whizzzkid opened 1 year ago

whizzzkid commented 1 year ago

Summary

2023-09-04.10:08:31 [STARTING] ** [traefik-cloudflare-companion] [88] Starting Traefik Cloudflare Companion
Traceback (most recent call last):
  File "/usr/sbin/cloudflare-companion", line 68, in <module>
    formatter = logging.Formatter(fmt, date_fmt)
                                  ^^^
NameError: name 'fmt' is not defined

Steps to reproduce

:latest container images from docker hub fail

What is the expected correct behavior?

should not fail.

Relevant logs and/or screenshots

Environment

Any logs | docker-compose.yml

Possible fixes

Lebowski89 commented 5 months ago

For me, this occurred when I had traefik-cloudflare-companion and cloudflareddns in the same stack with all environment values in an .env file. What happened was that both of these containers have LOG_LEVEL as a variable, and I had included it as a variable in the .env file for cloudfladdns. So when the stack was brought up, companion was fed cloudflaredddns's LOG_LEVEL variable from the .env file (with a value of '3' - which is not a valid value for companion's log level - it either has to be Info, Verbose, or Debug).

Fix: Make a variable specifically for companion's LOG_LEVEL and point to it under environment.

I named mine CF_COMP_LOG_LEVEL. Gave it a value of INFO (CF_COMP_LOG_LEVEL=INFO) in the .env file. Then under environment in the compose details, I pointed to it by: LOG_LEVEL: ${CF_COMP_LOG_LEVEL}

This fixed it for me. Not that it was a bug with companion to begin with.