Skip to content
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

[BUG]升级到最新docker镜像启动报错 #104

Closed
ajasonwang opened this issue Mar 30, 2023 · 8 comments
Closed

[BUG]升级到最新docker镜像启动报错 #104

ajasonwang opened this issue Mar 30, 2023 · 8 comments

Comments

@ajasonwang
Copy link

最新镜像信息:

chenzhaoyu94/chatgpt-web   latest    5e73fa54c3c2   21 hours ago   352MB

报错信息:

2023-03-30T04:57:26.729862Z ERROR vocechat_server: failed to download hash file url="https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5" err=error sending request for 
[src/main.rs:248] config.clone() = Config {
    system: SystemConfig {
        data_dir: "./data",
        token_expiry_seconds: 300,
        refresh_token_expiry_seconds: 604800,
        magic_token_expiry_seconds: 900,
        upload_avatar_limit: 524288,
        send_image_limit: 2097152,
        upload_timeout_seconds: 300,
        file_expiry_days: 90,
        max_favorite_archives: 100,
    }
...
@zerosoul
Copy link
Contributor

这是下载客户端代码包报错了 请检查下自己服务器的网络情况 比如:使用curl 在服务器请求下地址:https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5,看看能不能正常获取到文件。

@ajasonwang
Copy link
Author

这是下载客户端代码包报错了 请检查下自己服务器的网络情况 比如:使用curl 在服务器请求下地址:https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5,看看能不能正常获取到文件。

VPS在美国,主机上wget可以下载,看来是容器里面下载不到

@ajasonwang
Copy link
Author

改了一下DNS映射重启容器

  -p 3000:3000 \
  --name vocechat-server \
  -v /root/vocechat/data:/home/vocechat-server/data \
  -v /etc/resolv.conf:/etc/resolv.conf \
  privoce/vocechat-server:latest

还有报错,rust就不太懂了

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', src/main.rs:345:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-03-31T12:02:18.607417Z ERROR vocechat_server: failed to download hash file url="https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5" err=error sending request for url (https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5): error trying to connect: dns error: task 43 was cancelled

@zerosoul
Copy link
Contributor

zerosoul commented Apr 2, 2023

这个报错... 应该依然和docker内的网络环境有关,有 dns error 关键词。
试试进到docker里面,手动下载 https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5

@ajasonwang
Copy link
Author

这个报错... 应该依然和docker内的网络环境有关,有 dns error 关键词。 试试进到docker里面,手动下载 https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5

确实很奇怪的 wget: bad address 's.voce.chat' 错误

root@VM:~/vocechat# docker run --rm -v /etc/resolv.conf:/etc/resolv.conf -v /root/vocechat/data:/home/vocechat-server/data -e RUST_BACKTRACE="full" bash -c "wget https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5" privoce/vocechat-server:latest
wget: bad address 's.voce.chat'
root@VM:~/vocechat# cat /etc/resolv.conf 
nameserver 8.8.8.8
nameserver 1.1.1.1
root@VM:~/vocechat# ping s.voce.chat
PING d3rcyn4t3tkpyq.cloudfront.net (99.84.203.19) 56(84) bytes of data.
64 bytes from server-99-84-203-19.lax3.r.cloudfront.net (99.84.203.19): icmp_seq=1 ttl=247 time=0.940 ms
64 bytes from server-99-84-203-19.lax3.r.cloudfront.net (99.84.203.19): icmp_seq=2 ttl=247 time=0.889 ms
^C
--- d3rcyn4t3tkpyq.cloudfront.net ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.889/0.914/0.940/0.025 ms
root@VM:~/vocechat# wget https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5
--2023-04-05 12:55:44--  https://s.voce.chat/web_client/v0.3.x/web.vocechat.md5
Resolving s.voce.chat (s.voce.chat)... 99.84.203.19, 99.84.203.8, 99.84.203.116, ...
Connecting to s.voce.chat (s.voce.chat)|99.84.203.19|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32 [binary/octet-stream]
Saving to: ‘web.vocechat.md5’

web.vocechat.md5                                                             100%[===========================================================================================================================================================================================>]      32  --.-KB/s    in 0s      

2023-04-05 12:55:44 (4.32 MB/s) - ‘web.vocechat.md5’ saved [32/32]

root@VM:~/vocechat#

@ajasonwang
Copy link
Author

ajasonwang commented Apr 9, 2023

这个问题我大概找到思路了,猜测是由于alpine里面基于busybox的wget不是完整的wget所以不能很好处理https请求,不清楚rust实现请求这个md5文件的时候是不是用到了wget或者busybox相关的库去发起HTTPS请求,参考 adamrehn/ue4-docker#311 所以最好是从基础镜像上规避一下。

@RoeWade
Copy link

RoeWade commented Apr 9, 2023

镜像是基于 busybox,不过处理过证书。

FROM alpine as certs
RUN apk update && apk add ca-certificates

FROM busybox
COPY --from=certs /etc/ssl/certs /etc/ssl/certs

wget 是否可以工作还需要验证一下。最上面那个错误是 rust 的 reqwest 库(依赖 rustls)下载引起的错误,不是调用的 wget。

@ajasonwang
Copy link
Author

docker run的时候加上 --privileged 参数就可以解决了,因此关闭issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants