1

I have started graphdb with the following call:

/usr/local/graphdb-free-9.4.0/bin/graphdb -Xms60g -Xmx60g -Dgraphdb.connector.port=7200 -s

When accessing over HTTP, some of the longer queries generate 400 errors:

Type Exception Report

Message Request header is too large

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

How can the server be started so that headers of arbitrary size are accepted.

mkk
  • 879
  • 6
  • 19
  • you should use a POST request for long queries. Are your doing this already? – UninformedUser Sep 29 '20 at 06:18
  • *"The POST method should be used in cases where the length of the (URL-encoded) query exceeds practicable limits of proxies, servers, etc. In case a POST request is used, the query parameters should be send to the server as www-form-urlencoded data. "* (http://archive.rdf4j.org/system/ch08.html) – UninformedUser Sep 29 '20 at 06:20
  • Thanks @UninformedUser! Can you explain the difference between Content-Type and Accept for a POST header? When Accept is provided in the query context, Content-Type seems redundant. – mkk Sep 29 '20 at 18:35
  • My confusion regards the following example in the spec (section 3.1.1) which shows POST query *without* the Accept header: https://www.w3.org/TR/sparql11-protocol/. Versus the rdf4j documentation (10.4.1.2) which shows the POST query *with both* Accept and Content-Type: http://archive.rdf4j.org/users/ch10.html – mkk Sep 29 '20 at 18:40
  • 3
    Ok, nm it looks like the Content-Type header specifies the body of the request, which in this case is url-encoded the SPARQL itself, whereas the Accept header specifies the response format for the POST query – mkk Sep 29 '20 at 20:19

1 Answers1

2

The maximum size of the request and response HTTP header, specified in bytes, if not specified is set to 4096 (4 KB). “Request Header is too large“ error message is because auto generated query is too large. You may change Tomcat's maxHttpHeaderSize attribute by adding in graphdb.properties file under.

graphdb.connector.maxHttpHeaderSize = 65536

Konstantin Petrov
  • 1,058
  • 6
  • 11