Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc-replay: failed to decode dump: invalid character 'ÿ' looking for beginning of value #123

Open
MikaelFerland opened this issue Nov 26, 2020 · 4 comments

Comments

@MikaelFerland
Copy link

I have been able to dump successfully my requests, but when came the time to replay it I got that error:
failed to decode dump: invalid character 'ÿ' looking for beginning of value

I'm running on Windows 10.

@bradleyjkemp
Copy link
Owner

Sounds like the JSON got corrupted somehow. Are you able to share a file that fails with this error?

If not, how are you saving the file to be replayed? Perhaps we can work out if some extra unexpected data is ending up in there

@MikaelFerland
Copy link
Author

I did that grpc-dump --port=8082 > start_core1.dump
I let the client doing is request and when it's done I ended the dump with Ctrl+c
All requests are starting with { and ending with }

I tried to replay only two lines of it and it blocked at the first request:
{"service":"gRPCService.Service_gRPC","method":"ExecuteCommand","messages":[{"message_origin":"client","raw_message":"ClB7IlNlcnZlclB1Ymxpc2hpbmdQb3J0Ijo1NjEwMCwiQnJvYWRjYXN0VHlwZSI6MSwiQ29tbWFuZFR5cGUiOiJSZWdpc3RlckNvbW1hbmQifQ==","message":{"1":"{"ServerPublishingPort":56100,"BroadcastType":1,"CommandType":"RegisterCommand"}"},"timestamp":"2020-11-26T11:30:33.298248-05:00"},{"message_origin":"server","raw_message":"CAEaBWVtcHR5IjIKKHR5cGUuZ29vZ2xlYXBpcy5jb20vZ1JQQ1NlcnZpY2UuVmFyaWFibGUSBgoEbnVsbA==","message":{"1":"1","3":"empty","4":{"1":"type.googleapis.com/gRPCService.Variable","2":{"1":"null"}}},"timestamp":"2020-11-26T11:30:35.7582456-05:00"}],"metadata":{":authority":["192.168.0.10:1234"],"accept-encoding":["identity,gzip"],"content-type":["application/grpc"],"grpc-accept-encoding":["identity,deflate,gzip"],"user-agent":["grpc-csharp/2.33.1 grpc-c/13.0.0 (windows; chttp2)"],"via":["HTTP/2.0 127.0.0.1:1234"]},"metadata_response_headers":{"content-type":["application/grpc"],"date":["Thu, 26 Nov 2020 16:30:35 GMT"],"server":["Kestrel"]},"metadata_response_trailers":{}}
{"service":"gRPCService.Service_gRPC","method":"ExecuteQuery","messages":[{"message_origin":"client","raw_message":"CiR7IlF1ZXJ5VHlwZSI6IkdldFNlcnZlcklvTGlzdFF1ZXJ5In0=","message":{"1":"{"QueryType":"GetServerIoListQuery"}"},"timestamp":"2020-11-26T11:30:36.2532521-05:00"},{"message_origin":"server","raw_message":"CAEiRwoodHlwZS5nb29nbGVhcGlzLmNvbS9nUlBDU2VydmljZS5WYXJpYWJsZRIbChl7IklvTGlzdCI6W10sIlZlcnNpb24iOjB9","message":{"1":"1","4":{"1":"type.googleapis.com/gRPCService.Variable","2":{"1":"{"IoList":[],"Version":0}"}}},"timestamp":"2020-11-26T11:30:36.3372486-05:00"}],"metadata":{":authority":["192.168.0.10:1234"],"accept-encoding":["identity,gzip"],"content-type":["application/grpc"],"grpc-accept-encoding":["identity,deflate,gzip"],"user-agent":["grpc-csharp/2.33.1 grpc-c/13.0.0 (windows; chttp2)"],"via":["HTTP/2.0 127.0.0.1:1234"]},"metadata_response_headers":{"content-type":["application/grpc"],"date":["Thu, 26 Nov 2020 16:30:36 GMT"],"server":["Kestrel"]},"metadata_response_trailers":{}}

@bradleyjkemp
Copy link
Owner

Ah I see the problem:

"message":{"1":"{"ServerPublishingPort":56100,"BroadcastType":1,"CommandType":"RegisterCommand"}"}

This isn't valid JSON because the quotes aren't being escaped inside the string. It should be more like:

"message":{"1":"{\"ServerPublishingPort\":56100,\"BroadcastType\":1,\"CommandType\":\"RegisterCommand\"}"}

Really weird that that's happened. I'll have a look at what could be causing it within grpc-dump

@MikaelFerland
Copy link
Author

For future, are you able to provide the line number with the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants