{"record":{"id":"e0d89e13dfd8a68f","repo":"infiniflow/ragflow","slug":"unsupported-artifact-entry-path-name","errorCode":null,"errorMessage":"Unsupported artifact entry: {path.name}","messagePattern":"Unsupported artifact entry: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"agent/sandbox/providers/local.py","lineNumber":324,"sourceCode":"\n        _, hard = resource.getrlimit(kind)\n        limit = value if hard == resource.RLIM_INFINITY else min(value, hard)\n        resource.setrlimit(kind, (limit, limit))\n\n    def _validate_output_size(self, stdout: str, stderr: str) -> None:\n        output_size = len((stdout or \"\").encode(\"utf-8\")) + len((stderr or \"\").encode(\"utf-8\"))\n        if output_size > self.max_output_bytes:\n            raise RuntimeError(f\"Local execution output exceeded {self.max_output_bytes} bytes.\")\n\n    def _collect_artifacts(self, artifacts_dir: Path) -> list[dict[str, Any]]:\n        artifacts: list[dict[str, Any]] = []\n        for path in sorted(artifacts_dir.rglob(\"*\")):\n            if path.is_symlink():\n                raise RuntimeError(f\"Artifact symlinks are not allowed: {path.name}\")\n            if path.is_dir():\n                continue\n            if not path.is_file():\n                raise RuntimeError(f\"Unsupported artifact entry: {path.name}\")\n\n            if len(artifacts) >= self.max_artifacts:\n                raise RuntimeError(f\"Local execution produced more than {self.max_artifacts} artifacts.\")\n\n            size = path.stat().st_size\n            if size > self.max_artifact_bytes:\n                raise RuntimeError(f\"Artifact exceeds {self.max_artifact_bytes} bytes: {path.name}\")\n\n            ext = path.suffix.lower()\n            if ext not in ALLOWED_ARTIFACT_EXTENSIONS:\n                raise RuntimeError(f\"Unsupported artifact type: {path.name}\")\n\n            artifacts.append(\n                {\n                    \"name\": path.relative_to(artifacts_dir).as_posix(),\n                    \"content_b64\": base64.b64encode(path.read_bytes()).decode(\"ascii\"),\n                    \"mime_type\": mimetypes.guess_type(path.name)[0] or \"application/octet-stream\",\n                    \"size\": size,","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/sandbox/providers/local.py#L306-L342","documentation":"Raised by LocalProvider._collect_artifacts() when an entry under the artifacts directory is neither a symlink, a directory, nor a regular file. This covers FIFOs, sockets, device nodes, and broken/deleted entries — object types that cannot be meaningfully base64-collected. The run fails with RuntimeError during artifact collection inside execute_code().","triggerScenarios":"Executed code creating os.mkfifo('artifacts/pipe.json'), binding a unix socket, or creating any non-regular file inside the artifacts directory. A broken symlink also lands here only after the is_symlink() check, so genuine FIFOs/sockets are the main case.","commonSituations":"Generated code using a named pipe for IPC and leaving it in the output directory; multiprocessing or daemon libraries (e.g. a Jupyter kernel, Dask worker) dropping socket files in the working tree; adversarial probes of the artifact collector.","solutions":["Make the executed code clean up non-file IPC objects before returning (os.unlink the fifo/socket), or create them outside the artifacts directory.","Restructure the code to use in-memory queues or temp paths outside artifacts/.","After the failure, inspect the instance directory (path is in instance metadata) to identify the offending entry name.","If a third-party library is responsible, set its state/work directory (e.g. tmpdir) to a sibling of artifacts/, not inside it."],"exampleFix":"# before (executed code)\nos.mkfifo('artifacts/ipc')\n...\n# after (executed code)\nimport tempfile, os\nfifo = os.path.join(tempfile.mkdtemp(dir='.'), 'ipc')\nos.mkfifo(fifo)\n...\nos.unlink(fifo)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = provider.execute_code(instance_id, code, \"python\")\nexcept RuntimeError as e:\n    if \"Unsupported artifact entry\" in str(e):\n        # inspect instance_dir/artifacts for fifo/socket files; fix code to unlink them\n        raise\n    raise","preventionTips":["Create IPC objects (fifos, sockets) outside the artifacts directory or clean them up before exit.","Point third-party libraries' state dirs at a sibling of artifacts/, never inside it."],"tags":["sandbox","artifacts","local-provider","filesystem"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}