Skip to content

Docker.DotNet JSON parsing fails with Docker 29.x - "0x00 is an invalid start of a property name" #58

@thomhurst

Description

@thomhurst

When using Testcontainers with Docker daemon version 29.x (e.g., 29.1.3), operations like ExecAsync() and image pulling fail with JSON parsing errors:

JsonException: '0x00' is invalid after a single JSON value. Expected end of data.

or

JsonReaderException: '0x00' is an invalid start of a property name. Expected a '"'.

Root Cause:

The Docker API in version 29.x appears to return responses with embedded null bytes or a different wire format that Docker.DotNet (the library Testcontainers uses internally) doesn't handle correctly. The parsing happens in
Docker.DotNet.JsonSerializer.TryParseJson().

Affected Operations:

  • Container exec (DockerContainerOperations.ExecAsync)
  • Image pulling (DockerImageOperations.CreateAsync)

Environment:

  • Docker: 29.1.3
  • Testcontainers.Kafka
  • OS: Ubuntu 24.04 / WSL2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions