openai/codex · error · std::io::Error

fs/readFile returned invalid base64 dataBase64

Error message

fs/readFile returned invalid base64 dataBase64: {err}

What it means

Returned by the sandboxed filesystem's read_file when the sandbox helper's response carries a dataBase64 field that fails base64 decoding. The helper's response is structurally valid but its payload is corrupt, so the read cannot be honored.

Solutions

  1. Retry the read operation
  2. Verify the sandboxed fs helper binary is up to date and uncorrupted
  3. Capture the raw helper response for a bug report if reproducible
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/exec-server/src/sandboxed_file_system.rs:121 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/9bcff6261a637984. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/exec-server/src/sandboxed_file_system.rs:121

        options: ReadFileOptions,
        sandbox: Option<&FileSystemSandboxContext>,
    ) -> FileSystemResult<Vec<u8>> {
        let sandbox = require_platform_sandbox(sandbox)?;
        validate_native_path(path)?;
        let response = self
            .run_sandboxed(
                sandbox,
                FsHelperRequest::ReadFile(FsReadFileParams {
                    path: path.clone(),
                    follow_symlinks: (!options.follow_symlinks).then_some(false),
                    sandbox: None,
                }),
            )
            .await?
            .expect_read_file()
            .map_err(map_sandbox_error)?;
        STANDARD.decode(response.data_base64).map_err(|err| {
            io::Error::new(
                io::ErrorKind::InvalidData,
                format!("fs/readFile returned invalid base64 dataBase64: {err}"),
            )
        })
    }

    async fn write_file(
        &self,
        path: &PathUri,
        contents: Vec<u8>,
        options: WriteFileOptions,
        sandbox: Option<&FileSystemSandboxContext>,
    ) -> FileSystemResult<()> {
        let sandbox = require_platform_sandbox(sandbox)?;
        validate_native_path(path)?;
        self.run_sandboxed(
            sandbox,
            FsHelperRequest::WriteFile(FsWriteFileParams {

View on GitHub (pinned to 339751715c)