eugene-khyst / letsencrypt-docker-compose

Set up Nginx and Let’s Encrypt in less than 3 minutes with a Docker Compose project that automatically obtains and renews free Let's Encrypt SSL/TLS certificates and sets up HTTPS in Nginx for multiple domain names. Configuration is done using a simple CLI tool.
Apache License 2.0
473 stars 218 forks source link

can't open '/var/log/letsencrypt/letsencrypt.log': No such file or directory #48

Closed tka85 closed 1 year ago

tka85 commented 1 year ago

Upon starting services with cli.sh up, I see in logs:

letsencrypt-docker-compose-certbot-1  | tail: can't open '/var/log/letsencrypt/letsencrypt.log': No such file or directory

Doesn't seem to be fatal, but doesn't look too healthy either. Did I skip a step somewhere?

eugene-khyst commented 1 year ago

Please share the certbot service logs.

docker compose logs -f certbot

The file /var/log/letsencrypt/letsencrypt.log can be absent if certbot certonly has never run since the service (re)start. It is expected in --dry-run mode. And maybe in some other cases, e.g., when you restarted the service and all certificates are not yet due to renewal, so certbot certonly is not executed.

Probably, less confusing will be preserving logs from the previous executions. Certbot files can be mounted to a separate volume to survive the restarts.

tka85 commented 1 year ago

The output you asked for:

$ docker compose logs -f certbot
letsencrypt-docker-compose-certbot-1  | Obtaining the certificate for domain abc.xyz.com
letsencrypt-docker-compose-certbot-1  | Let's Encrypt certificate for abc.xyz.com already exists
letsencrypt-docker-compose-certbot-1  | tail: can't open '/var/log/letsencrypt/letsencrypt.log': No such file or directory

And nothing else. Stops there.

eugene-khyst commented 1 year ago

@tka85, I changed Certbot Docker entrypoint to remove confusing log message. There is no real error. You can pull the latest changes.