LagrangeDev / Lagrange.Core

An Implementation of NTQQ Protocol, with Pure C#, Derived from Konata.Core
GNU General Public License v3.0
2.12k stars 262 forks source link

[Bug?]: 无法正常发送群聊文件和私聊文件 #503

Closed pk5ls20 closed 2 months ago

pk5ls20 commented 2 months ago

请确保您已阅读以上注意事项,并勾选下方的确认框。

Lagrange项目

Core & Onebot

所使用/依赖的Lagrange项目对应的commit

https://github.com/LagrangeDev/Lagrange.Core/commit/86bbaf8af3b63886029ce938a23c9386749b1f70

运行环境

Windows

运行架构

x64

连接方式

None

重现步骤

发送不同大小的群聊文件和私聊文件,文件名均为random.zip

期望的结果是什么?

正常发送文件

实际的结果是什么?

在发送私聊文件时:

Highway错误码均为210005

在发送群聊文件时:

简单的复现代码/链接(可选)

参考文件生成代码,使用Nonebot2发送


async def _(bot: Bot, event: Event):
    for size in [0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10, 20]:
        file = BytesIO()
        file.write(b'1' * int(1024 * 1024 * size))
        file.seek(0)
        rd = random.randint(1, 100000)
        with open(pathlib.Path(f"<basepath>/random{rd}.zip"), "wb") as f:
            f.write(file.read())
        await bot.call_api("upload_group_file",
                           user_id=<hidden>,
                           file=f"<basepath>/random{rd}.zip",
                           name=f"random{rd}.zip")
        # await bot.call_api("upload_private_file",
        #                    user_id=<id>,
        #                    file=f"<basepath>.zip",
        #                    name="random.zip")

Trace 级别日志记录(可选)

私聊发送文件 ```bash warn: Lagrange.OneBot.Utility.MusicSigner[0] MusicSignServer is not available, sign may be failed dbug: Microsoft.Extensions.Hosting.Internal.Host[1] Hosting starting info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: dbug: Microsoft.Extensions.Hosting.Internal.Host[2] Hosting started info: Lagrange.OneBot.LagrangeApp[0] Lagrange.OneBot Implementation has started info: Lagrange.OneBot.LagrangeApp[0] Protocol: | 3.2.10-25765 info: Lagrange.OneBot.Utility.OneBotSigner[0] Signature Service is successfully established info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://125.39.196.158:8080/ Latency: 7 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://111.206.149.85:8080/ Latency: 5 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://111.206.149.168:8080/ Latency: 6 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://123.125.0.210:8080/ Latency: 8 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://220.194.118.236:8080/ Latency: 7 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://123.125.0.195:8080/ Latency: 9 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://60.29.242.161:8080/ Latency: 8 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://220.194.118.230:8080/ Latency: 7 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://60.29.238.126:8080/ Latency: 10 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [SocketContext] [VERBOSE]: Server: http://123.125.0.161:8080/ Latency: 7 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [WtExchangeLogic] [INFORMATION]: Session has not expired, using session to login and register status trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [ServiceContext] [DEBUG]: Outgoing SSOFrame: trpc.qq_new_tech.status_svc.StatusService.Register trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [ServiceContext] [DEBUG]: Incoming SSOFrame: trpc.qq_new_tech.status_svc.StatusService.Register info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [WtExchangeLogic] [INFORMATION]: Register Status: register success info: Lagrange.OneBot.LagrangeApp[0] Bot Online: info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:40] [WtExchangeLogic] [INFORMATION]: AutoReLogin Enabled, session would be refreshed in 15 days period info: Lagrange.OneBot.Core.Network.LagrangeWebSvcCollection[1] [LagrangeWebSvcCollection]: Multi Connection has been configured info: Lagrange.OneBot.Core.Network.Service.HttpService[1] HttpService started at http://127.0.0.1:12342/ trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[1] [ReverseWSService] Connect(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): ws://127.0.0.1:8080/onebot/v11/ trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2] [ReverseWSService] Send(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): {"sub_type":"connect","meta_event_type":"lifecycle","time":1723750541,"self_id":,"post_type":"meta_event"} trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2] [ReverseWSService] Send(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): {"interval":5000,"status":{"app_initialized":true,"app_enabled":true,"app_good":true,"online":true,"good":true},"meta_event_type":"heartbeat","time":1723750541,"self_id":,"post_type":"meta_event"} warn: Lagrange.Core.BotContext[0] [2024-08-16 03:35:43] [ServiceContext] [WARNING]: Unsupported SSOFrame Received: ConfigPushSvc.PushReq trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:43] [ServiceContext] [DEBUG]: Unsuccessful SSOFrame Payload: trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2] [ReverseWSService] Send(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): {"interval":5000,"status":{"app_initialized":true,"app_enabled":true,"app_good":true,"online":true,"good":true},"meta_event_type":"heartbeat","time":1723750546,"self_id":,"post_type":"meta_event"} trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Incoming SSOFrame: trpc.msg.olpush.OlPushService.MsgPush trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Outgoing SSOFrame: OidbSvcTrpcTcp.0xfe7_3 trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Incoming SSOFrame: OidbSvcTrpcTcp.0xfe7_3 info: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [MessagingLogic] [VERBOSE]: [MessageChain()()] [Text]: /file 0.75 trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2] [ReverseWSService] Send(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): {"message_type":"group","sub_type":"normal","message_id":,"group_id":,"us er_id":,"anonymous":null,"message":[{"type":"text","data":{"text":"/file 0.75"}}],"raw_message":"/file 0.75","font":0,"sender":{"user_id":,"nickname":"","card":"","sex":"unknown","age":0,"area":"","level":"","role":"owner","title":""},"time":1723750549,"self_id":,"post_type":"message"} trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[3] [ReverseWSService] Receive(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): {"action": "upload_private_file", "params": {"user_id": , "file": "/random21046.zip", "name": "random.zip"}, "echo": "10"} trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Outgoing SSOFrame: OidbSvcTrpcTcp.0xe37_1700 trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Incoming SSOFrame: OidbSvcTrpcTcp.0xe37_1700 trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Outgoing SSOFrame: HttpConn.0x6ff_501 trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Incoming SSOFrame: HttpConn.0x6ff_501 trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Outgoing SSOFrame: HttpConn.0x6ff_501 trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [ServiceContext] [DEBUG]: Incoming SSOFrame: HttpConn.0x6ff_501 trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:49] [HighwayContext] [DEBUG]: Highway Block Result: 210005 | 0 | | trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2] [ReverseWSService] Send(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): {"status":"failed","retcode":1,"data":null,"echo":"10"} trce: Lagrange.Core.BotContext[0] [2024-08-16 03:35:50] [ServiceContext] [DEBUG]: Outgoing SSOFrame: Heartbeat.Alive trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2] [ReverseWSService] Send(2ed5b9b6-5bb7-4e9e-a8cf-84248d75bd54): {"interval":5000,"status":{"app_initialized":true,"app_enabled":true,"app_good":true,"online":true,"good":true},"meta_event_type":"heartbeat","time":1723750551,"self_id":,"post_type":"meta_event"} info: Microsoft.Hosting.Lifetime[0] Application is shutting down... info: Lagrange.OneBot.LagrangeApp[0] Lagrange.OneBot Implementation has stopped dbug: Microsoft.Extensions.Hosting.Internal.Host[3] Hosting stopping dbug: Microsoft.Extensions.Hosting.Internal.Host[4] Hosting stopped 进程已结束,退出代码为 0。 ```

补充说明(可选)

what can i say

wzwei1990 commented 2 months ago

您好 发送视频会过期打不开是什么原因

wzwei1990 commented 2 months ago

这个是修复发送群文件 虽然成功 但没有消息的问题吗

ishkong commented 2 months ago

怪lwx,私聊我早就提过了 #236 他还是没修(

pk5ls20 commented 2 months ago

这个是修复发送群文件 虽然成功 但没有消息的问题吗

一会就修