{"record":{"id":"8ba36387edc005c1","repo":"unclecode/crawl4ai","slug":"artifact-not-found","errorCode":null,"errorMessage":"Artifact not found","messagePattern":"Artifact not found","errorType":"exception","errorClass":"ArtifactNotFound","httpStatus":404,"severity":"error","filePath":"deploy/docker/artifacts.py","lineNumber":104,"sourceCode":"    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    \"\"\"\n    if not isinstance(artifact_id, str) or not _HEX32.match(artifact_id):\n        raise ArtifactNotFound()\n    for ext, mime in _KIND.values():\n        path = os.path.join(ARTIFACT_DIR, artifact_id + ext)\n        try:\n            st = os.lstat(path)  # do NOT follow symlinks\n        except FileNotFoundError:\n            continue\n        if not os.path.stat.S_ISREG(st.st_mode):\n            raise ArtifactNotFound()  # symlink / special file\n        if time.time() - st.st_mtime > ARTIFACT_TTL_SECONDS:\n            try:\n                os.unlink(path)\n            except OSError:\n                pass\n            raise ArtifactNotFound()\n        return path, mime\n    raise ArtifactNotFound()\n\n","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/unclecode/crawl4ai/blob/7e801521428ee12509994d39151006f64055ebe3/deploy/docker/artifacts.py#L86-L122","documentation":"Error \"Artifact not found\" thrown in unclecode/crawl4ai.","triggerScenarios":"Thrown at deploy/docker/artifacts.py:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the artifact id is correct and the artifact has not expired or been deleted.","List artifacts to find the correct identifier."],"exampleFix":"GET /artifacts  # locate the correct artifact id","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-15T17:31:12.345Z"}