Sinaptik-AI / pandas-ai

Chat with your database (SQL, CSV, pandas, polars, mongodb, noSQL, etc). PandasAI makes data analysis conversational using LLMs (GPT 3.5 / 4, Anthropic, VertexAI) and RAG.
https://pandas-ai.com
Other
12.52k stars 1.21k forks source link

DOCKER COMPOSE ERROR: Failed to parse URL #1302

Open ywan614 opened 1 month ago

ywan614 commented 1 month ago

System Info

OS version: MACOS 14.2 (23C64) Python version: 3.11.4 pandasai : 2.2.12

🐛 Describe the bug

Encountered error while using docker-compose:

docker-compose.yml

services: postgresql: image: postgres:14.2-alpine environment: POSTGRES_USER: pandasai POSTGRES_PASSWORD: password123 POSTGRES_DB: pandasai-db ports:

networks: pandabi-network: driver: bridge

error:

=> CANCELED [server 3/12] RUN apt-get update && apt-get install -y --no-install-recommends build-essential curl make libpq-dev && apt-get clean && rm -rf /var 41.9s => CACHED [client 2/6] WORKDIR /app 0.0s => CACHED [client 3/6] COPY package*.json ./ 0.0s => CACHED [client 4/6] RUN npm install 0.0s => [client 5/6] COPY . . 0.0s => ERROR [client 6/6] RUN npm run build 41.7s


[client 6/6] RUN npm run build:
0.549
0.549 > client@0.1.0 build
0.549 > next build
0.549
1.188 Attention: Next.js now collects completely anonymous telemetry regarding usage.
1.189 This information is used to shape Next.js' roadmap and prioritize features. 1.189 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: 1.189 https://nextjs.org/telemetry 1.189 1.236 ▲ Next.js 14.2.3 1.236 1.282 Creating an optimized production build ... 36.71 ✓ Compiled successfully 36.71 Skipping linting 36.71 Checking validity of types ... 39.87 Collecting page data ... 41.10 Generating static pages (0/15) ... 41.27 Generating static pages (3/15) 41.28 Get request failed TypeError: Failed to parse URL from undefined/v1/logs/ 41.28 at new Request (node:internal/deps/undici/undici:6949:19) 41.28 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.28 ... 3 lines matching cause stack trace ... 41.28 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.28 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.28 at new NodeError (node:internal/errors:399:5) 41.28 at URL.onParseError (node:internal/url:565:9) 41.28 at new URL (node:internal/url:645:5) 41.28 at new Request (node:internal/deps/undici/undici:6947:25) 41.28 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.28 at B (/app/build/server/chunks/948.js:2:6846) 41.28 at /app/build/server/chunks/948.js:2:9092 41.28 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428) 41.28 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.28 input: 'undefined/v1/logs/', 41.28 code: 'ERR_INVALID_URL' 41.28 } 41.28 } 41.37 TypeError: Failed to parse URL from undefined/v1/logs/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.37 digest: '3507692322', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428) 41.37 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.37 input: 'undefined/v1/logs/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 Get request failed TypeError: Failed to parse URL from undefined/v1/logs/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428) 41.37 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.37 input: 'undefined/v1/logs/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 TypeError: Failed to parse URL from undefined/v1/logs/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.37 digest: '3507692322', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428) 41.37 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) { 41.37 input: 'undefined/v1/logs/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 41.37 Error occurred prerendering page "/settings/logs". Read more: https://nextjs.org/docs/messages/prerender-error 41.37 41.37 TypeError: Failed to parse URL from undefined/v1/logs/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async a (/app/build/server/app/(ee)/settings/logs/page.js:46:4428) 41.37 at async u (/app/build/server/app/(ee)/settings/logs/page.js:46:2873) 41.37 Generating static pages (7/15) 41.37 Get request failed TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/datasets/[id]/page.js:1:18985) 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 digest: '747455936', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/datasets/[id]/page.js:1:18985) 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 Get request failed TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/datasets/[id]/page.js:1:18985) 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 digest: '747455936', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/datasets/[id]/page.js:1:18985) 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 41.37 Error occurred prerendering page "/settings/workspaces/addspaces". Read more: https://nextjs.org/docs/messages/prerender-error 41.37 41.37 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/datasets/[id]/page.js:1:18985) 41.37 at async p (/app/build/server/app/settings/workspaces/addspaces/page.js:1:12080) 41.37 Get request failed TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050) 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 digest: '1617219706', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050) 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 Get request failed TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050) 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 digest: '1617219706', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050) 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) { 41.37 input: 'undefined/v1/datasets/', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 41.37 Error occurred prerendering page "/settings/datasets". Read more: https://nextjs.org/docs/messages/prerender-error 41.37 41.37 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/addspaces/page.js:1:15050) 41.37 at async u (/app/build/server/app/settings/datasets/page.js:1:8848) 41.37 Get request failed TypeError: Failed to parse URL from undefined/v1/workspace/list 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597) 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 input: 'undefined/v1/workspace/list', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 TypeError: Failed to parse URL from undefined/v1/workspace/list 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 digest: '1847044368', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597) 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 input: 'undefined/v1/workspace/list', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 Get request failed TypeError: Failed to parse URL from undefined/v1/workspace/list 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597) 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 input: 'undefined/v1/workspace/list', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 TypeError: Failed to parse URL from undefined/v1/workspace/list 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 ... 3 lines matching cause stack trace ... 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 digest: '1847044368', 41.37 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.37 at new NodeError (node:internal/errors:399:5) 41.37 at URL.onParseError (node:internal/url:565:9) 41.37 at new URL (node:internal/url:645:5) 41.37 at new Request (node:internal/deps/undici/undici:6947:25) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597) 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) { 41.37 input: 'undefined/v1/workspace/list', 41.37 code: 'ERR_INVALID_URL' 41.37 } 41.37 } 41.37 41.37 Error occurred prerendering page "/settings/workspaces". Read more: https://nextjs.org/docs/messages/prerender-error 41.37 41.37 TypeError: Failed to parse URL from undefined/v1/workspace/list 41.37 at new Request (node:internal/deps/undici/undici:6949:19) 41.37 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.37 at B (/app/build/server/chunks/948.js:2:6846) 41.37 at /app/build/server/chunks/948.js:2:9092 41.37 at async n (/app/build/server/app/settings/workspaces/[id]/page.js:1:21597) 41.37 at async c (/app/build/server/app/settings/workspaces/page.js:1:10244) 41.37 Generating static pages (11/15) 41.51 Get request failed TypeError: Failed to parse URL from undefined/v1/datasets/ 41.51 at new Request (node:internal/deps/undici/undici:6949:19) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 ... 3 lines matching cause stack trace ... 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.51 at new NodeError (node:internal/errors:399:5) 41.51 at URL.onParseError (node:internal/url:565:9) 41.51 at new URL (node:internal/url:645:5) 41.51 at new Request (node:internal/deps/undici/undici:6947:25) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 at B (/app/build/server/chunks/948.js:2:6846) 41.51 at /app/build/server/chunks/948.js:2:9092 41.51 at async i (/app/build/server/app/settings/workspaces/editspaces/page.js:1:13704) 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 input: 'undefined/v1/datasets/', 41.51 code: 'ERR_INVALID_URL' 41.51 } 41.51 } 41.51 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.51 at new Request (node:internal/deps/undici/undici:6949:19) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 ... 3 lines matching cause stack trace ... 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 digest: '820405262', 41.51 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.51 at new NodeError (node:internal/errors:399:5) 41.51 at URL.onParseError (node:internal/url:565:9) 41.51 at new URL (node:internal/url:645:5) 41.51 at new Request (node:internal/deps/undici/undici:6947:25) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 at B (/app/build/server/chunks/948.js:2:6846) 41.51 at /app/build/server/chunks/948.js:2:9092 41.51 at async i (/app/build/server/app/settings/workspaces/editspaces/page.js:1:13704) 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 input: 'undefined/v1/datasets/', 41.51 code: 'ERR_INVALID_URL' 41.51 } 41.51 } 41.51 Get request failed TypeError: Failed to parse URL from undefined/v1/datasets/ 41.51 at new Request (node:internal/deps/undici/undici:6949:19) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 ... 3 lines matching cause stack trace ... 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.51 at new NodeError (node:internal/errors:399:5) 41.51 at URL.onParseError (node:internal/url:565:9) 41.51 at new URL (node:internal/url:645:5) 41.51 at new Request (node:internal/deps/undici/undici:6947:25) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 at B (/app/build/server/chunks/948.js:2:6846) 41.51 at /app/build/server/chunks/948.js:2:9092 41.51 at async i (/app/build/server/app/settings/workspaces/editspaces/page.js:1:13704) 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 input: 'undefined/v1/datasets/', 41.51 code: 'ERR_INVALID_URL' 41.51 } 41.51 } 41.51 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.51 at new Request (node:internal/deps/undici/undici:6949:19) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 ... 3 lines matching cause stack trace ... 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 digest: '820405262', 41.51 [cause]: TypeError [ERR_INVALID_URL]: Invalid URL 41.51 at new NodeError (node:internal/errors:399:5) 41.51 at URL.onParseError (node:internal/url:565:9) 41.51 at new URL (node:internal/url:645:5) 41.51 at new Request (node:internal/deps/undici/undici:6947:25) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 at B (/app/build/server/chunks/948.js:2:6846) 41.51 at /app/build/server/chunks/948.js:2:9092 41.51 at async i (/app/build/server/app/settings/workspaces/editspaces/page.js:1:13704) 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) { 41.51 input: 'undefined/v1/datasets/', 41.51 code: 'ERR_INVALID_URL' 41.51 } 41.51 } 41.51 41.51 Error occurred prerendering page "/settings/workspaces/editspaces". Read more: https://nextjs.org/docs/messages/prerender-error 41.51 41.51 TypeError: Failed to parse URL from undefined/v1/datasets/ 41.51 at new Request (node:internal/deps/undici/undici:6949:19) 41.51 at a (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691) 41.51 at B (/app/build/server/chunks/948.js:2:6846) 41.51 at /app/build/server/chunks/948.js:2:9092 41.51 at async i (/app/build/server/app/settings/workspaces/editspaces/page.js:1:13704) 41.51 at async p (/app/build/server/app/settings/workspaces/editspaces/page.js:1:12135) 41.51 ✓ Generating static pages (15/15) 41.54 41.54 > Export encountered errors on following paths: 41.54 /(ee)/settings/logs/page: /settings/logs 41.54 /settings/datasets/page: /settings/datasets 41.54 /settings/workspaces/addspaces/page: /settings/workspaces/addspaces 41.54 /settings/workspaces/editspaces/page: /settings/workspaces/editspaces 41.54 /settings/workspaces/page: /settings/workspaces

failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

dosubot[bot] commented 1 month ago

Hey @ywan614! I'm here to help you with any issues you're facing. I can assist with bug fixes, answer questions, and guide you to become a contributor. While you wait for a human maintainer, feel free to ask me anything.

To resolve the TypeError: Failed to parse URL from undefined/v1/logs/ and similar errors during the npm run build step for the client service in your docker-compose.yml file, ensure that all required environment variables are properly set. This error often occurs when an expected environment variable is missing or undefined.

Here is a step-by-step approach to troubleshoot and resolve the issue:

  1. Check Environment Variables: Ensure that all necessary environment variables are defined in your docker-compose.yml file or in an .env file that Docker Compose can read.

  2. Update docker-compose.yml: Make sure that the environment variables are correctly passed to the client service. Here is an example of how you might define environment variables in your docker-compose.yml:

    version: '3.8'
    services:
      client:
        build:
          context: ./client
          dockerfile: Dockerfile
        environment:
          - NEXT_PUBLIC_API_URL=http://api.example.com/v1/logs/
          - NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN=your_rollbar_token
          - NEXT_PUBLIC_MIXPANEL_TOKEN=your_mixpanel_token
          - NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=your_google_analytics_id
          - NEXT_PUBLIC_INTERCOM_APP_ID=your_intercom_app_id
        ports:
          - "3000:3000"
  3. Use .env File: Alternatively, you can use a .env file to define your environment variables and ensure Docker Compose reads it. Create a .env file in the root of your project:

    NEXT_PUBLIC_API_URL=http://api.example.com/v1/logs/
    NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN=your_rollbar_token
    NEXT_PUBLIC_MIXPANEL_TOKEN=your_mixpanel_token
    NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=your_google_analytics_id
    NEXT_PUBLIC_INTERCOM_APP_ID=your_intercom_app_id

    Then, ensure your docker-compose.yml is set up to use this .env file:

    version: '3.8'
    services:
      client:
        build:
          context: ./client
          dockerfile: Dockerfile
        env_file:
          - .env
        ports:
          - "3000:3000"
  4. Verify Environment Variables in Code: Ensure that your application code correctly reads these environment variables. For example, in a TypeScript file like client/utils/constants.ts, you might use process.env to access these variables:

    export const BASE_API_URL = process.env.NEXT_PUBLIC_API_URL;
    export const NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN = process.env.NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN;
    export const NEXT_PUBLIC_MIXPANEL_TOKEN = process.env.NEXT_PUBLIC_MIXPANEL_TOKEN;
    export const NEXT_PUBLIC_GOOGLE_ANALYTICS_ID = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID;
    export const NEXT_PUBLIC_INTERCOM_APP_ID = process.env.NEXT_PUBLIC_INTERCOM_APP_ID;
    
    export const ROUTE_SIGNIN = "/auth/sign-in"
    export const ROUTE_ADMIN = "/admin"
    export const ROUTE_CHAT_SCREEN = `${ROUTE_ADMIN}/chat`

By ensuring that all required environment variables are properly set and accessible during the build process, you should be able to resolve the TypeError: Failed to parse URL from undefined/v1/logs/ error [1][2].

To continue talking to Dosu, mention @dosu.