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...
});