hassio-addons / addon-nginx-proxy-manager

Nginx Proxy Manager - Home Assistant Community Add-ons
https://addons.community
MIT License
315 stars 101 forks source link

Test Server Reachability fails #540

Closed hulkhaugen closed 4 months ago

hulkhaugen commented 4 months ago

Problem/Motivation

Today, all of my services were unreachable with their sub-domains. I only have one certificate that i use for all my services, and that has been working fine for a couple of years. The common source points at NPM, but I can't say with 100% certanty that this is the issue. Cloudflare and my router could also be worth checking out. I have verified that Cloudflare has the correct IP address, and that port 80 and 443 is forwarded to my server where NPM is installed.

Expected behavior

No errors

Actual behavior

When i go to the SSL Certificates tab, click the menu for the certificate and click Test Server Reachability, I get the error message Communication with the API failed, is NPM running correctly? Here are the logs:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Nginx Proxy Manager
 Manage Nginx proxy hosts with a simple, powerful interface
-----------------------------------------------------------
 Add-on version: 1.0.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.2.1
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-npm: starting
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-npm successfully started
s6-rc: info: service npm: starting
s6-rc: info: service npm successfully started
s6-rc: info: service init-nginx successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[16:28:52] INFO: Starting the Manager...
[16:28:52] INFO: Starting NGinx...
nginx: [warn] protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy_host/10.conf:14
s6-rc: info: service legacy-services successfully started
[2/13/2024] [4:28:53 PM] [Global   ] › ℹ  info      Using Sqlite: /config/database.sqlite
[2/13/2024] [4:28:54 PM] [Migrate  ] › ℹ  info      Current database version: none
[2/13/2024] [4:28:54 PM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[2/13/2024] [4:28:54 PM] [Setup    ] › ℹ  info      Logrotate completed.
[2/13/2024] [4:28:54 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[2/13/2024] [4:28:54 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[2/13/2024] [4:28:54 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[2/13/2024] [4:28:54 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[2/13/2024] [4:28:54 PM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[2/13/2024] [4:28:54 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[2/13/2024] [4:28:54 PM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[2/13/2024] [4:28:54 PM] [Global   ] › ℹ  info      Backend PID 157 listening on port 3000 ...
[2/13/2024] [4:28:55 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[2/13/2024] [4:28:55 PM] [SSL      ] › ℹ  info      Renew Complete
2024/02/13 16:28:55 [warn] 172#172: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy_host/10.conf:14
[2/13/2024] [4:30:17 PM] [SSL      ] › ℹ  info      Testing http challenge for example.no
Uncaught SyntaxError: Unexpected end of JSON input

FROM
2024/02/13 16:30:18 [error] 226#226: *1 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.168, server: nginxproxymanager, request: "GET /api/nginx/certificates/test-http?domains=%5B%22example.no%22%5D HTTP/1.1", upstream: "http://127.0.0.1:3000/nginx/certificates/test-http?domains=%5B%22example.no%22%5D", host: "192.168.1.3:81", referrer: "http://192.168.1.3:81/nginx/certificates"
JSON.parse (<anonymous>)IncomingMessage.<anonymous> (/opt/nginx-proxy-manager/internal/certificate.js:1178:31)IncomingMessage.emit (node:events:529:35)endReadableNT (node:internal/streams/readable:1400:12)process.processTicksAndRejections (node:internal/process/task_queues:82:21)[16:30:18] INFO: Service Nginx Proxy Manager exited with code 256 (by signal 5)

Steps to reproduce

Not sure how this happend

Proposed changes

N/A

hulkhaugen commented 4 months ago

I finally found the issue, which in my case was totally unrelated to NPM. I was checking my public IP and kept getting different responses. Trying to see if my ports were open kept saying no. Tried to downgrade Router firmware, but still the same. Contacted my ISP and asked about my IP, and they said they'll give me a new semi-fixed IP. Problem solved.

Sorry to ask in here in the first place.