nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Fetching IP Ranges Timeout

Open theflu opened this issue 2 years ago • 6 comments

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug Long startup time due to waiting for "Fetching IP Ranges" to timeout.

nginx-proxy-manager | [8/24/2023] [7:04:29 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
nginx-proxy-manager | [8/24/2023] [7:04:29 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
nginx-proxy-manager | [8/24/2023] [7:06:39 PM] [IP Ranges] › ✖  error     connect ETIMEDOUT 99.84.208.32:443

Nginx Proxy Manager Version v2.10.4

To Reproduce Steps to reproduce the behavior:

  1. Require your docker server to use http proxy for internet access
  2. Add proxy env var to compose file IE "HTTP_PROXY=proxy.example.com:3128" "HTTPS_PROXY=proxy.example.com:3128"
  3. Start container
  4. See logs

Expected behavior Use the http proxy in the environment variables or a way to specify the ip range in the compose file

Operating System Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-79-generic x86_64)

theflu avatar Aug 24 '23 19:08 theflu

This issue even happens right out the box

Fetching https://ip-ranges.amazonaws.com/ip-ranges.json resulting in failure is still an issue IN 2024!!!

NeDolM avatar Mar 21 '24 10:03 NeDolM

and it still not be solved......

NovaShen555 avatar Sep 05 '24 07:09 NovaShen555

Yes, it is still a problem in tencent cloud.

rer-coder avatar Sep 22 '24 05:09 rer-coder

I can get the https://ip-ranges.amazonaws.com/ip-ranges.json information with the curl command in the Docker container, but in NPM, I use the fetch command of node to execute the statement:

const fetch = require('node-fetch');
fetch('https://ip-ranges.amazonaws.com/ip-ranges.json').then(response => response.text()).then(data => console.log(data)).catch(error => console.error('Error fetching data:', error));

The return value is:

> Error fetching data: FetchError: Invalid response body while trying to fetch https://ip-ranges.amazonaws.com/ip-ranges.json: read ECONNRESET
    at PassThrough.<anonymous> (/app/node_modules/node-fetch/lib/index.js:400:12)
    at PassThrough.emit (node:events:531:35)
    at PassThrough.emit (node:domain:488:12)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'

rer-coder avatar Sep 22 '24 07:09 rer-coder

The Fetching https://ip-ranges.amazonaws.com/ip-ranges.json blocked at startup. Sometimes this will cost a lot of time.

If you're blocked by this fetching too, just run:

NPM_CTR_NAME=nginxproxymanager
docker exec $NPM_CTR_NAME sed -i 's/\.then(internalIpRanges\.fetch)//g' /app/index.js
docker restart $NPM_CTR_NAME

This should skip the fetching at the startup.

Here's the code change solution https://github.com/NginxProxyManager/nginx-proxy-manager/commit/326380cc563fe6d2dc3bd9e8cb25c6cf88ec400e

Not merged to the repo since I haven't tested it.

jqknono avatar Sep 26 '24 11:09 jqknono

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

github-actions[bot] avatar Jun 04 '25 02:06 github-actions[bot]