infiniflow/ragflow · error · RuntimeError

Unsupported artifact entry: {path.name}

Error message

Unsupported artifact entry: {path.name}

What it means

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().

Source

Thrown at agent/sandbox/providers/local.py:324

        _, hard = resource.getrlimit(kind)
        limit = value if hard == resource.RLIM_INFINITY else min(value, hard)
        resource.setrlimit(kind, (limit, limit))

    def _validate_output_size(self, stdout: str, stderr: str) -> None:
        output_size = len((stdout or "").encode("utf-8")) + len((stderr or "").encode("utf-8"))
        if output_size > self.max_output_bytes:
            raise RuntimeError(f"Local execution output exceeded {self.max_output_bytes} bytes.")

    def _collect_artifacts(self, artifacts_dir: Path) -> list[dict[str, Any]]:
        artifacts: list[dict[str, Any]] = []
        for path in sorted(artifacts_dir.rglob("*")):
            if path.is_symlink():
                raise RuntimeError(f"Artifact symlinks are not allowed: {path.name}")
            if path.is_dir():
                continue
            if not path.is_file():
                raise RuntimeError(f"Unsupported artifact entry: {path.name}")

            if len(artifacts) >= self.max_artifacts:
                raise RuntimeError(f"Local execution produced more than {self.max_artifacts} artifacts.")

            size = path.stat().st_size
            if size > self.max_artifact_bytes:
                raise RuntimeError(f"Artifact exceeds {self.max_artifact_bytes} bytes: {path.name}")

            ext = path.suffix.lower()
            if ext not in ALLOWED_ARTIFACT_EXTENSIONS:
                raise RuntimeError(f"Unsupported artifact type: {path.name}")

            artifacts.append(
                {
                    "name": path.relative_to(artifacts_dir).as_posix(),
                    "content_b64": base64.b64encode(path.read_bytes()).decode("ascii"),
                    "mime_type": mimetypes.guess_type(path.name)[0] or "application/octet-stream",
                    "size": size,

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Make the executed code clean up non-file IPC objects before returning (os.unlink the fifo/socket), or create them outside the artifacts directory.
  2. Restructure the code to use in-memory queues or temp paths outside artifacts/.
  3. After the failure, inspect the instance directory (path is in instance metadata) to identify the offending entry name.
  4. If a third-party library is responsible, set its state/work directory (e.g. tmpdir) to a sibling of artifacts/, not inside it.

Example fix

# before (executed code)
os.mkfifo('artifacts/ipc')
...
# after (executed code)
import tempfile, os
fifo = os.path.join(tempfile.mkdtemp(dir='.'), 'ipc')
os.mkfifo(fifo)
...
os.unlink(fifo)
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = provider.execute_code(instance_id, code, "python")
except RuntimeError as e:
    if "Unsupported artifact entry" in str(e):
        # inspect instance_dir/artifacts for fifo/socket files; fix code to unlink them
        raise
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/e0d89e13dfd8a68f. Report an issue: GitHub.