Dgraph4j 1.7.1 error: io.netty.handler.codec.http2.Http2Exception: Header size exceeded max allowed size (10240)

I’m trying to use the Java client (dgraph4j 1.7.1) to commit a mutation that has a long ‘string’ value (15k).

The following error occurs:

io.grpc.StatusRuntimeException: INTERNAL: http2 exception
io.netty.handler.codec.http2.Http2Exception: Header size exceeded max allowed size (10240)

I was looking for a way to increase the value using the API, but nothing worked.
Is there a solution?

Mutation mu = Mutation.newBuilder().setSetNquads(ByteString.copyFromUtf8(mutate)).build();

Or is there a better way to commit a mutation in RDF format containing long strings?

Hey @tulbrich,

I couldn’t reproduce the problem even with a mutation of roughly ~10Mb (my sample code is below). Plus the error message says the header size is too long, is it possible for you to check what’s in the header? Thanks!

  public void testLongMutation() {
    String table = "abcdefghijklmnopqrstuvwxyz";
    Random rand = new Random();
    StringBuilder sb = new StringBuilder();
    sb.append("<_:bob> <name> \"");
    for (int i = 0; i < 10 * 1024 * 1024; i++) {
    sb.append("\" .");

    try (Transaction txn = dgraphClient.newTransaction()) {

      Mutation mutation =
      Assigned ag = txn.mutate(mutation);
      System.out.println("Got new id:" + ag.getUidsOrThrow("bob"));
1 Like

The problem is solved. Cause was a wrong encoded ‘’ inside the string.
Possibly one should catch such error cases with a meaningful error message. The problem itself was small, but the error message led to a completely wrong way to solve the problem.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.