Skip to content
This repository was archived by the owner on Mar 24, 2018. It is now read-only.
This repository was archived by the owner on Mar 24, 2018. It is now read-only.

0.4.0 posting bad request data to protobuf service layer #4

Description

@localshred

We are using for our protobuf service layer a java server and the ruby app we're running is the client. When doing a request from the ruby client, calling the java RPC service, the java service returns bad request data. We also get a bad stack trace on the ruby side, saying invalid value: nil
Doing some grep-ing it is happening in this file: lib/protobuf/message/field.rb on 691

My ruby env is Ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]
We're using rprotoc 0.4.0, which we know is the experimental branch.
Unfortunately rprotoc 0.3.3 doesn't work with ruby 1.9.1 (having TCPSocket readbyte issues - invalid number of params)

Sample Ruby code:
rpc_request = Cerebro::UserAuthorizationParams.new
rpc_request.email = params[:email]
rpc_request.hash = Digest::SHA1.hexdigest(params[:password])
rpc_response = Cerebro::User.new

rpc_client = Protobuf::Rpc::Client.new('localhost', 7575)
rpc_client.call(:authorize , rpc_request , rpc_response) # throws the error of "TypeError - Invalid value: nil"

Java protobuf is reporting:
com.googlecode.protobuf.socketrpc.SocketRpcServer$Handler handleError
WARNING: BAD_REQUEST_DATA: Bad request data from client
com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or that an embedded message misreported its own length.
at com.google.protobuf.InvalidProtocolBufferException.truncatedMessage(InvalidProtocolBufferException.java:49)
at com.google.protobuf.CodedInputStream.refillBuffer(CodedInputStream.java:691)
at com.google.protobuf.CodedInputStream.readRawBytes(CodedInputStream.java:756)
at com.google.protobuf.CodedInputStream.readBytes(CodedInputStream.java:274)
at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:484)
at com.google.protobuf.GeneratedMessage$Builder.parseUnknownField(GeneratedMessage.java:271)
at com.googlecode.protobuf.socketrpc.SocketRpcProtos$Request$Builder.mergeFrom(SocketRpcProtos.java:371)
at com.googlecode.protobuf.socketrpc.SocketRpcProtos$Request$Builder.mergeFrom(SocketRpcProtos.java:1)
at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:244)
at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:182)
at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:202)
at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:683)
at com.googlecode.protobuf.socketrpc.SocketRpcServer$Handler.callMethod(SocketRpcServer.java:160)
at com.googlecode.protobuf.socketrpc.SocketRpcServer$Handler.run(SocketRpcServer.java:128)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions