Error: build时候网络错误,无论是否科学上网都报错
1️⃣ 描述一下问题
$ docker compose up --build [+] Running 6/11 ✘ graph Error context canceled 15.7s ✘ minio Error context canceled 15.7s
- etcd [⠀⣿⣿⠀⣿⠀⠀] Pulling 15.7s
- dbba69284b27 Downloading [==> ... 11.7s ✔ 270b322b3c62 Download complete 10.2s ✔ 7c21e2da1038 Download complete 10.2s
- cb4f77bfee6c Downloading [==> ... 11.7s ✔ e5485096ca5d Download complete 11.4s
- 3ea3736f61e1 Waiting 11.7s
- 1e815a2c4f55 Waiting 11.7s ✘ milvus Error Get "https://registry-1.docke... 15.7s Error response from daemon: Get "https://registry-1.docker.io/v2/": context deadline exceeded 上面是不翻墙的 下面是翻墙的 Tshow@Tshowy MINGW64 ~/Desktop/Gpro/Yuxi-Know (stable) $ docker compose up --build [+] Running 4/4 ✘ graph Error context canceled 7.8s ✘ minio Error context canceled 7.8s ✘ etcd Error context canceled 7.8s ✘ milvus Error Get "https://registry-1.docker.io/v2/": E... 7.8s Error response from daemon: Get "https://registry-1.docker.io/v2/": EOF
2️⃣ 报错日志
请运行以下命令,并提供部分相关日志:
docker logs --tail=100 api-dev
3️⃣ 相关截图
#️⃣ 其他相关信息
✅ 如果问题与模型调用相关,请尝试切换到其他在线模型
同样的问题,请问你解决了吗?
@Tiansiyu-tj 参考 readme 中最下面提供的脚本 pull 对应的镜像。docker 镜像拉取即便是挂了梯子也是用不了的。
用博主readme中的脚本,实在不行就手动下载到目录,最后build的时候最好也是科学上网,都是泪
配置一下/etc/docker/daemon.json,docker pull 应该就稍微好一点
{ "max-concurrent-downloads": 5, "max-concurrent-uploads": 3, "exec-opts": ["--timeout=600s"] , "registry-mirrors": [ "https://docker.m.daocloud.io/", "https://huecker.io/", "https://dockerhub.timeweb.cloud", "https://noohub.ru/", "https://dockerproxy.com", "https://docker.mirrors.ustc.edu.cn", "https://docker.nju.edu.cn", "https://xx4bwyg2.mirror.aliyuncs.com", "http://f1361db2.m.daocloud.io", "https://registry.docker-cn.com", "http://hub-mirror.c.163.com", "https://docker.hpcloud.cloud", "https://docker.m.daocloud.io", "https://docker.unsee.tech", "https://docker.1panel.live", "http://mirrors.ustc.edu.cn", "https://docker.chenby.cn", "http://mirror.azure.cn", "https://dockerpull.org", "https://dockerhub.icu", "https://hub.rat.dev" ]
}
无论开不开梯子,都会出现这个错误,怎么改都不行 => ERROR [api stage-0 7/11] RUN --mount=type=cache,target=/root/.cache/uv uv sync --no-install-project 91.3s
[api stage-0 7/11] RUN --mount=type=cache,target=/root/.cache/uv uv sync --no-install-project: 91.27 error: Failed to download https://github.com/astral-sh/python-build-standalone/releases/download/20250409/cpython-3.12.10%2B20250409-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz 91.27 Caused by: Request failed after 3 retries 91.27 Caused by: error sending request for url (https://github.com/astral-sh/python-build-standalone/releases/download/20250409/cpython-3.12.10%2B20250409-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz) 91.27 Caused by: client error (Connect) 91.27 Caused by: tcp connect error: Connection refused (os error 111) 91.27 Caused by: Connection refused (os error 111)
api.Dockerfile:37
36 |
37 | >>> RUN --mount=type=cache,target=/root/.cache/uv \
38 | >>> uv sync --no-install-project
39 |
target api: failed to solve: process "/bin/sh -c uv sync --no-install-project" did not complete successfully: exit code: 2
@BeardShen 可以试着在 dockerfile 中添加代理的环境变量(仅做建议)
但是需要注意在 uv sync 之后,要取消代理,设置 no_proxy 不然可能会有莫名其妙的访问问题
# copy from chatgpt...
# 设置 HTTP 和 HTTPS 代理(可能需要注意大小写)
ENV http_proxy=http://your-proxy-server:port
ENV https_proxy=http://your-proxy-server:port
ENV ftp_proxy=http://your-proxy-server:port
# 如果你还需要设置不走代理的地址(可选)
ENV no_proxy=localhost,127.0.0.1,.yourdomain.com
无论开不开梯子,都会出现这个错误,怎么改都不行
=> ERROR [api stage-0 7/11] RUN --mount=type=cache,target=/root/.cache/uv uv sync --no-install-project 91.3s
[api stage-0 7/11] RUN --mount=type=cache,target=/root/.cache/uv uv sync --no-install-project: 91.27 error: Failed to download https://github.com/astral-sh/python-build-standalone/releases/download/20250409/cpython-3.12.10%2B20250409-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz 91.27 Caused by: Request failed after 3 retries 91.27 Caused by: error sending request for url (https://github.com/astral-sh/python-build-standalone/releases/download/20250409/cpython-3.12.10%2B20250409-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz) 91.27 Caused by: client error (Connect) 91.27 Caused by: tcp connect error: Connection refused (os error 111) 91.27 Caused by: Connection refused (os error 111)
api.Dockerfile:37
36 |
37 | >>> RUN --mount=type=cache,target=/root/.cache/uv \
38 | >>> uv sync --no-install-project
39 |
target api: failed to solve: process "/bin/sh -c uv sync --no-install-project" did not complete successfully: exit code: 2
@BeardShen 同样的问题,也试了所有方法无效,有新的解决方法吗?
Downloading cpython-3.12.10-linux-x86_64-gnu (download) (20.3MiB)
error: Failed to extract archive: cpython-3.12.10-20250409-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
Caused by: failed to unpack /root/.local/share/uv/python/.temp/.tmpeowk6Z/python/lib/libpython3.12.so.1.0
Caused by: failed to unpack python/lib/libpython3.12.so.1.0 into /root/.local/share/uv/python/.temp/.tmpeowk6Z/python/lib/libpython3.12.so.1.0
Caused by: error decoding response body
Caused by: request or response body error
Caused by: error reading a body from connection
Caused by: stream error received: unspecific protocol error detected
关闭代理挂梯子会报这个错,有没有解决方案
@xiaopeng8452 木有,这个很奇怪,我腾讯云容器去拉的时候贼快,两秒,其他环境下载都慢
@xiaopeng8452 @BeardShen 一模一样的问题,请问你们有解决么? @xerrors 麻烦大佬优化下这里? 感觉遇到的人应该不少?
@lovepeace-max @BeardShen @xiaopeng8452 我注意到是之前遗留的环境变量参数导致的(可能是),现在新增了说明文档
https://github.com/xerrors/Yuxi-Know/blob/264910ea4ef41c7976c10770499fe018be173213/README.md?plain=1#L99-L107
@xerrors @Yuchuan925感谢两位大佬,试了一下构建容器成功了。@xiaopeng8452 ,我直接注释掉了那几行,你可以试试
@BeardShen 配置代理成功运行了,注释代码肯定是有服务没有启动,影响使用
@xiaopeng8452 emmmmm,这个我也不是很清楚是啥原因,我注释掉之后没出现这个警告,要研究一下