ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
76.45k stars 59.12k forks source link

[Bug] 服务器在新加坡,但7月版本提问返回unsupported_country_region_territory #5101

Open xumin323 opened 3 months ago

xumin323 commented 3 months ago

📦 部署方式

Docker

📌 软件版本

2.13.1

💻 系统环境

Other Linux

📌 系统版本

Debian GNU/Linux 11 (bullseye)

🌐 浏览器

Chrome

📌 浏览器版本

126.0.6478.127

🐛 问题描述

我的服务器在新加坡,5月份的版本是正常的,但我更新到7月份的版本后,提问就返回 { "error": { "code": "unsupported_country_region_territory", "message": "Country, region, or territory not supported", "param": null, "type": "request_forbidden" } } 新加坡应该没被禁呀,请问下是什么原因?

📷 复现步骤

No response

🚦 期望结果

No response

📝 补充信息

No response

Kosette commented 3 months ago

在服务器上使用 curl 请求OpenAI的api看看ip是否有问题。如果ip没有问题,拉取最新的v2.14.0镜像看看。

curl https://api.openai.com/v1/chat/completions \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer $OPENAI_API_KEY" \
     -d '{"model": "gpt-4o-mini","messages": [{"role": "system","content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair."},{"role": "user","content": "Compose a poem that explains the concept of recursion in programming."}]}'
AndyX-Net commented 3 months ago

相同问题, 新加坡VM,使用AOI节点也受到影响: image

已在该VM使用curl命令测试AzureOpenAI节点: curl -X POST "https://XXXXX.openai.azure.com/openai/deployments/XXXXXXXX/chat/completions?api-version=2024-02-15-preview" -H "Content-Type: application/json" -H "api-key: ==YOUR_API_KEY===" -d "{\"messages\":[{\"role\":\"system\",\"content\":\"You are an AI assistant that helps people find information.\"}],\"max_tokens\":800,\"temperature\":0.7,\"frequency_penalty\":0,\"presence_penalty\":0,\"top_p\":0.95,\"stop\":null}" 本身没有问题,问题应该出现在ChatGPTNextWeb方面。 image

尝试降级到 chatgpt-next-web:v2.12.4 问题解决: https://hub.docker.com/r/yidadaa/chatgpt-next-web/tags image

ghjkllasdf-fake commented 3 months ago

相同问题, 新加坡VM,使用AOI节点也受到影响: image

已在该VM使用curl命令测试AzureOpenAI节点: curl -X POST "https://XXXXX.openai.azure.com/openai/deployments/XXXXXXXX/chat/completions?api-version=2024-02-15-preview" -H "Content-Type: application/json" -H "api-key: ==YOUR_API_KEY===" -d "{"messages":[{"role":"system","content":"You are an AI assistant that helps people find information."}],"max_tokens":800,"temperature":0.7,"frequency_penalty":0,"presence_penalty":0,"top_p":0.95,"stop":null}" 本身没有问题,问题应该出现在ChatGPTNextWeb方面。 image

尝试降级到 chatgpt-next-web:v2.12.4 问题解决: https://hub.docker.com/r/yidadaa/chatgpt-next-web/tags image

I got the same issue as well with my server deployed in SG region. Thanks @AndyX-Net for your share! The issue got resolved by downgrade the version to 2.12.4.

xumin323 commented 3 months ago

应该是机器ip的问题,我换了个韩国服务器就可以了,谢谢各位专家了

Issues-translate-bot commented 3 months ago

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


It should be a problem with the machine IP. I just changed it to a Korean server. Thank you experts.

ghjkllasdf-fake commented 3 months ago

应该是机器ip的问题,我换了个韩国服务器就可以了,谢谢各位专家了

It is not server IP issue. If you read the reply from @AndyX-Net , the issue got fixed without changing the server IP but just downgrade the version to 2.12.4. Thanks.

davidwu111 commented 2 months ago

Got same problem and fall back to v2.12.4 works fine. Checking the logs found that newer version using the wrong base url while Azure URL already configured. See below logs with exactly same config.

Logs from v2.12.4:

chatgpt-web  | [Base Url] https://MYENDPOINT.azure.com/openai/deployments/gpt-4o
chatgpt-web  | [Org ID] is not set up.
chatgpt-web  | [OpenAI Route] params  { path: [ 'v1', 'chat', 'completions' ] }

Logs from newer version:

chatgpt-web  | [Time]  9/6/2024, 3:51:15 PM
chatgpt-web  | [Server Config] using 1 of 1 api key - MYAPIKEY
chatgpt-web  | [Auth] admin did not provide an api key
chatgpt-web  | [Proxy]  v1/chat/completions?provider=openai&path=v1&path=chat&path=completions
chatgpt-web  | [Base Url] https://api.openai.com
chatgpt-web  | fetchUrl https://api.openai.com/v1/chat/completions?provider=openai&path=v1&path=chat&path=completions
chatgpt-web  | [Org ID] is not set up.
chatgpt-web  | [openai Route] params  { provider: 'openai', path: [ 'v1', 'chat', 'completions' ] }