507

Insufficient Storage

개요

507 Insufficient Storage는 서버가 요청을 완료하는 데 필요한 표현(representation)을 저장할 공간이 부족하다는 뜻입니다. WebDAV에서 정의된 코드로, 파일 업로드나 저장 작업 중 디스크나 할당량(quota)이 가득 찼을 때 반환됩니다.

이는 서버 측 자원 한계 문제입니다. 물리 디스크 공간이 부족하거나, 사용자·계정별 저장 할당량을 초과했거나, 임시 저장 영역이 꽉 찼을 때 발생합니다.

언제 발생하나

요청 / 응답 예시

요청
PUT /files/backup.zip HTTP/1.1
Host: dav.example.com
Content-Type: application/zip
Content-Length: 524288000

<500 MB body>
응답
HTTP/1.1 507 Insufficient Storage
Content-Type: application/xml

<D:error xmlns:D="DAV:"><D:quota-not-exceeded/></D:error>

코드로 보기

app.put('/files/:name', async (req, res) => {
  const free = await getFreeBytes(storageDir);
  if (Number(req.headers['content-length']) > free) {
    return res.status(507).send('Insufficient Storage');
  }
  // stream the upload to disk...
});

흔한 원인

해결 방법

실무 참고

관련 상태코드

스펙 근거