NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.29k stars 2.58k forks source link

Target of symlink does not exist #2836

Open tiritibambix opened 1 year ago

tiritibambix commented 1 year ago

Checklist

Describe the bug

I have a cron job to reboot my server every sunday morning. Since a few weeks, NPM failes to start after reboot. I have to manually reboot the stack for it to work. Once I restarted db and app together, it works properly.

Nginx Proxy Manager Version

v2.10.2

To Reproduce Steps to reproduce the behavior:

  1. Reboot server
  2. See that the app is not running
  3. check logs
  4. See error

Expected behavior Should restart properly

Operating System RPi4/4Go Version: 6.3.2-2 (Shaitan) Kernel: Linux 5.15.84-v8+ Docker version 23.0.1, build a5ee5b1

Additional context Logs:

[4/16/2023] [2:13:19 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[4/16/2023] [2:13:23 AM] [SSL      ] › ✖  error     Error: Command failed: certbot renew --non-interactive --quiet --config "/etc/letsencrypt.ini" --work-dir "/tmp/letsencrypt-lib" --logs-dir "/tmp/letsencrypt-log" --preferred-challenges "dns,http" --disable-hook-validation  
Renewal configuration file /etc/letsencrypt/renewal/npm-19.conf is broken.
The error was: target /etc/letsencrypt/archive/npm-19/cert2.pem of symlink /etc/letsencrypt/live/npm-19/cert.pem does not exist
Skipping.
0 renew failure(s), 1 parse failure(s)

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Socket.<anonymous> (node:internal/child_process:458:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:301:12)
[4/16/2023] [3:13:19 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[4/16/2023] [3:13:19 AM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[4/16/2023] [3:13:19 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[4/16/2023] [3:13:20 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[4/16/2023] [3:13:20 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[4/16/2023] [3:13:21 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[4/16/2023] [3:13:25 AM] [SSL      ] › ✖  error     Error: Command failed: certbot renew --non-interactive --quiet --config "/etc/letsencrypt.ini" --work-dir "/tmp/letsencrypt-lib" --logs-dir "/tmp/letsencrypt-log" --preferred-challenges "dns,http" --disable-hook-validation  
Renewal configuration file /etc/letsencrypt/renewal/npm-19.conf is broken.
The error was: target /etc/letsencrypt/archive/npm-19/cert2.pem of symlink /etc/letsencrypt/live/npm-19/cert.pem does not exist
Skipping.
0 renew failure(s), 1 parse failure(s)

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
[4/16/2023] [4:13:19 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[4/16/2023] [4:13:24 AM] [SSL      ] › ✖  error     Error: Command failed: certbot renew --non-interactive --quiet --config "/etc/letsencrypt.ini" --work-dir "/tmp/letsencrypt-lib" --logs-dir "/tmp/letsencrypt-log" --preferred-challenges "dns,http" --disable-hook-validation  
Renewal configuration file /etc/letsencrypt/renewal/npm-19.conf is broken.
The error was: target /etc/letsencrypt/archive/npm-19/cert2.pem of symlink /etc/letsencrypt/live/npm-19/cert.pem does not exist
Skipping.
0 renew failure(s), 1 parse failure(s)

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Socket.<anonymous> (node:internal/child_process:458:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:301:12)
[4/16/2023] [5:13:19 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[4/16/2023] [5:13:23 AM] [SSL      ] › ✖  error     Error: Command failed: certbot renew --non-interactive --quiet --config "/etc/letsencrypt.ini" --work-dir "/tmp/letsencrypt-lib" --logs-dir "/tmp/letsencrypt-log" --preferred-challenges "dns,http" --disable-hook-validation  
Renewal configuration file /etc/letsencrypt/renewal/npm-19.conf is broken.
The error was: target /etc/letsencrypt/archive/npm-19/cert2.pem of symlink /etc/letsencrypt/live/npm-19/cert.pem does not exist
Skipping.
0 renew failure(s), 1 parse failure(s)

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Socket.<anonymous> (node:internal/child_process:458:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:301:12)

My docker-compose:

version: '3.3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: "host"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "user"
      DB_MYSQL_PASSWORD: "password"
      DB_MYSQL_NAME: "name"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    restart: unless-stopped
  db:
    image: 'yobasystems/alpine-mariadb'
    environment:
      MYSQL_ROOT_PASSWORD: 'passswwoord'
      MYSQL_DATABASE: 'db'
      MYSQL_USER: 'user'
      MYSQL_PASSWORD: 'password'
    volumes:
      -./db:/var/lib/mysql
    restart: unless-stopped
github-actions[bot] commented 8 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1:

Panda-3 commented 5 months ago

I am now also getting the same issue. This happens when you restart the container and also when you manually click "Renew Now" in the GUI

[4/19/2024] [11:54:39 PM] [SSL      ] › ℹ  info      Renewing Let'sEncrypt certificates via DNS for Cert #15: *.domain.com
[4/19/2024] [11:54:39 PM] [SSL      ] › ℹ  info      Command: certbot renew --config "/etc/letsencrypt.ini" --work-dir "/tmp/letsencrypt-lib" --logs-dir "/tmp/letsencrypt-log" --cert-name "npm-15" --disable-hook-validation --no-random-sleep-on-renew 
[4/19/2024] [11:54:40 PM] [Express  ] › ⚠  warning   Command failed: certbot renew --config "/etc/letsencrypt.ini" --work-dir "/tmp/letsencrypt-lib" --logs-dir "/tmp/letsencrypt-log" --cert-name "npm-15" --disable-hook-validation --no-random-sleep-on-renew 
Saving debug log to /tmp/letsencrypt-log/letsencrypt.log
Renewal configuration file /etc/letsencrypt/renewal/npm-15.conf is broken.
The error was: expected /etc/letsencrypt/live/npm-15/cert.pem to be a symlink