间歇性地获取“未知基本64”以char编码:"使用GRPC-WEB客户端的消息
我们有一个C#GRPC.ASPNETCORE版本2.27.0服务,该服务将图像数据发送到GRPC-WEB客户端,使用GRPC-WEB版本1.3.1和Google Protobuf版本3.14.0发送到在chrome浏览器中运行的AngularJS应用程序,该应用页面上的图像是从GRPC服务发送的。
有时会出现一个未知的错误,它显示在Chrome控制台中,其中包含以下消息:“未知错误:未知基础64在char:”,然后是另一个错误,该错误读:“错误:流:流被损坏 @#### /####。错误:无效的框架字节。输入:”。当发生此未知基本64错误时,GRPC服务发送的所有后续图像将不再显示在GRPC-WEB浏览器客户端中。
从GRPC服务发送到chrome Console中显示的内容时,对基本64编码数据的进一步分析表明,base64数据是正确的一段时间,但然后开始差异,直到遇到未知的base64编码字符。以下是屏幕截图的链接,它是GRPC-WEB客户端在左侧收到的Base64编码数据的比较以及GRPC服务在右侧发送的内容。灰色突出显示的区域是GRPC-WEB客户端收到的数据开始与GRPC服务发送的数据不同,最终在左侧的数据中显示了未知的base64字符: link to base64数据比较的屏幕快照
似乎有些东西正在损坏基本64的数据,该数据已损坏了基本64的数据GRPC-WEB客户端正在收到,但我们无法确定这种腐败可能来自哪里。
通常在错误开始发生之前需要几个映像文件传输序列,总计约为数百个MB的图像数据(一次〜1MB),我们正在关闭并重新打开每个序列之间的客户端/服务器连接。
我们还测试了同一服务器,其中一个C#客户端站在GRPC-WEB客户端中,但没有观察到相同的错误。 我们希望有人可以提供一些信息或指导,以帮助确定可能发生的事情。
作为参考,这是我们在GRPC服务中使用的.proto文件:
syntax = "proto3";
package imagestream;
service ImageStream {
rpc GetImages(ImageRequest) returns (stream Image) {}
}
message Image {
bytes rawBytes = 1;
}
message ImageRequest {
string ViewId = 1;
}
谢谢。
We have a C# Grpc.AspNetCore version 2.27.0 service that sends image data to a grpc-web client using grpc-web version 1.3.1 and google-protobuf version 3.14.0, to an AngularJS application running in a Chrome browser that displays images on the page as they are sent from the gRPC service.
Occasionally there is an uncaught error that shows up in the Chrome console that has the following message: “Uncaught Error: Unknown base64 encoding at char:”, followed by another error that reads: “Error: The stream is broken @####/####. Error: invalid frame byte. With input:”. When this unknown base64 error occurs, all subsequent images sent from the gRPC service will no longer be displayed in the grpc-web browser client.
Further analysis of the base64 encoded data from what the gRPC service is sending to what is displayed in the Chrome console when the issue occurs indicates that the base64 data is correct for a while, but then starts to diverge until the unknown base64 encoded character is encountered. Below is a link to a screenshot that is a comparison of the base64 encoded data that is received by the grpc-web client on the left and what the gRPC service had sent on the right. The area highlighted in grey is where the data received by the grpc-web client starts to diverge from the data that the gRPC service had sent and eventually the unknown base64 character shows up in the data on the left:
Link to screenshot of base64 data comparison
It would seem that something is corrupting the base64 encoded data that the grpc-web client is receiving but we haven’t been able to determine where this corruption may be coming from.
It usually takes several sequences of image file transmissions before the error starts happening, with the total being around several hundreds of MB of image data (~1mb at a time), and we’re closing and reopening the client/server connection between each sequence.
We’ve also tested the same server with a C# client standing in for the grpc-web client and have not observed the same errors.
We were hoping that someone could provide some information or guidance that could help to identify what might be going on.
For reference, here is the .proto file we are using in the gRPC service:
syntax = "proto3";
package imagestream;
service ImageStream {
rpc GetImages(ImageRequest) returns (stream Image) {}
}
message Image {
bytes rawBytes = 1;
}
message ImageRequest {
string ViewId = 1;
}
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论