anse-app / chatgpt-demo

Minimal web UI for ChatGPT.
https://chatgpt.ddiu.me
MIT License
8k stars 3.82k forks source link

docker: Error response from daemon: failed to create shim task #110

Open farfarbiao opened 1 year ago

farfarbiao commented 1 year ago

Describe the bug

Status: Downloaded newer image for quzard/chatgpt-demo:latest 03595be702df46560b44495a259df89614352a5504a3ebf6a4cb9b26e7bdd413 docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/host_mnt/Users/admin/Documents/chatgpt-demo/.env" to rootfs at "/app/.env": mount /host_mnt/Users/admin/Documents/chatgpt-demo/.env:/app/.env (via /proc/self/fd/14), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

Reproduction

m2 电脑可以,m1居然不行

System Info

Status: Downloaded newer image for quzard/chatgpt-demo:latest
03595be702df46560b44495a259df89614352a5504a3ebf6a4cb9b26e7bdd413
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/host_mnt/Users/admin/Documents/chatgpt-demo/.env" to rootfs at "/app/.env": mount /host_mnt/Users/admin/Documents/chatgpt-demo/.env:/app/.env (via /proc/self/fd/14), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

Used Package Manager

npm

Validations

farfarbiao commented 1 year ago

image

z50913 commented 1 year ago

win10虚拟机部署是正常的 docker部署,首页访问正常,提一个问题之后跳转报错TypeError An error occurred. fetch failed

1

Stack Trace TypeError: fetch failed at Proxy.fetch (/chatgpt-demo/node_modules/undici/index.js:109:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Module.post (/chatgpt-demo/src/pages/api/generate.ts:24:20) at async call (file:///chatgpt-demo/node_modules/astro/dist/core/endpoint/index.js:71:20) at async call (file:///chatgpt-demo/node_modules/astro/dist/core/endpoint/dev/index.js:15:10) at async handleRoute (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/route.js:117:20) at async run (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/request.js:46:14) at async runWithErrorHandling (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/controller.js:65:5) at async handleRequest (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/request.js:40:3)

Cause { "errno": -111, "code": "ECONNREFUSED", "syscall": "connect", "address": "54.89.135.129", "port": 443 }

后台docker报错 Cause: ConnectTimeoutError: Connect Timeout Error at onConnectTimeout (/chatgpt-demo/node_modules/undici/lib/core/connect.js:182:24) at /chatgpt-demo/node_modules/undici/lib/core/connect.js:129:46 at Immediate._onImmediate (/chatgpt-demo/node_modules/undici/lib/core/connect.js:170:9) at process.processImmediate (node:internal/timers:475:21)

error fetch failed File: /chatgpt-demo/node_modules/undici/index.js:109:13 Code: 108 | } catch (err) {

109 | Error.captureStackTrace(err, this) | ^ 110 | throw err 111 | } 112 | } Stacktrace: TypeError: fetch failed at Proxy.fetch (/chatgpt-demo/node_modules/undici/index.js:109:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Module.post (/chatgpt-demo/src/pages/api/generate.ts:24:20) at async call (file:///chatgpt-demo/node_modules/astro/dist/core/endpoint/index.js:71:20) at async call (file:///chatgpt-demo/node_modules/astro/dist/core/endpoint/dev/index.js:15:10) at async handleRoute (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/route.js:117:20) at async run (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/request.js:46:14) at async runWithErrorHandling (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/controller.js:65:5) at async handleRequest (file:///chatgpt-demo/node_modules/astro/dist/vite-plugin-astro-server/request.js:40:3)

Cause: Error: connect ECONNREFUSED 54.89.135.129:443 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)

01:32:35 PM [serve] 404 /404


docker哪位大神看看,哪里有问题?

lxxxv5 commented 1 year ago

确认 docker 容器中的 chatgpt-demo 能访问 openai 接口吗? 可以用命令 docker exec -it <your_container_name> bash 进入到容器内,再用命令 curl https://api.openai.com 测试,如果长时间无响应表示访问不了 openai 接口。

HolmesZhao commented 1 year ago

docker 下 httpsproxy 配置不能用? @ddiu8081