Skip to content

Fetching IP Ranges Timeout #3157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
theflu opened this issue Aug 24, 2023 · 5 comments · May be fixed by #4398
Open

Fetching IP Ranges Timeout #3157

theflu opened this issue Aug 24, 2023 · 5 comments · May be fixed by #4398
Labels

Comments

@theflu
Copy link

theflu commented Aug 24, 2023

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 theflu added the bug label Aug 24, 2023
@NeDolM
Copy link

NeDolM commented Mar 21, 2024

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!!!

@NovaShen555
Copy link

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

@rer-coder
Copy link

Yes, it is still a problem in tencent cloud.

@rer-coder
Copy link

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'

@jqknono
Copy link

jqknono commented Sep 26, 2024

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 326380c

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants