trueai-org / midjourney-proxy

A public welfare project offering a free drawing API that proxies Midjourney's Discord channel, supporting one-click face swapping for images and videos.
https://ai.trueai.org
GNU General Public License v3.0
373 stars 49 forks source link

Http 请求执行失败 #16

Closed HaQiuqiu closed 3 months ago

HaQiuqiu commented 3 months ago

配置好账号token等信息 启用账号时报错, 在mj页面已经看到机器人在线,但是账号处于未启用状态 报错日志:

[09:31:41 WRN] Http 请求执行失败 { "type": 2, "guild_id": "1099570851986284624", "channel_id": "1099570851986284627", "session_id": "857e0cbb94bf24fa4c28340019967fd1" "analytics_location": "slash_ui" "description": "View information about your profile.", }, BadRequest, {"Headers": [{"Key": "Content-Type", "Value": ["application/json"], "$type": "KeyValuePair2"}, {"Key": "Content-Length", "Value": ["54"], "$type": "KeyValuePair2"}], "$type": "HttpConnectionResponseContent"} [09:31:41 ERR] Account(1099570851986284627) init fail, disabled: { "type": 2, "guild_id": "1099570851986284624", "channel_id": "1099570851986284627", "sessio [09:31:41 INF] 当前可用账号数 [0] -

[09:33:32 WRN] 逻辑错误 { "type": 2, "guild_id": "1099570851986284624", "channel_id": "1099570851986284627", "sessio

trueai-org commented 3 months ago

怀疑 user token 错误,再次查看验证下,token 是否正确。 让后通过 gui 重连。 image

HaQiuqiu commented 3 months ago

已再次检查TOKEN, 并且用GUI编辑且重连, 错误信息一致 但是在GUI进行绘图测试可以正常生成图片, 但是状态为未启用...

截屏2024-07-29 上午10 26 52 截屏2024-07-29 上午10 29 38 截屏2024-07-29 上午10 28 57
trueai-org commented 3 months ago

这里打不开吗?重连后等10秒再刷新看看,首次连接或同步 info 等信息。

image

HaQiuqiu commented 3 months ago

是的 点启用之后log会疯狂报错 直到程序崩溃 我使用的时mac intel本地版本 启动时有一个xtarr报错 跟这个有影响吗? 我已经在discord上退出重新登录 重新更换了一次token

截屏2024-07-29 上午10 43 29 截屏2024-07-29 上午10 44 58
trueai-org commented 3 months ago

再检查下 bot token 是否正确, 以及 bot 是否已添加到频道中。 正常遇到 4004 应该最多会重试5次,如果重试到崩溃,可能是有 其他 BUG

HaQiuqiu commented 3 months ago

token bottoken已经更换

hqq@bogon ~ % cd /Users/hqq/AI/mj280
hqq@bogon mj280 % sh run_app_osx.sh
xattr: /Users/hqq/AI/mj280/Midjourney.API: No such xattr: com.apple.quarantine [11:03:10 INF] Current: /Users/hqq/AI/mj280 [11:03:11 INF] 获取到锁, 重连: False, 1099570851986284627 [11:03:11 INF] WebSocket 资源已释放, 1099570851986284627 [11:03:13 INF] 用户已发送 IDENTIFY 消息 1099570851986284627 [11:03:13 INF] Received Hello 1099570851986284627 [11:03:13 INF] 用户 WebSocket 连接已建立 1099570851986284627 [11:03:13 INF] Heartbeat Started 1099570851986284627 [11:03:13 INF] 用户已发送 HEARTBEAT 消息 1099570851986284627 [11:03:13 INF] 2024/7/29 上午11:03:13 [ Info] Discord: Discord.Net v3.15.2 (API v10) [11:03:13 INF] 2024/7/29 上午11:03:13 [ Info] Gateway: Connecting [11:03:13 INF] Received HeartbeatAck 1099570851986284627 [11:03:13 WRN] 用户 WebSocket 连接已关闭 1099570851986284627 [11:03:13 ERR] 用户 WebSocket 连接失败, 代码 4004: Authentication failed., 1099570851986284627 [11:03:13 WRN] 用户无法重新连接, 由 4004(Authentication failed.) 关闭 1099570851986284627, 尝试新连接... [11:03:13 INF] 获取到锁, 重连: False, 1099570851986284627 [11:03:13 INF] 强制取消消息 token, 1099570851986284627 [11:03:13 INF] 强制释放消息 task, 1099570851986284627 [11:03:13 INF] Heartbeat Canceled 1099570851986284627 [11:03:14 INF] 强制释放心跳 task, 1099570851986284627 [11:03:14 INF] WebSocket 资源已释放, 1099570851986284627 [11:03:15 INF] 2024/7/29 上午11:03:15 [ Warning] Gateway: Discord.Net.HttpException: The server responded with error 401: 401: Unauthorized at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request) at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request) at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request) at Discord.API.DiscordRestApiClient.SendAsync[TResponse](String method, String endpoint, BucketId bucketId, ClientBucketType clientBucket, RequestOptions options) at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectAsync() at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync() at Discord.ConnectionManager.ConnectAsync(CancellationTokenSource reconnectCancelToken) at Discord.ConnectionManager.<>cDisplayClass29_0.<b0>d.MoveNext() [11:03:15 INF] 2024/7/29 上午11:03:15 [ Info] Gateway: Disconnecting [11:03:15 INF] 2024/7/29 上午11:03:15 [ Info] Gateway: Disconnected [11:03:16 INF] 用户已发送 IDENTIFY 消息 1099570851986284627 [11:03:16 INF] Received Hello 1099570851986284627 [11:03:16 INF] Heartbeat Started 1099570851986284627 [11:03:16 INF] 用户 WebSocket 连接已建立 1099570851986284627 [11:03:16 INF] 用户已发送 HEARTBEAT 消息 1099570851986284627 [11:03:16 INF] 2024/7/29 上午11:03:16 [ Info] Gateway: Connecting [11:03:16 INF] Received HeartbeatAck 1099570851986284627 [11:03:16 WRN] 用户 WebSocket 连接已关闭 1099570851986284627 [11:03:16 ERR] 用户 WebSocket 连接失败, 代码 4004: Authentication failed., 1099570851986284627 [11:03:16 WRN] 用户无法重新连接, 由 4004(Authentication failed.) 关闭 1099570851986284627, 尝试新连接... [11:03:16 INF] 获取到锁, 重连: False, 1099570851986284627 [11:03:16 INF] 强制取消消息 token, 1099570851986284627 [11:03:16 INF] 强制释放消息 task, 1099570851986284627 [11:03:16 INF] Heartbeat Canceled 1099570851986284627 [11:03:17 INF] 2024/7/29 上午11:03:17 [ Warning] Gateway: Discord.Net.HttpException: The server responded with error 401: 401: Unauthorized at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request) at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request) at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request) at Discord.API.DiscordRestApiClient.SendAsync[TResponse](String method, String endpoint, BucketId bucketId, ClientBucketType clientBucket, RequestOptions options) at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectAsync() at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync() at Discord.ConnectionManager.ConnectAsync(CancellationTokenSource reconnectCancelToken) at Discord.ConnectionManager.<>cDisplayClass29_0.<b0>d.MoveNext() [11:03:17 INF] 2024/7/29 上午11:03:17 [ Info] Gateway: Disconnecting [11:03:17 INF] 2024/7/29 上午11:03:17 [ Info] Gateway: Disconnected [11:03:17 INF] 强制释放心跳 task, 1099570851986284627 [11:03:17 INF] WebSocket 资源已释放, 1099570851986284627

HaQiuqiu commented 3 months ago

我在配置文件中配置了代理 127.0.0.1:7890 和这个有关系吗?

截屏2024-07-29 上午11 08 35
HaQiuqiu commented 3 months ago

报告up 找到问题了, 在配置代理时 指定https ❎ 需指定 socks5 代理 ✅ "Proxy": { "Host": "socks5://127.0.0.1", "Port": "7890" },