Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

networkIssues and features associated with networking and DNS.

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions