HTTPQUERY
English

507 Insufficient Storage

用法

507 Insufficient Storage 状态码表示服务器没有足够的存储空间来容纳该 HTTP 请求。这适用于一个本来有效且在客户端配额范围内的 PUT 或 POST 请求,但因服务器存储已满而失败的情况。该状态是作为 WebDAV 规范的一部分设计的,且这种状况预期是暂时的。

在被另一操作后续请求之前,客户端不得重复该请求。

一个相关的客户端错误是 413 Content Too Large(由 “Payload Too Large” 重命名而来),表示请求内容超出了服务器定义的限制。507 表示服务器的存储已满,而 413 表示单个请求体大于服务器愿意处理的大小。

SEO 影响

搜索引擎对 507 的处理与其他 5xx 服务器错误相同。持续的失败会降低抓取速率,并最终将受影响的 URL 从索引中移除。

示例

HTTP 客户端尝试传输一个文件,服务器返回 507 Insufficient Storage 状态码,因为服务器已没有存储空间。

请求

PUT /docs HTTP/1.1
Host: example.com
Content-Type: application/pdf
Content-Length: 10000

<PDF file included in message body>

响应

HTTP/1.1 507 Insufficient Storage
Content-Type: text/html
Content-Length: 181

<html>
  <head>
    <title>Insufficient Storage</title>
  </head>
  <body>
    <p>The server has temporarily run out of
    space and the file transfer failed.</p>
  </body>
</html>

如何修复

服务器在处理请求时耗尽了存储空间。先恢复容量,然后防止复发。

即时修复:

诊断原因:

防止复发:

代码参考

.NET

HttpStatusCode.InsufficientStorage

Rust

http::StatusCode::INSUFFICIENT_STORAGE

Rails

:insufficient_storage

Go

http.StatusInsufficientStorage

Symfony

Response::HTTP_INSUFFICIENT_STORAGE

Python3.5+

http.HTTPStatus.INSUFFICIENT_STORAGE

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_INSUFFICIENT_STORAGE

Angular

@angular/common/http/HttpStatusCode.InsufficientStorage