Closed itzdrli closed 2 weeks ago
@itzdrli Found an issue with healthcheck since Docker update on my server, updating ⌛
I fixed the issue on my side, let me know if it solved it for you 👍
@TeKrop I have done the whole thing again and still errored, here is the full log
root@itzdrli-dev-armv8:/home/dev# git clone https://github.com/TeKrop/overfast-api
Cloning into 'overfast-api'...
remote: Enumerating objects: 2792, done.
remote: Counting objects: 100% (776/776), done.
remote: Compressing objects: 100% (391/391), done.
remote: Total 2792 (delta 586), reused 406 (delta 385), pack-reused 2016
Receiving objects: 100% (2792/2792), 14.24 MiB | 21.96 MiB/s, done.
Resolving deltas: 100% (1963/1963), done.
root@itzdrli-dev-armv8:/home/dev# cd overfast-api/
root@itzdrli-dev-armv8:/home/dev/overfast-api# make up
Building OverFastAPI (production mode)...
docker compose build
WARN[0000] The "APP_VOLUME_PATH" variable is not set. Defaulting to a blank string.
WARN[0000] The "APP_PORT" variable is not set. Defaulting to a blank string.
[+] Building 42.0s (22/33) docker:default
=> [redis internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 109B 0.0s
=> [redis internal] load metadata for docker.io/library/redis:alpine 0.8s
=> [redis internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [redis 1/4] FROM docker.io/library/redis:alpine@sha256:0389bb8416d7c6ed065c25745179bf5d358e5d9472dd30a687ab36ffbb650262 0.0s
=> [redis internal] load build context 0.0s
=> => transferring context: 878B 0.0s
=> CACHED [redis 2/4] WORKDIR /redis 0.0s
=> CACHED [redis 3/4] COPY init.sh ./ 0.0s
=> CACHED [redis 4/4] RUN chmod +x init.sh 0.0s
=> [redis] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:2c92f9ca2855eb09cbfdea5edabec9d27a207e0ca51a6d7dd5a51a1263b2e513 0.0s
=> => naming to docker.io/library/overfast-api-redis 0.0s
=> [worker internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.04kB 0.0s
=> [app internal] load metadata for docker.io/library/python:3.12-alpine 0.7s
=> [app internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.04kB 0.0s
=> [app internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [worker internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [worker main 1/10] FROM docker.io/library/python:3.12-alpine@sha256:d24ed567ee3b972478a232ceff84b0d002e18ee9f5d38234ecbffece23dfa084 0.0s
=> [app internal] load build context 0.1s
=> => transferring context: 10.25MB 0.1s
=> [worker internal] load build context 0.1s
=> => transferring context: 10.25MB 0.1s
=> CACHED [worker main 2/10] WORKDIR /code 0.0s
=> CACHED [worker main 3/10] RUN apk add build-base && apk add libffi-dev && pip install poetry==1.8.2 0.0s
=> [app main 4/10] COPY pyproject.toml /code/ 0.1s
=> [worker main 5/10] COPY poetry.lock /code/ 0.0s
=> ERROR [app main 6/10] RUN poetry config virtualenvs.create false && poetry install --only main --no-interaction --no-ansi 40.2s
------
> [app main 6/10] RUN poetry config virtualenvs.create false && poetry install --only main --no-interaction --no-ansi:
1.580 Skipping virtualenv creation, as specified in config file.
1.881 Installing dependencies from lock file
2.118
2.118 Package operations: 41 installs, 1 update, 0 removals
2.118
2.118 - Installing mdurl (0.1.2)
2.119 - Installing sniffio (1.3.1)
39.88
39.88 gaierror
39.88
39.88 [Errno -3] Try again
39.88
39.88 at /usr/local/lib/python3.12/socket.py:964 in getaddrinfo
39.90 960│ """
39.90 961│ # We override this function since we want to translate the numeric family
39.90 962│ # and socket type values to enum constants.
39.90 963│ addrlist = []
39.90 → 964│ for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
39.90 965│ af, socktype, proto, canonname, sa = res
39.90 966│ addrlist.append((_intenum_converter(af, AddressFamily),
39.90 967│ _intenum_converter(socktype, SocketKind),
39.90 968│ proto, canonname, sa))
39.90
39.90 The following error occurred when trying to handle this error:
39.90
39.90
39.90 NameResolutionError
39.90
39.90 <urllib3.connection.HTTPSConnection object at 0xffff8c0d8950>: Failed to resolve 'pypi.org' ([Errno -3] Try again)
39.90
39.90 at /usr/local/lib/python3.12/site-packages/urllib3/connection.py:205 in _new_conn
39.91 201│ source_address=self.source_address,
39.91 202│ socket_options=self.socket_options,
39.91 203│ )
39.91 204│ except socket.gaierror as e:
39.91 → 205│ raise NameResolutionError(self.host, self, e) from e
39.91 206│ except SocketTimeout as e:
39.91 207│ raise ConnectTimeoutError(
39.91 208│ self,
39.91 209│ f"Connection to {self.host} timed out. (connect timeout={self.timeout})",
39.91
39.91 The following error occurred when trying to handle this error:
39.91
39.91
39.91 MaxRetryError
39.91
39.91 HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/mdurl/0.1.2/json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0xffff8c0d8950>: Failed to resolve 'pypi.org' ([Errno -3] Try again)"))
39.91
39.91 at /usr/local/lib/python3.12/site-packages/urllib3/util/retry.py:515 in increment
39.92 511│ )
39.92 512│
39.92 513│ if new_retry.is_exhausted():
39.92 514│ reason = error or ResponseError(cause)
39.92 → 515│ raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
39.92 516│
39.92 517│ log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)
39.92 518│
39.92 519│ return new_retry
39.92
39.92 The following error occurred when trying to handle this error:
39.92
39.92
39.92 ConnectionError
39.92
39.92 HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/mdurl/0.1.2/json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0xffff8c0d8950>: Failed to resolve 'pypi.org' ([Errno -3] Try again)"))
39.92
39.92 at /usr/local/lib/python3.12/site-packages/requests/adapters.py:700 in send
39.93 696│ if isinstance(e.reason, _SSLError):
39.93 697│ # This branch is for urllib3 v1.22 and later.
39.93 698│ raise SSLError(e, request=request)
39.93 699│
39.93 → 700│ raise ConnectionError(e, request=request)
39.93 701│
39.93 702│ except ClosedPoolError as e:
39.93 703│ raise ConnectionError(e, request=request)
39.93 704│
39.93
39.93 Cannot install mdurl.
39.93
39.93
39.93 gaierror
39.93
39.93 [Errno -3] Try again
39.93
39.93 at /usr/local/lib/python3.12/socket.py:964 in getaddrinfo
39.95 960│ """
39.95 961│ # We override this function since we want to translate the numeric family
39.95 962│ # and socket type values to enum constants.
39.95 963│ addrlist = []
39.95 → 964│ for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
39.95 965│ af, socktype, proto, canonname, sa = res
39.95 966│ addrlist.append((_intenum_converter(af, AddressFamily),
39.95 967│ _intenum_converter(socktype, SocketKind),
39.95 968│ proto, canonname, sa))
39.95
39.95 The following error occurred when trying to handle this error:
39.95
39.95
39.95 NameResolutionError
39.95
39.95 <urllib3.connection.HTTPSConnection object at 0xffff8c0d8590>: Failed to resolve 'pypi.org' ([Errno -3] Try again)
39.95
39.95 at /usr/local/lib/python3.12/site-packages/urllib3/connection.py:205 in _new_conn
39.96 201│ source_address=self.source_address,
39.96 202│ socket_options=self.socket_options,
39.96 203│ )
39.96 204│ except socket.gaierror as e:
39.96 → 205│ raise NameResolutionError(self.host, self, e) from e
39.96 206│ except SocketTimeout as e:
39.97 207│ raise ConnectTimeoutError(
39.97 208│ self,
39.97 209│ f"Connection to {self.host} timed out. (connect timeout={self.timeout})",
39.97
39.97 The following error occurred when trying to handle this error:
39.97
39.97
39.97 MaxRetryError
39.97
39.97 HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/sniffio/1.3.1/json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0xffff8c0d8590>: Failed to resolve 'pypi.org' ([Errno -3] Try again)"))
39.97
39.97 at /usr/local/lib/python3.12/site-packages/urllib3/util/retry.py:515 in increment
39.97 511│ )
39.97 512│
39.97 513│ if new_retry.is_exhausted():
39.97 514│ reason = error or ResponseError(cause)
39.97 → 515│ raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
39.97 516│
39.97 517│ log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)
39.97 518│
39.97 519│ return new_retry
39.97
39.97 The following error occurred when trying to handle this error:
39.97
39.97
39.97 ConnectionError
39.97
39.97 HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/sniffio/1.3.1/json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0xffff8c0d8590>: Failed to resolve 'pypi.org' ([Errno -3] Try again)"))
39.97
39.97 at /usr/local/lib/python3.12/site-packages/requests/adapters.py:700 in send
39.98 696│ if isinstance(e.reason, _SSLError):
39.98 697│ # This branch is for urllib3 v1.22 and later.
39.98 698│ raise SSLError(e, request=request)
39.98 699│
39.98 → 700│ raise ConnectionError(e, request=request)
39.98 701│
39.98 702│ except ClosedPoolError as e:
39.98 703│ raise ConnectionError(e, request=request)
39.98 704│
39.98
39.98 Cannot install sniffio.
39.98
------
failed to solve: process "/bin/sh -c poetry config virtualenvs.create false && \tpoetry install --only main --no-interaction --no-ansi" did not complete successfully: exit code: 1
make: *** [Makefile:61: up] Error 17
It seems you had a ponctual DNS issue with pypi.org
(where python packages are downloaded), so it failed before the healthcheck. Can you retry now and tell me if it's still the case?
Can you retry now and tell me if it's still the case?
yes, I have retried and still the same, but when I do ping pypi.org
, it shows fine (maybe?
Hmm that's weird 🤔 Can you try to clean Docker cache before build? I'm usually doing make clean
for that. Be careful as it will do a general cleaning, not only the images and layers concerning the API
docker image prune -af
docker network prune -f
Thanks, I'll try that later when I'm free. Another working theory is that my docker has some DNS related issues. Bcz another container of mine has the same issue, so I'll try to fix it by both way.
From: Valentin Porchet @.> Sent: Tuesday, June 11, 2024 9:16:12 AM To: TeKrop/overfast-api @.> Cc: Itz_Dr_Li @.>; Mention @.> Subject: Re: [TeKrop/overfast-api] Error while trying to start overfast-api (Issue #130)
Hmm that's weird 🤔 Can you try to clean Docker cache before build? I'm usually doing make clean for that. Be careful as it will do a general cleaning, not only the images and layers concerning the API
docker image prune -af docker network prune -f
— Reply to this email directly, view it on GitHubhttps://github.com/TeKrop/overfast-api/issues/130#issuecomment-2160083414, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMPKALDFIFWYCLSD3O3JSQTZG2W4ZAVCNFSM6AAAAABJA2ANEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRQGA4DGNBRGQ. You are receiving this because you were mentioned.Message ID: @.***>
@itzdrli OK 👍 Don't hesitate to give me an update when you'll have some news, in order to know if the healthcheck issue is solved for you
@TeKrop hey, the issue up there is solved by changing DNS server, but now another issue came up:
after I created a new instance (removed all old containers) then I cloned the repo and edited .env
, then I did make up
, everything seems fine:
then I checked my docker panel and it showed like this:
so I went to see the log of overfast-api-nginx-1
:
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/06/11 17:33:38 [emerg] 1#1: dlopen() "/usr/lib/nginx/modules/ngx_http_redis_module.so" failed (Error relocating /usr/lib/nginx/modules/ngx_http_redis_module.so: unsupported relocation type 7) in /etc/nginx/nginx.conf:7
nginx: [emerg] dlopen() "/usr/lib/nginx/modules/ngx_http_redis_module.so" failed (Error relocating /usr/lib/nginx/modules/ngx_http_redis_module.so: unsupported relocation type 7) in /etc/nginx/nginx.conf:7
any idea how this happend?
@itzdrli I just noticed you're using ARM-based environment, and I didn't test the API on this kind of environment 😅
The ngx_http_redis.so
nginx module I'm using in the project has only been compiled once for the project, and it may explain the issue you're encountering.
I'm currently working on dynamically compiling it on image build instead, I hope it will solve your issue, I'll keep you updated 👍
@itzdrli I made the update in the last release, let me know if it works better on your end now
@TeKrop everything is running now, and they are working fine! Thank you for all the help!
Describe the bug Errored when trying to run overfast-api in production
To Reproduce
git clone https://github.com/TeKrop/overfast-api && cd overfast-api
.env
and changedAPP_PORT
,APP_BASE_URL
apt install make
(GNU make 4.3)overfast-api
)Expected behavior overfast-api runs well
Screenshots
Additional context my server specs:
and docker version: