8000 libnet: add ep name in 'has active endpoints' error by akerouanton · Pull Request #49773 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

libnet: add ep name in 'has active endpoints' error #49773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

akerouanton
Copy link
Member
@akerouanton akerouanton commented Apr 8, 2025

- What I did

There have been numerous reports of the "has active endpoints" error over the years. Historically, there were some faulty code paths that could lead to this error, but we believe they all have been fixed by now.

However, users are still facing this error from time to time. Either because they forgot that some containers are still running, or because we still have bugs lying around.

To help users figure whether this error is legitimate, and what triggers it, add endpoint names (which are just container names) to the error message.

- How to verify it

$ docker network rm testnetv6                 
Error response from daemon: error while removing network: network testnetv6 has 1 active endpoint (goofy_swartz)
exit status 1
$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED         STATUS         PORTS     NAMES
2e8ae9193caa   alpine    "top"     9 seconds ago   Up 8 seconds             goofy_swartz

- Human readable description for the release notes

- Improve the "has active endpoints" error message by including the name of endpoints still connected to the network being deleted

@akerouanton akerouanton added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/networking labels Apr 8, 2025
@akerouanton akerouanton added this to the 28.1.0 milestone Apr 8, 2025
@akerouanton akerouanton requested review from thaJeztah and robmry April 8, 2025 17:25
@akerouanton akerouanton self-assigned this Apr 8, 2025
@akerouanton akerouanton force-pushed the improve-has-active-endpoints-error branch 2 times, most recently from 735a527 to d64a887 Compare April 8, 2025 21:20
if len(aee.endpoints) > 1 {
s = "s"
}
return fmt.Sprintf("network %s has %d active endpoint%s (%s)", aee.name, len(aee.endpoints), s, strings.Join(aee.endpoints, ", "))
Copy link
Member Author

Choose a reason for hiding this comment

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

Looking at https://grep.app/search?q=%22has+active+endpoints%22, I see that there are 8 repos doing string matching:

  • moby/moby
  • 1Panel-dev/1Panel (active)
  • kubernetes/minikube (active)
  • AliyunContainerService/pouch (looks inactive)
  • Tecnativa/doodba-copier-template (active)
  • kreuzwerker/terraform-provider-docker (looks inactive)
  • moby/swarmkit (active)
  • docker-archive/docker-ce (archived)

So I'm in favor of changing this error message. I can open issues on active repos to signal that their code will break with the next minor release.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or, just drop/move the %d, so the has active endpoints part of the string is unchanged? The count isn't really necessary when the list of endpoint names is included anyway?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with Rob. We shouldn't make breaking changes in non-major release. Especially when the breakage can be easily avoided by rephrasing the error message.

@akerouanton akerouanton force-pushed the improve-has-active-endpoints-error branch from d64a887 to cd5d103 Compare April 9, 2025 06:44
There have been numerous reports of the "has active endpoints" error
over the years. Historically, there were some faulty code paths that
could lead to this error, but we believe they all have been fixed by
now.

However, users are still facing this error from time to time. Either
because they forgot that some containers are still running, or because
we still have bugs lying around.

To help users figure whether this error is legitimate, and what triggers
it, add endpoint names (which are just container names) to the error
message.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
@akerouanton akerouanton force-pushed the improve-has-active-endpoints-error branch from cd5d103 to 241d685 Compare April 9, 2025 08:54
@akerouanton akerouanton requested review from vvoland and robmry April 9, 2025 08:59
@akerouanton
Copy link
Member Author

Only the error message format changed since Rob's approval, so let me bring it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0