-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[BUG] Can not delete Container over ssh if there is more than one #10117
Comments
Some interesting insights here : #8856 (comment) |
version: '3.8'
services:
busybox1:
image: busybox
command: "sleep 1d"
busybox2:
image: busybox
command: "sleep 1d"
depends_on: [busybox1] Works fine, services stops correctly without deconnexion. |
👀 |
This is probably caused by docker/cli#3900, which is included in latest release. |
Hi, I'm seeing this ocassionally as well with my own docker compose files using an SSH context. What I've found or didn't realize earlier is that docker-compose uses a single SSH connection per defined service (aka for the attached compose file, it would be 16 individual connection). The error I keep getting is the following, which service is failing is usually not repeating (in this example
Information about my server: Information about my workstation: @ndeloof I originally tested it with v2.17.3, updated today to v2.18.1 and it is unfortunately still happening. Edit 1: Edit 2: |
I have not been able to look further into this until now.
This is caused by the trottling feature in OpenSSH (https://man.openbsd.org/sshd_config#MaxStartups) By increasing |
The ssh's MaxStartups default config value (i.e. allow up to 10 concurrent unauthenticated ssh connections, and then randomly close any extra ones until there are 100 concurrent attempts, at which point hard reject the extra ones) thing should honestly be mentioned in I'm pasting my specific cli error, so that google may index it and the next person looking for it doesn't spend hours to find it:
|
Docker Compose by nature runs multiple docker API calls concurrently and can indeed quickly reach the ssh limits. |
Thanks for explaining this. Do you know whether it would be possible for Docker Compose to respect the |
Have you tried enabling ssh multiplexing on your client? his would allow see #8191 (comment) for context |
I tried to re-enable ssh multiplexing automatically enabled by docker CLI, but my PR fails for some non-obvious reason. Will need to wait for more eyes to help diagnose this :) |
@ndeloof I just tried with multiplexing enabled in my ssh config towards one of my docker nodes.
Note: compared to the example from ssh multiplexing, I changed the path to
Correction 2: I was too quick to jump to conclusions, I hadn't switched the context. https://gist.github.com/husjon/0d6aff7e726073dc00259ef39b3d9907#file-docker-compose-yaml |
I reverted the /etc/sshd_config::MaxStartups config change, and enabled ssh multiplexing using the .ssh/config snippet that husjon mentioned, and I can confirm that enabling ssh multiplexing for my "remote" docker machine "ssh hosts" works. As an added bonus: the Bottom line is that the PR that you proposed is not only fixing the problem, but also makes things run in a more proper way (because one could argue that "spamming a remote sshd with logins" is not entirely proper due to resemblance to a minor ddos attack). Have a good day. |
I'd like to add that the multiplexing trick does not work on Windows since its OpenSSH implementation does not support the feature. Windows users can therefore only resort to the Since switching to SSH authentication from certificates (RIP RancherOS), I noticed a substantial slowdown in all docker commands (both direct CLI and compose) including server-side SSH logs like Is there a Docker-side code change that can resolve the situation? If so, can we expect to find it soon in an upcoming release? (maybe after #11165 is also fixed) |
Description
Trying to "down" a compose over ssh will fail
It needs to be two or more services inside the compose (one services works)
Similar issue here : #9185
Steps To Reproduce
1: docker-compose.yml
2: Run services, then stop
docker-compose -H ssh://USER@remote up -d && docker-compose -H ssh://USER@remote down
3: An error occurs
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: