HTTP 507 Insufficient Storage

Insufficient Storage

HTTP 507 is Insufficient Storage: the method couldn’t be performed because the server is unable to store the representation needed to complete the request (RFC 4918 section 11.5). RFC 4918 treats the condition as temporary, and adds a rule: if the request came from a user’s action, it must not be repeated until the user asks again.

Quotas

RFC 4331, WebDAV’s quota extension, says 507 should be used when a request such as a PUT, MKCOL, MOVE or COPY fails because it would exceed the user’s quota or the physical storage. It defines a precondition for each, so the client can tell them apart:

HTTP/1.1 507 Insufficient Storage
Content-Type: application/xml; charset="utf-8"

<?xml version="1.0" encoding="utf-8"?>
<D:error xmlns:D="DAV:">
  <D:quota-not-exceeded/>
</D:error>

quota-not-exceeded means the quota ran out; sufficient-disk-space means the disk did. A client can ask how much room is left with a PROPFIND for the DAV:quota-available-bytes and DAV:quota-used-bytes properties.

Who sends it

  • Nextcloud and ownCloud, built on the SabreDAV WebDAV server, answer an upload that would go over the user’s quota with 507.
  • WebDAV servers in general when the disk fills during a PUT or a COPY.
  • A few APIs outside WebDAV borrow it for a storage quota that has run out.

507 or 413

this one request is bigger than the server accepts      413 Content Too Large
the server, or the user's quota, has no room left       507 Insufficient Storage

A 413 goes away when the client sends something smaller; a 507 when someone frees space or raises the quota. Some argue a per-user quota is the client’s problem and deserves a 4xx; RFC 4331 settles it for WebDAV with 507.

Gotchas

  • Don’t retry automatically. RFC 4918 forbids repeating a user’s request until the user asks again; a sync client that retries in a loop only fills the logs.
  • Your own disk filling up under an ordinary API is a 500 or a 503 to the client, unless the request itself needed the space.
  • Caching. 507 isn’t heuristically cacheable.
if (used + upload.size > quota) {                                    // Express
  return res.status(507).json({ error: 'quota_exceeded', availableBytes: Math.max(0, quota - used) });
}

Search 413 507 in the tool below to compare the two.

Try it in the HTTP Status Codes

507 Insufficient Storage

  1. 507Insufficient Storage5xx Server error

    The server cannot store what the request needs to store.

    When to use it

    WebDAV writes, and the APIs that borrow it to report a storage quota that has run out.

    Common mistakes

    Using it for one oversized upload, which is 413, and retrying it automatically: RFC 4918 says a request a user made must not be repeated until the user asks again.

    Not cacheable by defaultRFC 4918

Every code, by class

Codes marked unofficial come from one server’s own convention — nginx, Cloudflare, cPanel, Microsoft — and are not in the IANA registry.

Runs in your browser. Nothing you enter is sent anywhere.