Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Errors and limits

Error shape

Drive’s own errors are JSON with one field:

{"error": "file version mismatch"}

The message is for people reading logs; branch on the status code, not the text.

StatusMeaningExample error
400Bad inputinline file content must be 300000 bytes or fewer, x-granite-grant must be a UUID
401Missing or invalid credentialsalways unauthorized
403Authenticated, but not allowed: the grant is revoked or expired, doesn’t cover the request, or the action is one apps can’t takealways forbidden
404No such filefile 0b3e8d2a-7c41-4f9e-a5d6-2c9b1e7f4a30 does not exist
409Conflicts with the current state: a stale expected_version, a name already used in the folder, or a limit reachedfile version mismatch, name "shopping.md" already exists in this directory, file limit reached: 1000 files allowed
429An hourly limit was reached<action> limit reached: <n> per hour
5xxDrive or a service it depends on failedalways internal error

403 never says why. If your app could reach a file before and now gets 403, check the grant with Granite.

Drive fails closed: if it can’t confirm a grant with Granite, the request fails with a 5xx and nothing is read or written. Retry 429 and 5xx responses later, with backoff.

Parsing errors

These come from the web framework, before authentication, as plain text:

StatusCauseExample body
400A path segment that should be a UUID isn’tInvalid URL: Cannot parse `file_id` with value `not-a-uuid`: UUID parsing failed: invalid character: found `n` at 0
400The body is not valid JSONFailed to parse the request body as JSON: EOF while parsing a value at line 1 column 12
415Missing Content-Type: application/json on a request with a JSON body
422Valid JSON, wrong fields: an unknown field, a wrong type, a missing required fieldFailed to deserialize the JSON body into the target type: colour: unknown field `colour`, expected one of `name`, `content`, `mime_type`, `directory_id`, `tags` at line 1 column 20
413The body is over 2 MBFailed to buffer the request body: length limit exceeded
curl -sS -o /dev/null -w '%{http_code}\n' https://tj7hnhcvwir4n6rl5itdqut3mq0wdpke.lambda-url.us-east-1.on.aws/v1/files/not-a-uuid | grep -Fx 400

An unknown path answers 404 with an empty body.

Limits

Each person has these limits by default, shared by every app they use and the Drive app. Files in the trash still count.

LimitDefaultWhen reached
Files1,000409
Folders200409
Storage250 MB409

Per request:

LimitValueWhen over
File content sent by an app300,000 bytes400
File and folder names255 characters400
Tags50 per file, 80 characters each400
Request body2 MB413 (plain text)