nodeSolidServer / nodeSolidServer/node-solid-server

Syntax error when SPARQL Insert request is too large

Open
#1,628 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

When sending PATCH request with a really large SPARQL Insert body, NSS responds with http code 400 and the following response body:

Patch document syntax error: Line 1 of <https://pod.example/resource>: Bad syntax:
   Unknown syntax at start of statememt: '[object Object]'
   at: "[object Object]"

This response is very misleading, since it asserts that I did send an invalid syntax

Expected behaviour

NSS should either process the request successfully, or respond with 413 Request Entity Too Large.

Steps to reproduce

Send something like this to NSS:

PATCH https://pod.example/resource
content-type: application/sparql-update
authorization: DPoP <token>
dpop: <dpop>

INSERT DATA {
</> <> "".
</> <> "".
</> <> "".
</> <> "".
</> <> "".
... round about 10.000 more of this ...
}

Is this really practically relevant?

Yes, see https://github.com/codecentric/web-clip/issues/7

First we had an actual syntax error. After fixing it, same response on NSS but this time just too large.

Depending on the page, WebClip might do really large insert requests. If we got a 413 we could at least handle it properly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing NSS's PATCH handling for application/sparql-update requests and the request-size error path, then reproduce the supplied large INSERT example. Done means the request is processed when supported or returns HTTP 413 Request Entity Too Large instead of a misleading syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.