linweiyuan / go-chatgpt-api

一个尝试绕过 Cloudflare 来使用 ChatGPT 接口的程序
MIT License
1.43k stars 444 forks source link

[OpenAI] 服务器拒绝访问,请稍后再试 | Server refused to access, please try again later #131

Closed justincnn closed 1 year ago

justincnn commented 1 year ago

求助:

vps设置warp之后,搭梯子可以访问ai.com没有问题,

但是通过go-chatgpt-api,就提示:[OpenAI] 服务器拒绝访问,请稍后再试 | Server refused to access, please try again later

用的是最新的docker

linweiyuan commented 1 year ago

国内 VPS?

发下配置文件

justincnn commented 1 year ago

国内 VPS?

发下配置文件

具体如下,麻烦看下:

services: go-chatgpt-api: container_name: go-chatgpt-api image: linweiyuan/go-chatgpt-api network_mode: "host" ports:

linweiyuan commented 1 year ago

国内 VPS?这个为什么不答


这个配置不对,network_mode 是从哪里抄的

GO_CHATGPT_API_PROXY 留空也不对

justincnn commented 1 year ago

国内 VPS?这个为什么不答

这个配置不对,network_mode 是从哪里抄的

GO_CHATGPT_API_PROXY 留空也不对

国外的,用的是甲骨文的vps,ip断已经被chatgpt拦掉了,

换行问题是我刚才复制的格式有问题引起的,

格式具体如下,另外关于network_mode该如何修改,谢谢呀

截屏2023-05-17 22.31.42.png

linweiyuan commented 1 year ago

README 文档里也有

services:
  go-chatgpt-api:
    container_name: go-chatgpt-api
    image: linweiyuan/go-chatgpt-api
    ports:
      - 8080:8080
    environment:
      - GO_CHATGPT_API_PROXY=socks5://chatgpt-proxy-server-warp:65535
    depends_on:
      - chatgpt-proxy-server-warp
    restart: unless-stopped

  chatgpt-proxy-server-warp:
    container_name: chatgpt-proxy-server-warp
    image: linweiyuan/chatgpt-proxy-server-warp
    environment:
      - LOG_LEVEL=OFF
    restart: unless-stopped
justincnn commented 1 year ago

我用这个compose配置,也是无法使用,才想到了,用host的网络搭建出口, ps: chatgpt-proxy-server-warp这个是不是不支持arm的服务器?

linweiyuan commented 1 year ago

这个镜像不支持,但是你可以在机器上裸跑 warp 客户端,其他人有那些一键脚本(我没试过,理论上可用)

那就是这个原因了,有依赖所以用不了

arm 机器会便宜一点吗,怎么这么多人用

justincnn commented 1 year ago

这个镜像不支持,但是你可以在机器上裸跑 warp 客户端,其他人有那些一键脚本(我没试过,理论上可用)

那就是这个原因了,有依赖所以用不了

arm 机器会便宜一点吗,怎么这么多人用

我就是裸跑warp,然后再加,上周还行,从本周开始突然就不行了

services:
  go-chatgpt-api:
    container_name: go-chatgpt-api
    image: linweiyuan/go-chatgpt-api
    network_mode: "host"
    ports:
      - 8080:8080
    environment:
      - GIN_MODE=release
      - GO_CHATGPT_API_PROXY=
    restart: unless-stopped

如果直接用你文档的配置,一直在裸跑warp下没法反代openai

services:
  go-chatgpt-api:
    container_name: go-chatgpt-api
    image: linweiyuan/go-chatgpt-api
    ports:
      - 8080:8080
    environment:
      - GIN_MODE=release
      - GO_CHATGPT_API_PROXY=
    restart: unless-stopped
linweiyuan commented 1 year ago

会不会是你的流量超了呢

justincnn commented 1 year ago

应该不会,我用warp代理的梯子,上openai和打开其他网页都是正常的

linweiyuan commented 1 year ago

启动 go-chatgpt-api 会打印什么,直接 Welcome 还是有一段红字

justincnn commented 1 year ago

启动 go-chatgpt-api 会打印什么,直接 Welcome 还是有一段红字

下面是开头的部分内容:

docker logs -f  go-chatgpt-api
INFO[0000] GO_CHATGPT_API_COOKIES_API_URL defaults to: https://api.linweiyuan.com/chatgpt/cookies 
[GIN] 2023/05/16 - 19:46:04 | 403 |    14.42105ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 19:46:05 | 403 |   37.299992ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 19:46:07 | 403 |   13.395843ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 19:47:31 | 403 |   18.552635ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 19:49:38 | 403 |   38.635881ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 19:54:51 | 403 |   33.276247ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 19:54:52 | 403 |    12.89568ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 20:46:41 | 403 |     635.644µs |   78.108.177.52 | GET      "/"
[GIN] 2023/05/16 - 21:13:23 | 403 |       18.96µs |  162.243.143.26 | GET      "/actuator/health"
[GIN] 2023/05/16 - 21:46:22 | 403 |    45.09856ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 21:46:24 | 403 |   16.285461ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 21:55:08 | 403 |   34.735936ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/16 - 23:41:17 | 403 |     592.844µs |  167.94.138.124 | GET      "/"
[GIN] 2023/05/16 - 23:41:17 | 403 |       15.32µs |  167.94.138.124 | GET      "/"
[GIN] 2023/05/16 - 23:41:17 | 403 |        7.72µs |  167.94.138.124 | PRI      "*"
[GIN] 2023/05/16 - 23:41:20 | 403 |       16.52µs |  152.89.196.144 | GET      "/securityRealm/user/admin/search/index?q=a"
[GIN] 2023/05/16 - 23:46:57 | 403 |       17.24µs |  152.89.196.144 | GET      "/"
[GIN] 2023/05/16 - 23:50:20 | 403 |        17.6µs |  152.89.196.144 | POST     "/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php"
[GIN] 2023/05/16 - 23:52:44 | 403 |       17.48µs |  152.89.196.144 | GET      "/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php"
linweiyuan commented 1 year ago

我明白了,需要更新下镜像,图片中的域名已经弃用了,更新完正常

justincnn commented 1 year ago

我明白了,需要更新下镜像,图片中的域名已经弃用了,更新完正常

太感谢了,是我的错,竟然犯了那么低级的错,再次谢谢大神,

马上安装watchtower

docker logs -f  go-chatgpt-api
INFO[0000] Service go-chatgpt-api is ready.  
ERRO[0000] If you still hit 403, do not raise new issue (will be closed directly without comment), change to a new clean IP or use legacy version first. 
[GIN] 2023/05/17 - 23:37:22 | 401 |   106.17586ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/17 - 23:37:24 | 401 |  125.192018ms |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/17 - 23:39:15 | 200 |  2.628846461s |       127.0.0.1 | POST     "/chatgpt/conversation"
[GIN] 2023/05/17 - 23:40:02 | 200 |  2.650889545s |       127.0.0.1 | POST     "/chatgpt/conversation"
tjZhou001 commented 1 year ago

为什么访问openai.com网站跳转到github.com网站上去了

linweiyuan commented 1 year ago

得问 openai