Skip to content

Response has invalid UTF-8 #1789

@rajeshkmindix

Description

@rajeshkmindix

Hi,

I get the following error when trying to insert some nodes into dgraph.

com.google.protobuf.InvalidProtocolBufferException: Protocol message had invalid UTF-8.

I narrowed it down to

`ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 9080).usePlaintext(true).build();
DgraphGrpc.DgraphBlockingStub blockingStub = DgraphGrpc.newBlockingStub(channel);
DgraphClient dgraphClient = new DgraphClient(Collections.singletonList(blockingStub));

for(int i = 0; i < 1000; i++) {
  JsonObject json = new JsonObject();
  json.addProperty("id", i);
  json.addProperty("name", "abcdefgh" + i);

  System.out.println("for " + i);
  Mutation mu =
          Mutation.newBuilder()
                  .setCommitImmediately(true)
                  .setSetJson(ByteString.copyFromUtf8(json.toString()))
                  .build();
  dgraphClient.newTransaction().mutate(mu);
}`

After inserting around 100 to 150 nodes. I get the above error. If I rerun the above code, I get the same error for the first record itself. Every subsequent mutation request gets the same error.

I installed using
curl https://get.dgraph.io -sSf | bash

Ran it using
dgraph zero --port_offset -2000 dgraph server --memory_mb 2048 --zero localhost:5080
Need help with this.

Thanks in advance,
Rajesh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions