Skip to content

[Bug]: Unable to delete a network - IP allocator cannot be disabled with active containers #1318

@jglogan

Description

@jglogan

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

There's a corner case where if the sandbox service terminates abruptly, it fails to deallocate the IP addresses for the failed container's interfaces. An orphaned allocation on a user-created network prevents the user from deleting the network with container network delete, even if they deleted all other containers attached to the network.

The workaround is to stop and start the container service, which is hardly ideal.

Current behavior

cannot delete subnet foo because the IP allocator cannot be disabled with active containers

Expected behavior

Network with no referring containers can be deleted.

Environment

- OS: 26.3
- Xcode: 26
- Container: 0.8.0

Relevant log output

$ container network delete --debug foo
2026-03-15T08:50:46Z failed to delete network: ["error": invalidState: "cannot delete subnet foo because the IP allocator cannot be disabled with active containers", "id": foo]
Error: delete failed for one or more networks: ["foo"]

$ container list
ID  IMAGE  OS  ARCH  STATE  ADDR  CPUS  MEMORY  STARTED

$ container list -a
ID                    IMAGE                                                  OS     ARCH   STATE    ADDR  CPUS  MEMORY   STARTED
buildkit              docker.apple.com/containerkit/builder:0.8.0-10         linux  arm64  stopped        2     2048 MB  2026-03-15T07:25:45Z

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions