LagrangeDev / Lagrange.Core

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

[Bug?]: 无法正常启动Lagrange.OneBot_linux-x64_8.0,卡在Signature Service is successfully established #372

Open WhyPilotXia opened 1 month ago

WhyPilotXia commented 1 month ago

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

Lagrange项目

OneBot

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

Lagrange.OneBot_linux-x64_8.0.zip

运行环境

Linux

运行架构

x64

连接方式

反向 WebSocket

重现步骤

打开https://aistudio.baidu.com/projectdetail/7882951启动项目,进入控制台,按照文档准备好相关文件,运行: ./Lagrange.OneBot image

期望的结果是什么?

能正常启动程序

实际的结果是什么?

直接启动,无法扫码登录,提示: [WtExchangeLogic] [INFORMATION]: Connecting Servers... Unhandled exception. System.PlatformNotSupportedException: The system's ping utility could not be found. at System.Net.NetworkInformation.Ping.GetPingProcess(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options) at System.Net.NetworkInformation.Ping.SendWithPingUtilityAsync(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options) at System.Net.NetworkInformation.Ping.SendPingAsyncInternal[TArg](TArg getAddressArg, Func`3 getAddress, Int32 timeout, Byte[] buffer, PingOptions options, CancellationToken cancellationToken) at Lagrange.Core.Utility.Network.Icmp.PingAsync(Uri hostIp, Int32 timeout) at Lagrange.Core.Internal.Context.SocketContext.OptimumServer(Boolean requestMsf, Boolean useIPv6Network) at Lagrange.Core.Internal.Context.SocketContext.Connect() at Lagrange.Core.Internal.Context.Logic.Implementation.WtExchangeLogic.FetchQrCode() at Lagrange.OneBot.LagrangeApp.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Lagrange.OneBot.Program.Main(String[] args) Aborted (core dumped)

看到是由于系统不支持ping 于是本地登好再将

appsettings.json
device.json
keystore.json

拷入,运行后成功打开:

aistudio@jupyter-3211270-7882951:~/publish$ ./Lagrange.OneBot 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: /home/aistudio/publish 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.1.2-13107 info: Lagrange.OneBot.Utility.OneBotSigner[0] Signature Service is successfully established 但是始终卡在这,再也没有进一步的消息了,也没有反应。

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

https://aistudio.baidu.com/projectdetail/7882951

日志记录(可选)

直接启动,无法扫码登录,提示:
[WtExchangeLogic] [INFORMATION]: Connecting Servers...
Unhandled exception. System.PlatformNotSupportedException: The system's ping utility could not be found.
   at System.Net.NetworkInformation.Ping.GetPingProcess(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
   at System.Net.NetworkInformation.Ping.SendWithPingUtilityAsync(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
   at System.Net.NetworkInformation.Ping.SendPingAsyncInternal[TArg](TArg getAddressArg, Func`3 getAddress, Int32 timeout, Byte[] buffer, PingOptions options, CancellationToken cancellationToken)
   at Lagrange.Core.Utility.Network.Icmp.PingAsync(Uri hostIp, Int32 timeout)
   at Lagrange.Core.Internal.Context.SocketContext.OptimumServer(Boolean requestMsf, Boolean useIPv6Network)
   at Lagrange.Core.Internal.Context.SocketContext.Connect()
   at Lagrange.Core.Internal.Context.Logic.Implementation.WtExchangeLogic.FetchQrCode()
   at Lagrange.OneBot.LagrangeApp.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at Lagrange.OneBot.Program.Main(String[] args)
Aborted (core dumped)

看到是由于系统不支持ping
于是本地登好再将

appsettings.json
device.json
keystore.json

拷入,运行后成功打开:

aistudio@jupyter-3211270-7882951:~/publish$ ./Lagrange.OneBot 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: /home/aistudio/publish 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.1.2-13107 info: Lagrange.OneBot.Utility.OneBotSigner[0] Signature Service is successfully established 但是始终卡在这,再也没有进一步的消息了,也没有反应。



### 补充说明(可选)

_No response_
DarkCWK commented 1 month ago

怀疑是无法连接到签名服务器, 请检查 ipv6 (curl -iv https://v6.ident.me/) 和 ipv4 (curl -iv https://v4.ident.me/) 是否畅通

再检查是否可以连接到签名服务器 https://sign.lagrangecore.org/api/sign (curl -iv https://sign.lagrangecore.org/api/sign)

以上操作请在启动 Lagrange.OneBot 的机器运行

DarkCWK commented 1 month ago

不好意思,以上 ipv6 的命令写错了,目前已修改正确

WhyPilotXia commented 1 month ago

怀疑是无法连接到签名服务器, 请检查 ipv6 (curl -iv https://v4.ident.me/) 和 ipv4 (curl -iv https://v4.ident.me/) 是否畅通

再检查是否可以连接到签名服务器 https://sign.lagrangecore.org/api/sign (curl -iv https://sign.lagrangecore.org/api/sign)

以上操作请在启动 Lagrange.OneBot 的机器运行


aistudio@jupyter-3211270-7882951:~/publish$ curl -iv https://v4.ident.me/
*   Trying 49.12.234.183...
* Connected to v4.ident.me (49.12.234.183) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 592 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: any.ident.me (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: CN=any.ident.me
*        start date: Wed, 10 Apr 2024 10:05:59 GMT
*        expire date: Tue, 09 Jul 2024 10:05:58 GMT
*        issuer: C=US,O=Let's Encrypt,CN=R3
*        compression: NULL
* ALPN, server accepted to use http/1.1
GET / HTTP/1.1
Host: v4.ident.me
User-Agent: curl/7.47.0
Accept: */*

< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx
Server: nginx
< Date: Tue, 14 May 2024 14:56:27 GMT
Date: Tue, 14 May 2024 14:56:27 GMT
< Content-Type: text/plain
Content-Type: text/plain
< Content-Length: 14
Content-Length: 14
< Connection: keep-alive
Connection: keep-alive
< Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
< Cache-Control: no-cache, no-store, must-revalidate
Cache-Control: no-cache, no-store, must-revalidate

<

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

按照提示使用-k:
```shell
aistudio@jupyter-3211270-7882951:~/publish$ curl -iv https://sign.lagrangecore.org/api/sign -k
*   Trying 104.21.51.166...
* Connected to sign.lagrangecore.org (104.21.51.166) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 592 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_ECDSA_AES_128_GCM_SHA256
*        server certificate verification SKIPPED
*        server certificate status verification SKIPPED
*        common name: lagrangecore.org (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: EC
*        certificate version: #3
*        subject: CN=lagrangecore.org
*        start date: Wed, 17 Apr 2024 01:16:02 GMT
*        expire date: Tue, 16 Jul 2024 01:16:01 GMT
*        issuer: C=US,O=Let's Encrypt,CN=E1
*        compression: NULL
* ALPN, server accepted to use http/1.1
> GET /api/sign HTTP/1.1
> Host: sign.lagrangecore.org
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Tue, 14 May 2024 15:03:13 GMT
Date: Tue, 14 May 2024 15:03:13 GMT
< Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
< Content-Length: 16
Content-Length: 16
< Connection: keep-alive
Connection: keep-alive
< X-Powered-By: Express
X-Powered-By: Express
< ETag: W/"10-vM7Kx9W6jKYQ/cdL91swVB8MxjU"
ETag: W/"10-vM7Kx9W6jKYQ/cdL91swVB8MxjU"
< CF-Cache-Status: DYNAMIC
CF-Cache-Status: DYNAMIC
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=sltBhxrVjDmqF9lfz9UyUFjX16n6u9EyWgTGlzN3006vgDEz7BeD34IFHlxCFug%2BQsQoirT5Uv3Ci5v9jV6mAUa0gXg2vx7OGIaZP3gT%2FNaqCcsdsd%2Be9NLLuoTc%2Bq3yZlSKrSMWTzI%3D"}],"group":"cf-nel","max_age":604800}
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=sltBhxrVjDmqF9lfz9UyUFjX16n6u9EyWgTGlzN3006vgDEz7BeD34IFHlxCFug%2BQsQoirT5Uv3Ci5v9jV6mAUa0gXg2vx7OGIaZP3gT%2FNaqCcsdsd%2Be9NLLuoTc%2Bq3yZlSKrSMWTzI%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< Server: cloudflare
Server: cloudflare
< CF-RAY: 883bc6139edd6430-LHR
CF-RAY: 883bc6139edd6430-LHR
< alt-svc: h3=":443"; ma=86400
alt-svc: h3=":443"; ma=86400

< 
* Connection #0 to host sign.lagrangecore.org left intact
DarkCWK commented 1 month ago

打开https://aistudio.baidu.com/projectdetail/7882951启动项目,进入控制台,按照文档准备好相关文件,运行:

注意, 你的 keystore.json 被你公布在网上, 其中 keystore.json 包含了账号的认证信息, 其他使用 Lagrange 的人可以通过伪装登陆你的账号!

请及时从 qq 中设置的安全中心删除相关的登陆设备

WhyPilotXia commented 1 month ago

打开https://aistudio.baidu.com/projectdetail/7882951启动项目,进入控制台,按照文档准备好相关文件,运行:

注意, 你的 keystore.json 被你公布在网上, 其中 keystore.json 包含了账号的认证信息, 其他使用 Lagrange 的人可以通过伪装登陆你的账号!

收到,谢谢,已经删除了该设备

WhyPilotXia commented 1 month ago

新信息:发现在删除设备后的现象和之前完全一样,都是到这就不动了,也没有报错,也就是说可能并没有到登录,未使用keystore.json:

aistudio@jupyter-3211270-7882951:~$ cd ./publish/
aistudio@jupyter-3211270-7882951:~/publish$ ls
appsettings.json  device.json  keystore.json  lagrange-0.db  Lagrange.OneBot
aistudio@jupyter-3211270-7882951:~/publish$ ./Lagrange.OneBot
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: /home/aistudio/publish
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.1.2-13107
info: Lagrange.OneBot.Utility.OneBotSigner[0]
      Signature Service is successfully established
DarkCWK commented 3 weeks ago

你给系统安装一个 ping 工具试试

WhyPilotXia commented 3 weeks ago

不给安装...这个系统有限制

---Original--- From: @.> Sent at: 2024年6月14日(Fri) Evening6:27 To: @.>; Cc: @.**@.>; Subject: Re: [LagrangeDev/Lagrange.Core] [Bug?]: 无法正常启动Lagrange.OneBot_linux-x64_8.0,卡在Signature Service is successfully established (Issue #372)

你给系统安装一个 ping 工具试试

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>