openai/codex · error · io::Error

InvalidData

InvalidData

Error message

{FS_READ_BLOCK_METHOD} returned {} bytes, maximum is {}

What it means

Error "{FS_READ_BLOCK_METHOD} returned {} bytes, maximum is {}" thrown in openai/codex.

Source

Thrown at codex-rs/exec-server/src/remote_file_stream.rs:61

        .map_err(map_remote_error)?;
    Ok(FileSystemReadStream::new(futures::stream::try_unfold(
        Some((registration, 0_u64)),
        |state| async move {
            let Some((mut registration, offset)) = state else {
                return Ok(None);
            };
            let response = registration
                .client
                .fs_read_block(FsReadBlockParams {
                    handle_id: registration.handle_id.clone(),
                    offset,
                    len: FILE_READ_CHUNK_SIZE,
                })
                .await
                .map_err(map_remote_error)?;
            let chunk = Bytes::from(response.chunk.into_inner());
            if chunk.len() > FILE_READ_CHUNK_SIZE {
                return Err(io::Error::new(
                    io::ErrorKind::InvalidData,
                    format!(
                        "{FS_READ_BLOCK_METHOD} returned {} bytes, maximum is {}",
                        chunk.len(),
                        FILE_READ_CHUNK_SIZE
                    ),
                ));
            }
            if response.eof {
                if registration
                    .client
                    .fs_close(FsCloseParams {
                        handle_id: registration.handle_id.clone(),
                    })
                    .await
                    .is_ok()
                {
                    registration.active = false;

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/exec-server/src/remote_file_stream.rs:61 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/9620ad86dcd12fa6. Report an issue: GitHub.