Skip to content

Conversation

mgorripa
Copy link
Contributor

Context

Fixes #2786

Changes

  • Intercept "Pool overlaps" error from Docker.
  • List existing Docker networks and match by subnet.
  • Return a clear, actionable error message with a link to the docs.

Example

Before:
Error response from daemon: invalid pool request: Pool overlaps with other one on this address space.

After:
Subnet 172.20.0.0/16 already in use by Docker network "testnet".
See https://containerlab.dev/manual/network/


This is my first contribution to containerlab.

mgorripa and others added 2 commits September 25, 2025 15:05
Previously, when a requested subnet overlapped with an existing Docker
network, containerlab returned Docker's raw error:

    Error response from daemon: invalid pool request: Pool overlaps ...

Now, containerlab detects the overlap and returns a clearer error:

    Subnet 172.20.0.0/16 already in use by Docker network "testnet".
    See https://containerlab.dev/manual/network/

This helps users quickly identify the conflicting network.
list existing networks
@hellt hellt requested a review from Copilot September 26, 2025 07:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the error handling for Docker network creation when subnet overlaps occur. It replaces generic Docker daemon error messages with clear, actionable feedback that identifies which network is causing the conflict.

  • Intercepts Docker's "Pool overlaps" error during management network creation
  • Queries existing Docker networks to find the specific conflicting network
  • Returns a user-friendly error message with documentation link

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hellt hellt merged commit 30c3a32 into srl-labs:main Sep 26, 2025
45 of 49 checks passed
@hellt
Copy link
Member

hellt commented Sep 26, 2025

thanks @mgorripa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display a better error message on network range clash
2 participants