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部署,访问后显示 **Internal Server Error** #1556

Closed
3 tasks done
Incipe-win opened this issue May 17, 2023 · 21 comments
Closed
3 tasks done

[Bug] docker部署,访问后显示 **Internal Server Error** #1556

Incipe-win opened this issue May 17, 2023 · 21 comments

Comments

@Incipe-win
Copy link

反馈须知

⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭。

请在下方中括号内输入 x 来表示你已经知晓相关内容。

  • 我确认已经在 常见问题 中搜索了此次反馈的问题,没有找到解答;
  • 我确认已经在 Issues 列表(包括已经 Close 的)中搜索了此次反馈的问题,没有找到解答。
  • 我确认已经在 Vercel 使用教程 中搜索了此次反馈的问题,没有找到解答。

描述问题
使用 docker 部署成功后访问主页直接显示 Internal Server Error,代码是 main 分支最新的 commit。(之前的版本都没问题)

如何复现

  1. docker build -t chatgpt-next-web .
  2. docker run --rm --net host -d -e OPENAI_API_KEY=xxx -e CODE=xxx -e PROXY_URL=http://127.0.0.1:7890 chatgpt-next-web
  3. 访问主页,直接显示 Internal Server Error

截图
Internal Server Error
image

一些必要的信息

  • 系统: Ubuntu20.04
  • 浏览器: chrome
  • 版本: 最新的 commit
  • 部署方式:docker
@Yidadaa
Copy link
Collaborator

Yidadaa commented May 17, 2023

可能和这个提交有关:#1545

可以尝试 revert 这里的修改,如果确认是这里的问题,我就撤销这个提交。

@Incipe-win
Copy link
Author

可能和这个提交有关:#1545

可以尝试 revert 这里的修改,如果确认是这里的问题,我就撤销这个提交。

这个我试过了,还是一样的情况。
image

@Yidadaa
Copy link
Collaborator

Yidadaa commented May 17, 2023

搜了一下这个错误,看起来是你梯子寄了,你确认一下

@Incipe-win
Copy link
Author

搜了一下这个错误,看起来是你梯子寄了,你确认一下

emmm……,同样的环境,我降到 V2.3 是可以用的。
image
image
image

@Yidadaa
Copy link
Collaborator

Yidadaa commented May 17, 2023

等我晚上再确认这个问题吧,先用老版本

@Incipe-win
Copy link
Author

等我晚上再确认这个问题吧,先用老版本

好的,非常感谢。

@Yidadaa
Copy link
Collaborator

Yidadaa commented May 17, 2023

可以按照 #1569 改动一下。

@Incipe-win
Copy link
Author

可以按照 #1569 改动一下。

那个作者说的几种方案在提这个issue之前我都试过了的,应该是我自己这边的问题,我再看看。非常感谢。

@yinm0591
Copy link
Contributor

如果使用--network host参数:
由于容器里的3000端口是绑在ipv6上的,所以必须使用IPV6地址才能访问到容器里的chatgpt next web,例如nginx反代不能写127.0.0.1:3000,而应该写地址 [::1]:3000

@Incipe-win
Copy link
Author

如果使用--network host参数: 由于容器里的3000端口是绑在ipv6上的,所以必须使用IPV6地址才能访问到容器里的chatgpt next web,例如nginx反代不能写127.0.0.1:3000,而应该写地址 [::1]:3000

不是这个原因,同样环境,我对比了 V2.3 和 V2.4 的 proxychains log,发现一个问题。

V2.3
上图是 V2.3 的 log

V2.4
上图是 V2.4的 log
可以看到在 V2.3 版本只有在访问 api.openai.com 域名的时候才走代理,但是 V2.4 版本访问的主页时候直接就走代理了,然后我 clash 后台的日志是 connect: connection refused
我不太懂这个,因此我也不知道怎么解决这个问题。

@Incipe-win Incipe-win reopened this May 18, 2023
@Yidadaa Yidadaa closed this as completed May 19, 2023
@lin-z-z
Copy link

lin-z-z commented May 21, 2023

反馈须知

⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭。

请在下方中括号内输入 x 来表示你已经知晓相关内容。

  • 我确认已经在 常见问题 中搜索了此次反馈的问题,没有找到解答;
  • 我确认已经在 Issues 列表(包括已经 Close 的)中搜索了此次反馈的问题,没有找到解答。
  • 我确认已经在 Vercel 使用教程 中搜索了此次反馈的问题,没有找到解答。

描述问题 使用 docker 部署成功后访问主页直接显示 Internal Server Error,代码是 main 分支最新的 commit。(之前的版本都没问题)

如何复现

  1. docker build -t chatgpt-next-web .
  2. docker run --rm --net host -d -e OPENAI_API_KEY=xxx -e CODE=xxx -e PROXY_URL=http://127.0.0.1:7890 chatgpt-next-web
  3. 访问主页,直接显示 Internal Server Error

截图 Internal Server Error image

一些必要的信息

  • 系统: Ubuntu20.04
  • 浏览器: chrome
  • 版本: 最新的 commit
  • 部署方式:docker

image
你好,想请问下这个问题解决了么,我也出现了同样的问题,即使dockerfile回复到之前的版本也没有作用 @Incipe-win

@Incipe-win
Copy link
Author

反馈须知
⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭。
请在下方中括号内输入 x 来表示你已经知晓相关内容。

  • 我确认已经在 常见问题 中搜索了此次反馈的问题,没有找到解答;
  • 我确认已经在 Issues 列表(包括已经 Close 的)中搜索了此次反馈的问题,没有找到解答。
  • 我确认已经在 Vercel 使用教程 中搜索了此次反馈的问题,没有找到解答。

描述问题 使用 docker 部署成功后访问主页直接显示 Internal Server Error,代码是 main 分支最新的 commit。(之前的版本都没问题)
如何复现

  1. docker build -t chatgpt-next-web .
  2. docker run --rm --net host -d -e OPENAI_API_KEY=xxx -e CODE=xxx -e PROXY_URL=http://127.0.0.1:7890 chatgpt-next-web
  3. 访问主页,直接显示 Internal Server Error

截图 Internal Server Error image
一些必要的信息

  • 系统: Ubuntu20.04
  • 浏览器: chrome
  • 版本: 最新的 commit
  • 部署方式:docker

image 你好,想请问下这个问题解决了么,我也出现了同样的问题,即使dockerfile回复到之前的版本也没有作用 @Incipe-win

不好意思,我不知道怎么解决这个问题,我不懂typescript这一块的内容,然后最近比较忙,也没有研究了。我是直接降版本使用的,单修改Dockerfile没有用的,你使用git reset恢复到V2.3版本应该就可以了。

@lin-z-z
Copy link

lin-z-z commented May 21, 2023

反馈须知
⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭。
请在下方中括号内输入 x 来表示你已经知晓相关内容。

  • 我确认已经在 常见问题 中搜索了此次反馈的问题,没有找到解答;
  • 我确认已经在 Issues 列表(包括已经 Close 的)中搜索了此次反馈的问题,没有找到解答。
  • 我确认已经在 Vercel 使用教程 中搜索了此次反馈的问题,没有找到解答。

描述问题 使用 docker 部署成功后访问主页直接显示 Internal Server Error,代码是 main 分支最新的 commit。(之前的版本都没问题)
如何复现

  1. docker build -t chatgpt-next-web .
  2. docker run --rm --net host -d -e OPENAI_API_KEY=xxx -e CODE=xxx -e PROXY_URL=http://127.0.0.1:7890 chatgpt-next-web
  3. 访问主页,直接显示 Internal Server Error

截图 Internal Server Error image
一些必要的信息

  • 系统: Ubuntu20.04
  • 浏览器: chrome
  • 版本: 最新的 commit
  • 部署方式:docker

image 你好,想请问下这个问题解决了么,我也出现了同样的问题,即使dockerfile回复到之前的版本也没有作用 @Incipe-win

不好意思,我不知道怎么解决这个问题,我不懂typescript这一块的内容,然后最近比较忙,也没有研究了。我是直接降版本使用的,单修改Dockerfile没有用的,你使用git reset恢复到V2.3版本应该就可以了。

好的,谢谢,那我再研究下,不行就使用回退,谢谢

@gtoxlili
Copy link
Contributor

issuecomment-229821150
解决方案 :docker run 的时候指定一下 HOSTNAME -e HOSTNAME=127.0.0.1
原因:因为不指定的话他默认是直接把 /etc/hostname 当作addr了,然后就导致proxychains辨别不出这是本机的地址例如 gtoxlili:42424
@Yidadaa 当然我感觉这个貌似直接默认写进 DockerFile 里会好一点

@Incipe-win
Copy link
Author

issuecomment-229821150 解决方案 :docker run 的时候指定一下 HOSTNAME -e HOSTNAME=127.0.0.1 原因:因为不指定的话他默认是直接把 /etc/hostname 当作addr了,然后就导致proxychains辨别不出这是本机的地址例如 gtoxlili:42424 @Yidadaa 当然我感觉这个貌似直接默认写进 DockerFile 里会好一点

非常感谢,问题已解决。

@woshichenghaibo
Copy link

是用你的方法解决了这个问题,可见作者考虑也不周到

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


You solved this problem with your method, which shows that the author is not thoughtful

@woshichenghaibo
Copy link

是用你的方法解决了这个问题,可见作者考虑也不周到

issuecomment-229821150 解决方案 :docker run 的时候指定一下 HOSTNAME -e HOSTNAME=127.0.0.1 原因:因为不指定的话他默认是直接把 /etc/hostname 当作addr了,然后就导致proxychains辨别不出这是本机的地址例如 gtoxlili:42424 @Yidadaa 当然我感觉这个貌似直接默认写进 DockerFile 里会好一点

是用你的方法解决了这个问题,可见作者考虑也不周到

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


You solved this problem with your method, which shows that the author is not thoughtful

issuecomment-229821150 Solution: Specify HOSTNAME -e HOSTNAME=127.0.0.1 when docker run Reason: Because if it is not specified, it will directly use /etc/hostname as addr by default, and then the proxychains will not be able to tell that this is the address of the machine for example gtoxlili:42424 @Yidadaa Of course, I feel that this seems to be written directly into the DockerFile by default will be better

You solved this problem with your method, which shows that the author is not thoughtful

@Chinaduanyun
Copy link

issuecomment-229821150 解决方案 :docker run 的时候指定一下 HOSTNAME -e HOSTNAME=127.0.0.1 原因:因为不指定的话他默认是直接把 /etc/hostname 当作addr了,然后就导致proxychains辨别不出这是本机的地址例如 gtoxlili:42424 @Yidadaa 当然我感觉这个貌似直接默认写进 DockerFile 里会好一点

同样问题 感谢 已经解决

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


issuecomment-229821150 Solution: Specify HOSTNAME -e HOSTNAME=127.0.0.1 when docker run. Reason: Because if it is not specified, it will directly treat /etc/hostname as addr by default, which will cause proxychains to be unable to recognize that this is the address of the local machine, such as gtoxlili:42424. @Yidadaa Of course, I feel that this seems to be written directly into the DockerFile by default. will be better

Same problem, thank you, it has been solved

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

8 participants