wechaty / dotnet-wechaty

.NET Wechaty is a Conversational SDK for Chatbot Makers Written in C#
Apache License 2.0
80 stars 29 forks source link

Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. IOException: Cannot determine the frame size or a corrupted frame was received #36

Closed softpeng closed 2 years ago

softpeng commented 2 years ago

.net wechaty 启动不了,详细错误如下。

fail: Wechaty.Module.Puppet.WechatyPuppet[0] StartGrpcClient() exception,Grpc Retry Surplus Count 3 Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. IOException: Cannot determine the frame size or a corrupted frame was received.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.IO.IOException: Cannot determine the frame size or a corrupted frame was received. at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter) at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm) at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Grpc.Net.Client.Internal.GrpcCall2.RunCall(HttpRequestMessage request, Nullable1 timeout)") at Wechaty.Module.PuppetService.GrpcPuppet.StartGrpc()

根据社区的相同问题经验,我用过不同的镜像都实验过,还是报以上错误:

wechaty/wechaty:0.68 wechaty/wechaty:0.65 wechaty/wechaty:latest

以下是我的镜像文件

export WECHATY_PUPPET="wechaty-puppet-service" export WECHATY_TOKEN="$1" export WECHATY_PUPPET_SERVER_PORT="$2" export WECHATY_LOG="verbose" export WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER=true export WECHATY_PUPPET_SERVICE_TOKEN="$3"

docker run -ti \ --name wechatygateway$1_$2 \ --rm \ --privileged \ --network=host \ -e WECHATY_LOG \ -e WECHATY_PUPPET \ -e WECHATY_PUPPET_SERVER_PORT \ -e WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER \ -e WECHATY_TOKEN \ -e WECHATY_PUPPET_SERVICE_TOKEN \ -p $WECHATY_PUPPET_SERVER_PORT:$WECHATY_PUPPET_SERVER_PORT \ wechaty/wechaty:0.68

Jesn commented 2 years ago

@softpeng wechaty Nuget 版本更新到 0.23版本,.net wechaty grpc 已做相应升级