507 Insufficient Storage
Description
The 507 Insufficient Storage status code indicates that the server is unable to store the representation needed to complete the request. This status code is specific to WebDAV (Web Distributed Authoring and Versioning) and similar protocols that allow clients to place (PUT) resources on the server.
This error occurs when a server cannot accept or store a resource due to storage constraints, such as:
- The server has reached its storage quota
- The user has reached their allocated storage limit
- The file system is full or has insufficient space
- Storage policies prevent storing the specific content
- Resource limits have been reached for the account or server
Unlike 413 Payload Too Large, which indicates the current request entity is too large, 507 indicates that the server's storage system as a whole cannot accommodate the resource, even if the individual request size is acceptable.
Syntax
HTTP/1.1 507 Insufficient Storage
Content-Type: application/json
Content-Length: 187
{
"error": {
"code": 507,
"message": "Insufficient Storage",
"details": "The server is unable to store the representation needed to complete the request."
}
}
Examples
Example 1: WebDAV File Upload to Full Server
A user attempts to upload a file to a WebDAV server that has reached its storage capacity.
Request:
PUT /files/document.docx HTTP/1.1
Host: webdav.example.com
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content-Length: 25000
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
[Binary data for document.docx]
Response:
HTTP/1.1 507 Insufficient Storage
Content-Type: application/json
Content-Length: 196
{
"error": {
"code": 507,
"message": "Insufficient Storage",
"details": "The server has reached its storage capacity. Please delete some files before uploading new ones."
}
}
Example 2: Cloud Storage API User Quota Exceeded
A user attempts to upload a file to a cloud storage service but has exceeded their storage quota.
Request:
POST /api/files/upload HTTP/1.1
Host: storage.example.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Length: 15000000
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="large-video.mp4"
Content-Type: video/mp4
[Binary data for large-video.mp4]
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Response:
HTTP/1.1 507 Insufficient Storage
Content-Type: application/json
Content-Length: 243
{
"error": {
"code": 507,
"message": "Insufficient Storage",
"details": "Your account has reached its storage limit of 10GB. Please upgrade your plan or delete existing files to free up space."
}
}
Example 3: Version Control System Repository Size Limit
A developer attempts to push changes to a version control system, but the repository would exceed the maximum allowed size.
Request:
POST /git-repository/repo.git/git-receive-pack HTTP/1.1
Host: git.example.com
Content-Type: application/x-git-receive-pack-request
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Content-Length: 5000000
[Binary git pack data]
Response:
HTTP/1.1 507 Insufficient Storage
Content-Type: application/json
Content-Length: 235
{
"error": {
"code": 507,
"message": "Insufficient Storage",
"details": "This repository would exceed the maximum allowed size of 1GB. Consider using Git LFS for large files or splitting the repository."
}
}
Summary
The 507 Insufficient Storage status code indicates that the server is unable to store the representation needed to complete the request due to storage constraints. It's primarily used in WebDAV and similar protocols that allow clients to store resources on the server.
Key points about 507 Insufficient Storage:
- It's specific to WebDAV and similar protocols that allow storing resources on the server
- It indicates a storage capacity issue, not a problem with the request format
- It differs from 413 Payload Too Large, which is about the size of the current request
- The condition may be temporary (if storage is later freed) or permanent (if quota limits are reached)
- The response should include information about the storage limitation and possible solutions
- Clients receiving this status should consider deleting unnecessary resources or requesting increased storage capacity
- It's defined in RFC 4918 (WebDAV) but can be used in any HTTP application where storage limits are relevant
- Storage constraints can be at the server level, user account level, or specific resource collection level