hyperledger-archives / iroha

Iroha - A simple, decentralized ledger

Home Page:http://iroha.tech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

run TransactionExample.java got "Did not read entire message"

aalinyu opened this issue · comments

When i use java library and Compiling Java Bindings Manually
I run iroha on my mac by docker

  1. docker run --name some-postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 --network=iroha-network postgres:latest
  2. docker run -it -p 50051:50051 -v $(pwd)/iroha/example:/opt/iroha_data -v blockstore:/tmp/block_store --network=iroha-network --entrypoint=/bin/bash hyperledger/iroha:latest

My TransactionExample.java dependency is

<dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>3.5.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
            <version>1.8.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>1.8.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty</artifactId>
            <version>1.8.0</version>
        </dependency>

When i run example/java/TransactionExample.javaIn my IDE , i got the error:

15:55:55.731 [grpc-default-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x0d91ffa9, L:/127.0.0.1:58050 - R:localhost/127.0.0.1:50051] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=164
Exception in thread "main" io.grpc.StatusRuntimeException: INTERNAL: Did not read entire message
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:221)
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:202)
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:131)
	at iroha.protocol.CommandServiceGrpc$CommandServiceBlockingStub.torii(CommandServiceGrpc.java:320)
	at com.acooly.iroha.dao.Example1.main(Example1.java:102)

Why i got the error?

commented

Could you try with the following versions:

  • grpc 1.11.0 (I actually use 1.8.4 and it's working fine, so you may try it as well)
  • protobuf 3.5.1

Also, what commit are you using? And could you please check, that after docker startup you're able to connect to localhost:50051 (netcat/curl should work)

@l4l I use the master branch :0b2066b Kitsu on 2018/7/24 at 01:28 (committed by GitHub) Add mst documentation (#1566)get the error.
when i use the latest release verson will be fine.

commented

I guess it master branch. So what about the connection to Iroha nodes, does it work?

commented

Ok, and did you try different grpc/protobuf versions?

@l4l i have try grpc 1.13.2 , protobuf 3.6.0 got the same error

commented

Issue is old, will be closed. Please try a new Iroha version.