Skip to content
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

GeoIP DB : unable to build with docker, behind an HTTP-PROXY #3327

Open
mqu opened this issue Mar 25, 2025 · 4 comments
Open

GeoIP DB : unable to build with docker, behind an HTTP-PROXY #3327

mqu opened this issue Mar 25, 2025 · 4 comments

Comments

@mqu
Copy link

mqu commented Mar 25, 2025

Describe the Bug

I am trying to build UMANI with docker compose build ; It's working nice on my personnal computer, connected directly on the Internet. But when I want to build on internal network in my company, there is an error when trying to down download GeoDB database with script scripts/

then, here is docker-compose with build section, passing some environment variables:

services:
  app:
    # <<: *default-settings-std
    # <<: *defaults-ress-limit
    # <<: *defaults-cap-limit
    # <<: [*default-settings-std, *defaults-ress-limit, *defaults-cap-limit]
    # image: ghcr.io/umami-software/umami:postgresql-latest
    image: umami-custom:v2.17.0
    build:
       context: ./build/umami/src
       args:
        - HTTP_PROXY=http://proxy:3128/
        - HTTPS_PROXY=http://proxy:3128/
        - http_proxy=http://proxy:3128/
        - HTTPS_PROXY=http://proxy:3128/
        - DATABASE_TYPE=postgres
        - DATABASE_URL=postgresql://umami:umami@umami_db_1:5432/umami
        - BASE_URL=http://localhost:3000/stats/
        - BASE_PATH=/stats
    ports:
      - "3000:3000"
    environment:
      DATABASE_URL: postgresql://umami:umami@db:5432/umami
      DATABASE_TYPE: postgresql
      APP_SECRET: replace-me-with-a-random-string
      

I need to change BASE_PATH, and I have seen, we need to rebuild Umani docker image to change it's value : this is a build-time environment variable (https://umami.is/docs/environment-variables#build-time-variables).

Database

PostgreSQL

Relevant log output

Here is the terminal error behind : 

#18 5.755 $ node scripts/build-geo.js
#18 6.958 node:events:496
#18 6.958       throw er; // Unhandled 'error' event
#18 6.958       ^
#18 6.958 
#18 6.958 AggregateError [ETIMEDOUT]: 
#18 6.958     at internalConnectMultiple (node:net:1139:18)
#18 6.958     at internalConnectMultiple (node:net:1215:5)
#18 6.958     at Timeout.internalConnectMultipleTimeout (node:net:1739:5)
#18 6.958     at listOnTimeout (node:internal/timers:596:11)
#18 6.958     at process.processTimers (node:internal/timers:529:7)
#18 6.958 Emitted 'error' event on ClientRequest instance at:
#18 6.958     at emitErrorEvent (node:_http_client:104:11)
#18 6.958     at TLSSocket.socketErrorListener (node:_http_client:518:5)
#18 6.958     at TLSSocket.emit (node:events:518:28)
#18 6.958     at emitErrorNT (node:internal/streams/destroy:170:8)
#18 6.958     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
#18 6.958     at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
#18 6.958   code: 'ETIMEDOUT',
#18 6.958   [errors]: [
#18 6.958     Error: connect ETIMEDOUT 185.199.110.133:443
#18 6.958         at createConnectionError (node:net:1675:14)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -110,
#18 6.958       code: 'ETIMEDOUT',
#18 6.958       syscall: 'connect',
#18 6.958       address: '185.199.110.133',
#18 6.958       port: 443
#18 6.958     },
#18 6.958     Error: connect ENETUNREACH 2606:50c0:8003::154:443 - Local (:::0)
#18 6.958         at internalConnectMultiple (node:net:1211:16)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1739:5)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -101,
#18 6.958       code: 'ENETUNREACH',
#18 6.958       syscall: 'connect',
#18 6.958       address: '2606:50c0:8003::154',
#18 6.958       port: 443
#18 6.958     },
#18 6.958     Error: connect ETIMEDOUT 185.199.108.133:443
#18 6.958         at createConnectionError (node:net:1675:14)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -110,
#18 6.958       code: 'ETIMEDOUT',
#18 6.958       syscall: 'connect',
#18 6.958       address: '185.199.108.133',
#18 6.958       port: 443
#18 6.958     },
#18 6.958     Error: connect ENETUNREACH 2606:50c0:8000::154:443 - Local (:::0)
#18 6.958         at internalConnectMultiple (node:net:1211:16)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1739:5)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -101,
#18 6.958       code: 'ENETUNREACH',
#18 6.958       syscall: 'connect',
#18 6.958       address: '2606:50c0:8000::154',
#18 6.958       port: 443
#18 6.958     },
#18 6.958     Error: connect ETIMEDOUT 185.199.109.133:443
#18 6.958         at createConnectionError (node:net:1675:14)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -110,
#18 6.958       code: 'ETIMEDOUT',
#18 6.958       syscall: 'connect',
#18 6.958       address: '185.199.109.133',
#18 6.958       port: 443
#18 6.958     },
#18 6.958     Error: connect ENETUNREACH 2606:50c0:8001::154:443 - Local (:::0)
#18 6.958         at internalConnectMultiple (node:net:1211:16)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1739:5)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -101,
#18 6.958       code: 'ENETUNREACH',
#18 6.958       syscall: 'connect',
#18 6.958       address: '2606:50c0:8001::154',
#18 6.958       port: 443
#18 6.958     },
#18 6.958     Error: connect ETIMEDOUT 185.199.111.133:443
#18 6.958         at createConnectionError (node:net:1675:14)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -110,
#18 6.958       code: 'ETIMEDOUT',
#18 6.958       syscall: 'connect',
#18 6.958       address: '185.199.111.133',
#18 6.958       port: 443
#18 6.958     },
#18 6.958     Error: connect ENETUNREACH 2606:50c0:8002::154:443 - Local (:::0)
#18 6.958         at internalConnectMultiple (node:net:1211:16)
#18 6.958         at Timeout.internalConnectMultipleTimeout (node:net:1739:5)
#18 6.958         at listOnTimeout (node:internal/timers:596:11)
#18 6.958         at process.processTimers (node:internal/timers:529:7) {
#18 6.958       errno: -101,
#18 6.958       code: 'ENETUNREACH',
#18 6.958       syscall: 'connect',
#18 6.958       address: '2606:50c0:8002::154',
#18 6.958       port: 443
#18 6.958     }
#18 6.958   ]
#18 6.958 }
#18 6.958 
#18 6.958 Node.js v22.14.0
#18 6.971 error Command failed with exit code 1.
#18 6.971 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#18 6.984 ERROR: "build-geo" exited with 1.
#18 6.998 error Command failed with exit code 1.
#18 6.998 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#18 ERROR: process "/bin/sh -c yarn build-docker" did not complete successfully: exit code: 1
------
 > [app builder 6/6] RUN yarn build-docker:
6.958     }
6.958   ]
6.958 }
6.958 
6.958 Node.js v22.14.0
6.971 error Command failed with exit code 1.
6.971 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
6.984 ERROR: "build-geo" exited with 1.
6.998 error Command failed with exit code 1.
6.998 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: process "/bin/sh -c yarn build-docker" did not complete successfully: exit code: 1

Which Umami version are you using? (if relevant)

v2.17.0

Which browser are you using? (if relevant)

How are you deploying your application? (if relevant)

docker-compose build - 20.10.17

@mikecao
Copy link
Collaborator

mikecao commented Mar 26, 2025

That step tries to download the latest GEO database. If your proxy is blocking it I'm not sure what we can do.

@mqu
Copy link
Author

mqu commented Mar 26, 2025

hi Mikeao,

  • my proxy is not blocking ; this is a permissive proxy without many (any) filtrering
  • I think build-geo.js script do not take care of env vars (HTTP_PROXY*), especialy on line 33 ; may be I am wrong on this point.
  • I am going to make some checks with BASH and CURL.
    best regards.

EDIT : I have done some tests with CURL and node:https.get : https://gist.github.com/mqu/6e3ea3d75ee8c1c598c47d943e9039b6

@kewarrie
Copy link

kewarrie commented Apr 8, 2025

Hi @mqu were you able to resolve this?

@mqu
Copy link
Author

mqu commented Apr 8, 2025

Hi @mqu were you able to resolve this?

no ; I have build a docker image somewhere without PROXY constraint and I pull this docker image where I need to run Umami.

I don't have enough knowledge to modify download script and not enough time.

best regards.

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

No branches or pull requests

3 participants