You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run -p 4222:4222 -ti nats:latest --debug --trace in a window.
go get github.com/liftbridge-io/go-liftbridge and then $GOPATH/bin/liftbridge --raft-bootstrap-seed --nats-servers nats://localhost:4222 --level debug in another window.
Clone my repo from https://github.com/paambaati/node-liftbridge.git in yet another window.
yarn install or npm install
yarn run debug or npm run debug
When trying to read this message on the Node.js side, I get this error —
Error [AssertionError]: Assertion failed
at new goog.asserts.AssertionError (~/node-liftbridge/node_modules/google-protobuf/google-protobuf.js:1166:22)
at Object.goog.asserts.doAssertFailure_ (~/node-liftbridge/node_modules/google-protobuf/google-protobuf.js:1186:9)
at Object.goog.asserts.assert [as assert] (~/node-liftbridge/node_modules/google-protobuf/google-protobuf.js:1193:55)
at Function.jspb.Map.deserializeBinary (~/node-liftbridge/node_modules/google-protobuf/google-protobuf.js:3881:18)
at ~/node-liftbridge/grpc/generated/api_pb.js:2259:18
at jspb.BinaryReader.readMessage (~/node-liftbridge/node_modules/google-protobuf/google-protobuf.js:3517:5)
at Function.proto.proto.Message.deserializeBinaryFromReader (~/node-liftbridge/grpc/generated/api_pb.js:2258:14)
at Function.proto.proto.Message.deserializeBinary (~/node-liftbridge/grpc/generated/api_pb.js:2214:30)
at deserialize_proto_Message (~/node-liftbridge/grpc/generated/api_grpc_pb.js:59:25)
at ~/node-liftbridge/node_modules/grpc/src/common.js:38:12
at ~/node-liftbridge/node_modules/grpc/src/client_interceptors.js:689:22 {
message: 'Assertion failed',
reportErrorToServer: true,
messagePattern: 'Assertion failed'
}
Specifically, this happens when the header value for key "reply" is read. Printing the values f and g in the below snippet prints "reply" for f and undefined for g, when one would expect it to be "" (an empty string).
jspb.Map.deserializeBinary = function(a, b, c, d, e, f) {
for (var g = void 0; b.nextField() && !b.isEndGroup();) {
var h = b.getFieldNumber();
1 == h ? f = c.call(b) : 2 == h && (a.valueCtor_ ? (goog.asserts.assert(e), g = new a.valueCtor_, d.call(b, g, e)) : g = d.call(b))
}
goog.asserts.assert(void 0 != f);
goog.asserts.assert(void 0 != g);
a.set(f, g)
};
protobuf.js version:
5.0.3and6.8.8A Go-written message has an empty string as a
mapvalue, but the Node version fails when deserializing it because it sees it asundefined.Proto file — https://github.com/liftbridge-io/liftbridge-grpc/blob/5694b15f251d2ff16d7d4c3e8d944aab327d3ef0/api.proto#L93-L104
The value for a
Messageon the Go side looks like this —Reproduction steps
docker run -p 4222:4222 -ti nats:latest --debug --tracein a window.go get github.com/liftbridge-io/go-liftbridgeand then$GOPATH/bin/liftbridge --raft-bootstrap-seed --nats-servers nats://localhost:4222 --level debugin another window.https://github.com/paambaati/node-liftbridge.gitin yet another window.yarn installornpm installyarn run debugornpm run debugWhen trying to read this message on the Node.js side, I get this error —
Specifically, this happens when the header value for key "reply" is read. Printing the values
fandgin the below snippet prints"reply"forfandundefinedforg, when one would expect it to be""(an empty string).Related issues