Open my1639963 opened 2 hours ago
[x] I found a bug, not just asking a question, which should be created in GitHub Discussions.
[x] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
[x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
C#
OS: Windows11 23H2.22631.4317 Microsoft Visual Studio Community 2022 (64 位) - Current 版本 17.10.3 .net 6
Server Version 5.3.1 Client 5.1.0
No response
代码片段如下:
//通过configuration 读取appsettingappsetting.json配置 var endpoint = confiuration["rocketmq:endpoint"]; topic = confiuration["rocketmq:topic"]; var clientConfig = new ClientConfig.Builder() .SetEndpoints(endpoint) .EnableSsl(false) .Build(); _producer = new Producer.Builder() .SetTopics(topic) // 默认主题 .SetClientConfig(clientConfig) .Build() .Result;
调用 new Producer.Builder() 时报错
An unhandled exception has occurred while executing the request. System.AggregateException: One or more errors occurred. (Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Request headers must contain only ASCII characters.", DebugException="System.Net.Http.HttpRequestException: Request headers must contain only ASCII characters. at System.Net.Http.HPack.HPackEncoder.EncodeValueStringPart(String value, Span`1 destination) at System.Net.Http.HPack.HPackEncoder.EncodeStringLiteral(String value, Encoding valueEncoding, Span`1 destination, Int32& bytesWritten) at System.Net.Http.HPack.HPackEncoder.EncodeStringLiterals(ReadOnlySpan`1 values, String separator, Encoding valueEncoding, Span`1 destination, Int32& bytesWritten) at System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName(String name, ReadOnlySpan`1 values, String separator, Encoding valueEncoding, Span`1 destination, Int32& bytesWritten) at System.Net.Http.Http2Connection.WriteLiteralHeader(String name, ReadOnlySpan`1 values, Encoding valueEncoding, ArrayBuffer& headerBuffer) at System.Net.Http.Http2Connection.WriteHeaderCollection(HttpRequestMessage request, HttpHeaders headers, ArrayBuffer& headerBuffer) at System.Net.Http.Http2Connection.WriteHeaders(HttpRequestMessage request, ArrayBuffer& headerBuffer) at System.Net.Http.Http2Connection.SendHeadersAsync(HttpRequestMessage request, CancellationToken cancellationToken, Boolean mustFlush) at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpMessageInvoker.<SendAsync>g__SendAsyncWithTelemetry|6_0(HttpMessageHandler handler, HttpRequestMessage request, CancellationToken cancellationToken) at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")) ---> Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Request headers must contain only ASCII characters.", DebugException="System.Net.Http.HttpRequestException: Request headers must contain only ASCII characters. at System.Net.Http.HPack.HPackEncoder.EncodeValueStringPart(String value, Span`1 destination) at System.Net.Http.HPack.HPackEncoder.EncodeStringLiteral(String value, Encoding valueEncoding, Span`1 destination, Int32& bytesWritten) at System.Net.Http.HPack.HPackEncoder.EncodeStringLiterals(ReadOnlySpan`1 values, String separator, Encoding valueEncoding, Span`1 destination, Int32& bytesWritten) at System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName(String name, ReadOnlySpan`1 values, String separator, Encoding valueEncoding, Span`1 destination, Int32& bytesWritten) at System.Net.Http.Http2Connection.WriteLiteralHeader(String name, ReadOnlySpan`1 values, Encoding valueEncoding, ArrayBuffer& headerBuffer) at System.Net.Http.Http2Connection.WriteHeaderCollection(HttpRequestMessage request, HttpHeaders headers, ArrayBuffer& headerBuffer) at System.Net.Http.Http2Connection.WriteHeaders(HttpRequestMessage request, ArrayBuffer& headerBuffer) at System.Net.Http.Http2Connection.SendHeadersAsync(HttpRequestMessage request, CancellationToken cancellationToken, Boolean mustFlush) at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpMessageInvoker.<SendAsync>g__SendAsyncWithTelemetry|6_0(HttpMessageHandler handler, HttpRequestMessage request, CancellationToken cancellationToken) at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)") at Grpc.Net.Client.Internal.GrpcCall`2.GetResponseHeadersCoreAsync() at Org.Apache.Rocketmq.ClientLoggerInterceptor.HandleResponse[TResponse](Task`1 t) at Org.Apache.Rocketmq.RpcClient.QueryRoute(Metadata metadata, QueryRouteRequest request, TimeSpan timeout) at Org.Apache.Rocketmq.ClientManager.QueryRoute(Endpoints endpoints, QueryRouteRequest request, TimeSpan timeout) at Org.Apache.Rocketmq.Client.FetchTopicRoute0(String topic) at Org.Apache.Rocketmq.Client.FetchTopicRoute(String topic) at Org.Apache.Rocketmq.Client.Start() at Org.Apache.Rocketmq.Producer.Start() at Org.Apache.Rocketmq.Producer.Builder.Build() --- End of inner exception stack trace ---
中文环境windows,每次调用必然触发
...
Runtime Data
Before Creating the Bug Report
[x] I found a bug, not just asking a question, which should be created in GitHub Discussions.
[x] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
[x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Programming Language of the Client
C#
Runtime Platform Environment
OS: Windows11 23H2.22631.4317 Microsoft Visual Studio Community 2022 (64 位) - Current 版本 17.10.3 .net 6
RocketMQ Version of the Client/Server
Server Version 5.3.1 Client 5.1.0
Run or Compiler Version
No response
Describe the Bug
代码片段如下:
Steps to Reproduce
中文环境windows,每次调用必然触发
What Did You Expect to See?
...
What Did You See Instead?
...
Additional Context
No response