formzs / poe-to-gpt

把poe转换成openai格式的API
GNU General Public License v3.0
54 stars 15 forks source link

日志出现大量401错误,无法正常使用 #7

Closed Nigel-NI closed 3 months ago

Nigel-NI commented 3 months ago

按照教程配置config.toml后使用docker compose部署。在chatbox填写相关参数并正常对话,软件提示Network Error: Failed to fetch。

检查docker日志,内容如下(敏感内容已处理):

[GIN-debug] Listening and serving HTTP on :6660
[GIN] 2024/08/07 - 04:32:32 | 200 |      69.369µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 04:32:32 | 401 |      58.629µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 04:32:33 | 200 |      28.974µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 04:32:34 | 401 |      51.556µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 04:32:35 | 200 |      49.833µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 04:32:36 | 401 |       43.64µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 04:32:36 | 200 |      42.028µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 04:32:37 | 401 |      45.635µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 04:33:12 | 200 |       42.62µs |   114.5.1.4 | OPTIONS  "/chat/completions"
[GIN] 2024/08/07 - 04:33:12 | 401 |      55.263µs |   114.5.1.4 | POST     "/chat/completions"
[GIN] 2024/08/07 - 04:33:14 | 200 |      28.102µs |   114.5.1.4 | OPTIONS  "/chat/completions"
[GIN] 2024/08/07 - 04:33:14 | 401 |      41.698µs |   114.5.1.4 | POST     "/chat/completions"
[GIN] 2024/08/07 - 04:33:16 | 200 |      30.066µs |   114.5.1.4 | OPTIONS  "/chat/completions"
[GIN] 2024/08/07 - 04:33:16 | 401 |      43.902µs |   114.5.1.4 | POST     "/chat/completions"
[GIN] 2024/08/07 - 04:33:18 | 200 |      45.574µs |   114.5.1.4 | OPTIONS  "/chat/completions"
[GIN] 2024/08/07 - 04:33:18 | 401 |      68.597µs |   114.5.1.4 | POST     "/chat/completions"

相同的config.toml文件部署的docker在之前并未遇到此问题。已经尝试在两台地区不同的vps上部署该项目,均无法使用。

formzs commented 3 months ago

请问“accessTokens”在 chatbox 中的填写是否正确?

Nigel-NI commented 3 months ago

请问“accessTokens”在 chatbox 中的填写是否正确?

确实填写有误。不过修改过来后chatbox还是提示Failed to fetch,后台可以看到生成的内容,但是有500错误。

日志如下:

You only need to answer with the name.
The following is the conversation:

ping
---------

Please provide a concise name, within 10 characters and without quotation marks.
Please use the speak language in the conversation.
You only need to answer with the name.
The conversation is named:
INFO: Stream using bot GPT-4o
INFO: Rev:
INFO: Rev:  Ping
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:13 | 200 |  515.784017ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:13 | 200 |      42.238µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:14 | 500 |      73.036µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:15 | 200 |      40.886µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
INFO: stream using client: ***
DEBUG: Generated content to send: Name the conversation based on the chat records.
Please provide a concise name, within 10 characters and without quotation marks.
Please use the speak language in the conversation.
You only need to answer with the name.
The following is the conversation:

ping
---------

Please provide a concise name, within 10 characters and without quotation marks.
Please use the speak language in the conversation.
You only need to answer with the name.
The conversation is named:
INFO: Stream using bot GPT-4o
INFO: Rev:
INFO: Rev:  Ping
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:16 | 200 |  516.872405ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:16 | 200 |       32.78µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:17 | 500 |      83.404µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:22 | 200 |      41.357µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:22 | 200 |      25.889µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
INFO: stream using client: ***
DEBUG: Generated content to send:
Current model: gpt-4o
Current date: 2024-08-07T07:12:21.653Z
You are a helpful assistant. You can help me by answering my questions. You can also ask me questions.ping
[GIN] 2024/08/07 - 07:12:22 | 500 |      48.549µs |   114.5.1.4 | POST     "/v1/chat/completions"
INFO: Stream using bot GPT-4o
INFO: Rev:
INFO: Rev:  P
INFO: Rev:  ong
INFO: Rev:  !
INFO: Rev:   How
INFO: Rev:   can
INFO: Rev:   I
INFO: Rev:   assist
INFO: Rev:   you
INFO: Rev:   today
INFO: Rev:  ?
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:23 | 200 |  677.392512ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:23 | 200 |      46.166µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:23 | 200 |       20.82µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:24 | 500 |      74.108µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:24 | 500 |      68.468µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:25 | 200 |      40.186µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:25 | 200 |      22.643µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
INFO: stream using client: ***
DEBUG: Generated content to send:
Current model: gpt-4o
Current date: 2024-08-07T07:12:21.653Z
You are a helpful assistant. You can help me by answering my questions. You can also ask me questions.ping
INFO: Stream using bot GPT-4o
[GIN] 2024/08/07 - 07:12:25 | 500 |      55.293µs |   114.5.1.4 | POST     "/v1/chat/completions"
INFO: Rev:
INFO: Rev:  pong
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:26 | 200 |  505.902109ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:26 | 200 |      44.622µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:26 | 200 |      23.915µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:27 | 500 |        75.5µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:27 | 500 |      46.687µs |   114.5.1.4 | POST     "/v1/chat/completions"
formzs commented 3 months ago

请问“accessTokens”在 chatbox 中的填写是否正确?

确实填写有误。不过修改过来后chatbox还是提示Failed to fetch,后台可以看到生成的内容,但是有500错误。

日志如下:

You only need to answer with the name.
The following is the conversation:

ping
---------

Please provide a concise name, within 10 characters and without quotation marks.
Please use the speak language in the conversation.
You only need to answer with the name.
The conversation is named:
INFO: Stream using bot GPT-4o
INFO: Rev:
INFO: Rev:  Ping
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:13 | 200 |  515.784017ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:13 | 200 |      42.238µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:14 | 500 |      73.036µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:15 | 200 |      40.886µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
INFO: stream using client: ***
DEBUG: Generated content to send: Name the conversation based on the chat records.
Please provide a concise name, within 10 characters and without quotation marks.
Please use the speak language in the conversation.
You only need to answer with the name.
The following is the conversation:

ping
---------

Please provide a concise name, within 10 characters and without quotation marks.
Please use the speak language in the conversation.
You only need to answer with the name.
The conversation is named:
INFO: Stream using bot GPT-4o
INFO: Rev:
INFO: Rev:  Ping
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:16 | 200 |  516.872405ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:16 | 200 |       32.78µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:17 | 500 |      83.404µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:22 | 200 |      41.357µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:22 | 200 |      25.889µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
INFO: stream using client: ***
DEBUG: Generated content to send:
Current model: gpt-4o
Current date: 2024-08-07T07:12:21.653Z
You are a helpful assistant. You can help me by answering my questions. You can also ask me questions.ping
[GIN] 2024/08/07 - 07:12:22 | 500 |      48.549µs |   114.5.1.4 | POST     "/v1/chat/completions"
INFO: Stream using bot GPT-4o
INFO: Rev:
INFO: Rev:  P
INFO: Rev:  ong
INFO: Rev:  !
INFO: Rev:   How
INFO: Rev:   can
INFO: Rev:   I
INFO: Rev:   assist
INFO: Rev:   you
INFO: Rev:   today
INFO: Rev:  ?
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:23 | 200 |  677.392512ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:23 | 200 |      46.166µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:23 | 200 |       20.82µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:24 | 500 |      74.108µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:24 | 500 |      68.468µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:25 | 200 |      40.186µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:25 | 200 |      22.643µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
INFO: stream using client: ***
DEBUG: Generated content to send:
Current model: gpt-4o
Current date: 2024-08-07T07:12:21.653Z
You are a helpful assistant. You can help me by answering my questions. You can also ask me questions.ping
INFO: Stream using bot GPT-4o
[GIN] 2024/08/07 - 07:12:25 | 500 |      55.293µs |   114.5.1.4 | POST     "/v1/chat/completions"
INFO: Rev:
INFO: Rev:  pong
INFO: Rev:
INFO: Rev:
[GIN] 2024/08/07 - 07:12:26 | 200 |  505.902109ms |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:26 | 200 |      44.622µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:26 | 200 |      23.915µs |   114.5.1.4 | OPTIONS  "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:27 | 500 |        75.5µs |   114.5.1.4 | POST     "/v1/chat/completions"
[GIN] 2024/08/07 - 07:12:27 | 500 |      46.687µs |   114.5.1.4 | POST     "/v1/chat/completions"

漏key了,在poe上更新一下key吧。

Nigel-NI commented 3 months ago

漏key了,在poe上更新一下key吧。

已重置,感谢提醒

formzs commented 3 months ago

漏key了,在poe上更新一下key吧。

已重置,感谢提醒

我无法复现你这个问题哈

Nigel-NI commented 3 months ago

我无法复现你这个问题哈

复现方法:相同的网络环境(PC和移动端使用相同的IP),PC端在Chatbox正常配置api域名与密钥,测试正常(后台无500错误)。在“设置-其它-数据备份与恢复”中导出Settings与API key&Lisences到移动端(如Android、iOS等设备),确保移动端的设置使用与PC端相同的api链接与key,此时移动端会报错Failed to fetch,后台出现500错误。

formzs commented 3 months ago

我无法复现你这个问题哈

复现方法:相同的网络环境(PC和移动端使用相同的IP),PC端在Chatbox正常配置api域名与密钥,测试正常(后台无500错误)。在“设置-其它-数据备份与恢复”中导出Settings与API key&Lisences到移动端(如Android、iOS等设备),确保移动端的设置使用与PC端相同的api链接与key,此时移动端会报错Failed to fetch,后台出现500错误。

ChatBox 如今竟已具备移动端,本人方才进行了下载并试用,似乎并无任何问题。

Nigel-NI commented 3 months ago

401问题已解决,感谢指点