{"record":{"id":"7c938a1bc53c6b63","repo":"unclecode/crawl4ai","slug":"artifact-storage-quota-exceeded","errorCode":null,"errorMessage":"artifact storage quota exceeded","messagePattern":"artifact storage quota exceeded","errorType":"exception","errorClass":"QuotaExceeded","httpStatus":507,"severity":"error","filePath":"deploy/docker/artifacts.py","lineNumber":84,"sourceCode":"                try:\n                    st = entry.stat(follow_symlinks=False)\n                    if os.path.stat.S_ISREG(st.st_mode):\n                        total += st.st_size\n                except OSError:\n                    continue\n    except FileNotFoundError:\n        return 0\n    return total\n\n\ndef write_artifact(kind: str, data: bytes) -> Dict:\n    \"\"\"Write bytes under a server-generated opaque id. Returns metadata.\"\"\"\n    ext, mime = _KIND.get(kind, (\".bin\", \"application/octet-stream\"))\n    if len(data) > MAX_ARTIFACT_BYTES:\n        raise ArtifactTooLarge(f\"artifact exceeds {MAX_ARTIFACT_BYTES} bytes\")\n    init_store()\n    if _dir_size() + len(data) > ARTIFACT_QUOTA_BYTES:\n        raise QuotaExceeded(\"artifact storage quota exceeded\")\n\n    artifact_id = uuid.uuid4().hex  # 32 hex chars, unguessable\n    path = os.path.join(ARTIFACT_DIR, artifact_id + ext)\n    # O_EXCL: never follow/overwrite an existing entry; O_NOFOLLOW: refuse a\n    # symlink at the final component. Server-chosen name => no traversal.\n    flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, \"O_NOFOLLOW\", 0)\n    fd = os.open(path, flags, 0o600)\n    with os.fdopen(fd, \"wb\") as f:\n        f.write(data)\n    return {\"artifact_id\": artifact_id, \"mime\": mime, \"size\": len(data)}\n\n\ndef resolve_artifact(artifact_id: str) -> Tuple[str, str]:\n    \"\"\"Map an opaque id to (path, mime), enforcing hex-id, no-symlink, TTL.\n\n    Raises ArtifactNotFound for an invalid id, a non-regular/symlink file, a\n    missing file, or an expired artifact (so existence is never revealed).\n    \"\"\"","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/unclecode/crawl4ai/blob/7e801521428ee12509994d39151006f64055ebe3/deploy/docker/artifacts.py#L66-L102","documentation":"Error \"artifact storage quota exceeded\" thrown in unclecode/crawl4ai.","triggerScenarios":"Thrown at deploy/docker/artifacts.py:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete unused artifacts to free quota before storing new ones.","Reduce artifact retention or size to stay within the storage quota."],"exampleFix":"DELETE /artifacts/{id}  # free quota, then retry","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7e801521428ee12509994d39151006f64055ebe3","analyzedAt":"2026-08-14T20:46:20.673Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}