-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Docker compose build failure #1321
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
Comments
To resolve the Docker compose build failure related to Here are the steps to troubleshoot and resolve the issue:
Here is an example of how you might update an environment variable in your # .env file for the client or any other service trying to connect to the server
API_URL=http://server:8000 If you are using a configuration file, update the URL accordingly: {
"apiUrl": "http://server:8000"
} Additionally, ensure that your # Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN apt-get update && apt-get install netcat-openbsd -y
# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"
# Copy the current directory contents into the container at /app
COPY . /app
RUN poetry lock --no-update
# Install Python dependencies
RUN poetry install --no-root
# Add wait-for-it.sh script to the container
COPY wait-for-it.sh /wait-for-it.sh
RUN chmod +x /wait-for-it.sh
# Make port 8000 available to the world outside this container
EXPOSE 8000
# Copy entrypoint script to the container
COPY startup.sh /startup.sh
RUN chmod +x /startup.sh
# Run the entrypoint script
CMD ["/startup.sh"] By ensuring that the services communicate using the correct Docker network service names and that dependencies are properly managed, you should be able to resolve the |
@dosu 3 services: server, client and postgrescl database - are installed themselves when assembling this image, but it does not even assemble it to the end, but at the same time waits for it to start |
To ensure that the Here is an example of how you can modify the services:
postgresql:
image: postgres:14.2-alpine
environment:
POSTGRES_USER: pandasai
POSTGRES_PASSWORD: password123
POSTGRES_DB: pandasai-db
ports:
- "5430:5432"
volumes:
- ./pgdata:/var/lib/postgresql/data
networks:
- pandabi-network
server:
container_name: pandabi-backend
build:
context: ./server
dockerfile: Dockerfile
ports:
- "8000:8000"
restart: always
env_file:
- ./server/.env
depends_on:
- postgresql
networks:
- pandabi-network
command: "/bin/bash startup.sh"
client:
container_name: pandabi-frontend
build:
context: ./client
dockerfile: Dockerfile
ports:
- "3000:3000"
restart: always
env_file:
- ./client/.env
environment:
- NODE_ENV=development
- REACT_APP_API_URL=http://server:8000
command: /wait-for-it.sh server:8000 -- npm run start
depends_on:
- server
networks:
- pandabi-network
networks:
pandabi-network:
driver: bridge In this configuration:
Make sure the #!/bin/bash
host="$1"
shift
cmd="$@"
until nc -z "$host" 8000; do
>&2 echo "Server is unavailable - sleeping"
sleep 1
done
>&2 echo "Server is up - executing command"
exec $cmd After making these changes, rebuild and start the Docker services: docker-compose build
docker-compose up This should resolve the |
@dosu After this change it disappears, but about pg_config appears. The method with adding libpq-dev in the dockerfile from the issue #1289 - helps with it, but after that the following error appears again:
|
To resolve the Docker compose build failure for your Next.js project caused by a You should update the configuration in your Next.js project to use the service name Here's how you can update your Next.js project configuration:
For example, if your
Change it to:
This change ensures that the Additionally, ensure that your const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/endpoint`); By making these changes, your |
@dosu Ive gotten a bit farther, but docker compose refuses the "server" address, any guidance? => [server] resolving provenance for metadata file 0.0s
=> [client 8/10] COPY wait-for-it.sh /usr/local/bin/wait-for-it 0.1s
=> [client 9/10] RUN chmod +x /usr/local/bin/wait-for-it 0.3s
=> ERROR [client 10/10] RUN /usr/local/bin/wait-for-it server:8000 --timeout=90 --strict -- npm run build 90.4s
------
> [client 10/10] RUN /usr/local/bin/wait-for-it server:8000 --timeout=90 --strict -- npm run build:
0.276 wait-for-it: waiting 90 seconds for server:8000
0.319 nc: bad address 'server'
1.377 nc: bad address 'server'
2.422 nc: bad address 'server'
3.469 nc: bad address 'server'
...
87.50 nc: bad address 'server'
88.55 nc: bad address 'server'
89.61 nc: bad address 'server'
90.29 wait-for-it: timeout occurred after waiting 90 seconds for server:8000
90.29 wait-for-it: strict mode, refusing to execute subprocess
------
failed to solve: process "/bin/sh -c /usr/local/bin/wait-for-it server:8000 --timeout=90 --strict -- npm run build" did not complete successfully: exit code: 143 |
@dosu, I have a more comprehensive error (pandasai) ╰─❯ docker compose build --no-cache
[+] Building 184.3s (32/32) FINISHED docker:default
=> [client internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 589B 0.0s
=> [server internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.14kB 0.0s
=> [server internal] load metadata for docker.io/library/python:3.11-slim 0.5s
=> [client internal] load metadata for docker.io/library/node:19.4.0-alpine3.17 0.5s
=> [client internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [server internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [client 1/10] FROM docker.io/library/node:19.4.0-alpine3.17@sha256:ab3603cb7934b21f1ffb522b1a1d538809516c6e4cd73b144716bc1830aad1a6 0.0s
=> [client internal] load build context 0.1s
=> => transferring context: 10.75kB 0.0s
=> CACHED [client 2/10] WORKDIR /app 0.0s
=> [client 3/10] RUN apk update && apk add bash 4.1s
=> [server 1/12] FROM docker.io/library/python:3.11-slim@sha256:8fb099199b9f2d70342674bd9dbccd3ed03a258f26bbd1d556822c6dfc60c317 0.0s
=> [server internal] load build context 0.1s
=> => transferring context: 7.41kB 0.0s
=> CACHED [server 2/12] WORKDIR /app 0.0s
=> [server 3/12] RUN apt-get update && apt-get install -y --no-install-recommends build-essential curl make postgresql-server-dev-all && apt-get clean && rm -rf /var/lib/ap 52.7s
=> [client 4/10] COPY package*.json ./ 0.1s
=> [client 5/10] RUN npm install 40.9s
=> [client 6/10] RUN ls -la /app 0.9s
=> [client 7/10] COPY . . 0.5s
=> [client 8/10] COPY wait-for-it.sh /usr/local/bin/wait-for-it 0.3s
=> [client 9/10] RUN chmod +x /usr/local/bin/wait-for-it 0.8s
=> ERROR [client 10/10] RUN /usr/local/bin/wait-for-it server:8000 --timeout=70 -- npm run build 135.8s
=> [server 4/12] RUN curl -sSL https://install.python-poetry.org | python3 - 24.6s
=> [server 5/12] RUN apt-get update && apt-get install netcat-openbsd -y 5.2s
=> [server 6/12] COPY . /app 0.2s
=> [server 7/12] RUN poetry lock --no-update 7.6s
=> [server 8/12] RUN poetry install --no-root 23.2s
=> [server 9/12] COPY wait-for-it.sh /wait-for-it.sh 0.1s
=> [server 10/12] RUN chmod +x /wait-for-it.sh 0.4s
=> [server 11/12] COPY startup.sh /startup.sh 0.1s
=> [server 12/12] RUN chmod +x /startup.sh 0.4s
=> [server] exporting to image 10.5s
=> => exporting layers 10.5s
=> => writing image sha256:2eb437e90332a2a227784c449f77c0e4d197907eb01fd94a9113ce00a5ba9f16 0.0s
=> => naming to docker.io/library/pandas-ai-server 0.0s
=> [server] resolving provenance for metadata file 0.0s
------
> [client 10/10] RUN /usr/local/bin/wait-for-it server:8000 --timeout=70 -- npm run build:
0.530 wait-for-it: waiting 70 seconds for server:8000
0.573 nc: bad address 'server'
1.622 nc: bad address 'server'
2.662 nc: bad address 'server'
3.709 nc: bad address 'server'
4.753 nc: bad address 'server'
5.796 nc: bad address 'server'
6.844 nc: bad address 'server'
7.888 nc: bad address 'server'
8.934 nc: bad address 'server'
9.979 nc: bad address 'server'
11.03 nc: bad address 'server'
12.07 nc: bad address 'server'
13.24 nc: bad address 'server'
14.39 nc: bad address 'server'
15.48 nc: bad address 'server'
16.53 nc: bad address 'server'
17.61 nc: bad address 'server'
18.65 nc: bad address 'server'
19.69 nc: bad address 'server'
20.73 nc: bad address 'server'
21.77 nc: bad address 'server'
22.81 nc: bad address 'server'
23.86 nc: bad address 'server'
24.91 nc: bad address 'server'
25.95 nc: bad address 'server'
27.00 nc: bad address 'server'
28.05 nc: bad address 'server'
29.09 nc: bad address 'server'
30.14 nc: bad address 'server'
31.19 nc: bad address 'server'
32.24 nc: bad address 'server'
33.28 nc: bad address 'server'
34.33 nc: bad address 'server'
35.37 nc: bad address 'server'
36.42 nc: bad address 'server'
37.47 nc: bad address 'server'
38.51 nc: bad address 'server'
39.56 nc: bad address 'server'
40.61 nc: bad address 'server'
41.69 nc: bad address 'server'
42.73 nc: bad address 'server'
43.77 nc: bad address 'server'
44.83 nc: bad address 'server'
45.87 nc: bad address 'server'
46.91 nc: bad address 'server'
47.97 nc: bad address 'server'
49.02 nc: bad address 'server'
50.08 nc: bad address 'server'
51.12 nc: bad address 'server'
52.16 nc: bad address 'server'
53.22 nc: bad address 'server'
54.26 nc: bad address 'server'
55.30 nc: bad address 'server'
56.35 nc: bad address 'server'
57.39 nc: bad address 'server'
58.44 nc: bad address 'server'
59.48 nc: bad address 'server'
60.53 nc: bad address 'server'
61.57 nc: bad address 'server'
62.62 nc: bad address 'server'
63.67 nc: bad address 'server'
64.71 nc: bad address 'server'
65.75 nc: bad address 'server'
66.79 nc: bad address 'server'
67.83 nc: bad address 'server'
68.88 nc: bad address 'server'
69.92 nc: bad address 'server'
70.53 wait-for-it: timeout occurred after waiting 70 seconds for server:8000
71.63
71.63 > [email protected] build
71.63 > next build
71.63
73.00 Attention: Next.js now collects completely anonymous telemetry regarding usage.
73.00 This information is used to shape Next.js' roadmap and prioritize features.
73.00 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
73.00 https://nextjs.org/telemetry
73.00
73.10 ▲ Next.js 14.2.3
73.10 - Environments: .env
73.10
73.25 Creating an optimized production build ...
122.4 ✓ Compiled successfully
122.4 Skipping linting
122.4 Checking validity of types ...
130.9 Collecting page data ...
134.5 Generating static pages (0/15) ...
134.9 Generating static pages (3/15)
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597)
134.9 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597)
134.9 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '3812785553'
134.9 }
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597)
134.9 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597)
134.9 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '3812785553'
134.9 }
134.9
134.9 Error occurred prerendering page "/settings/workspaces". Read more: https://nextjs.org/docs/messages/prerender-error
134.9
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597)
134.9 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244)
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
134.9 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
134.9 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '67092955'
134.9 }
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
134.9 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
134.9 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '67092955'
134.9 }
134.9
134.9 Error occurred prerendering page "/settings/datasets". Read more: https://nextjs.org/docs/messages/prerender-error
134.9
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
134.9 at async u (/app/build/server/app/settings/datasets/page.js:1:8848)
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async i (/app/build/server/app/settings/datasets/page.js:1:13460)
134.9 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async i (/app/build/server/app/settings/datasets/page.js:1:13460)
134.9 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '1656975805'
134.9 }
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async i (/app/build/server/app/settings/datasets/page.js:1:13460)
134.9 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async i (/app/build/server/app/settings/datasets/page.js:1:13460)
134.9 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '1656975805'
134.9 }
134.9
134.9 Error occurred prerendering page "/settings/workspaces/editspaces". Read more: https://nextjs.org/docs/messages/prerender-error
134.9
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async i (/app/build/server/app/settings/datasets/page.js:1:13460)
134.9 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135)
134.9 Generating static pages (7/15)
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428)
134.9 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428)
134.9 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '1265277443'
134.9 }
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428)
134.9 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428)
134.9 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '1265277443'
134.9 }
134.9
134.9 Error occurred prerendering page "/settings/logs". Read more: https://nextjs.org/docs/messages/prerender-error
134.9
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428)
134.9 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873)
134.9 Generating static pages (11/15)
134.9 Get request failed TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
134.9 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 }
134.9 }
134.9 TypeError: fetch failed
134.9 at Object.fetch (node:internal/deps/undici/undici:14152:11)
134.9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
134.9 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
134.9 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) {
134.9 cause: Error: getaddrinfo ENOTFOUND server
134.9 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
134.9 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
134.9 errno: -3008,
134.9 code: 'ENOTFOUND',
134.9 syscall: 'getaddrinfo',
134.9 hostname: 'server'
134.9 },
134.9 digest: '3287353831'
134.9 }
135.1 Get request failed TypeError: fetch failed
135.1 at Object.fetch (node:internal/deps/undici/undici:14152:11)
135.1 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
135.1 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
135.1 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) {
135.1 cause: Error: getaddrinfo ENOTFOUND server
135.1 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
135.1 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
135.1 errno: -3008,
135.1 code: 'ENOTFOUND',
135.1 syscall: 'getaddrinfo',
135.1 hostname: 'server'
135.1 }
135.1 }
135.1 TypeError: fetch failed
135.1 at Object.fetch (node:internal/deps/undici/undici:14152:11)
135.1 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
135.1 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
135.1 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) {
135.1 cause: Error: getaddrinfo ENOTFOUND server
135.1 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
135.1 at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
135.1 errno: -3008,
135.1 code: 'ENOTFOUND',
135.1 syscall: 'getaddrinfo',
135.1 hostname: 'server'
135.1 },
135.1 digest: '3287353831'
135.1 }
135.1
135.1 Error occurred prerendering page "/settings/workspaces/addspaces". Read more: https://nextjs.org/docs/messages/prerender-error
135.1
135.1 TypeError: fetch failed
135.1 at Object.fetch (node:internal/deps/undici/undici:14152:11)
135.1 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
135.1 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050)
135.1 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080)
135.1 ✓ Generating static pages (15/15)
135.1
135.1 > Export encountered errors on following paths:
135.1 /(ee)/settings/logs/page: /settings/logs
135.1 /settings/datasets/page: /settings/datasets
135.1 /settings/workspaces/addspaces/page: /settings/workspaces/addspaces
135.1 /settings/workspaces/editspaces/page: /settings/workspaces/editspaces
135.1 /settings/workspaces/page: /settings/workspaces
------
failed to solve: process "/bin/sh -c /usr/local/bin/wait-for-it server:8000 --timeout=70 -- npm run build" did not complete successfully: exit code: 1
(pandasai) |
I had to completely reinstall Windows, Docker and recreate the user. I don't remember such an error about the network, but in my case it turned out that Docker created Ubuntu for me under the guise of a root user. As a result, I am a root admin and I have 0 rights) By the way, I also had to manually set chmod 777 for the entire root folder of the project, even after editing the config and env file. |
To resolve the "bad address 'server'" error in Docker Compose when using the Here is an example of how your version: '3.8'
services:
postgresql:
image: postgres:14.2-alpine
environment:
POSTGRES_USER: pandasai
POSTGRES_PASSWORD: password123
POSTGRES_DB: pandasai-db
ports:
- "5430:5432"
volumes:
- ./pgdata:/var/lib/postgresql/data
networks:
- pandabi-network
server:
container_name: pandabi-backend
build:
context: ./server
dockerfile: Dockerfile
ports:
- "8000:8000"
restart: always
env_file:
- ./server/.env
depends_on:
- postgresql
networks:
- pandabi-network
command: "/bin/bash startup.sh"
client:
container_name: pandabi-frontend
build:
context: ./client
dockerfile: Dockerfile
ports:
- "3000:3000"
restart: always
env_file:
- ./client/.env
environment:
- NODE_ENV=development
- REACT_APP_API_URL=http://server:8000
command: /usr/local/bin/wait-for-it server:8000 --timeout=90 --strict -- npm run build
depends_on:
- server
networks:
- pandabi-network
networks:
pandabi-network:
driver: bridge Ensure that the # Use an official Node.js runtime as a parent image
FROM node:14-alpine
# Set the working directory in the container
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm install
# Copy the current directory contents into the container at /app
COPY . .
# Add wait-for-it.sh script to the container
COPY wait-for-it.sh /usr/local/bin/wait-for-it
RUN chmod +x /usr/local/bin/wait-for-it
# Expose port 3000
EXPOSE 3000
# Run the wait-for-it script and then the build command
CMD ["/usr/local/bin/wait-for-it", "server:8000", "--timeout=90", "--strict", "--", "npm", "run", "build"] Make sure that the By ensuring that the services communicate using the correct Docker network service names and that dependencies are properly managed, you should be able to resolve the "bad address 'server'" error [1][2]. |
@ScratchyFo ya, sorry, I am not on Winblows |
System Info
OS: Ubuntu (WSL Windows 11)
Python: 3.10.2
PandasAI 2.2.14
🐛 Describe the bug
Docker compose build failure, with and without sudo
The text was updated successfully, but these errors were encountered: