Skip to content

Issues communicating with the agent: accept: Too many connections #65

@fholzer

Description

@fholzer

Recently we (my colleagues and I) started seeing issues with the agent when starting lots of ssh connections in a small period of time, e.g. when running Ansible on lots of servers. This manifests and authentication errors shown in the Ansible output. We use Pageant on our Windows machines, then ssh-pageant in cygwin. Drilling deeper into this I started ssh-pageant in one shell in debug mode, and set the env variable SSH_AUTH_SOCKET to the path of this agent in another shell. In this other shell I connect to our automation server (with agent forwarding) and from there I ran Ansible. I observed the same issues, but this time I saw that ssh-pageant running in debug mode outputs a lot of errors:

ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections
ssh-pageant: accept: Too many connections

Searching for this I found this: https://github.com/cuviper/ssh-pageant/blob/master/main.c#L246
But I am not sure what we can do to remedy this situation.

Edit: Just to clarify, even with this debug setup where I am running ssh-pageant in a different shell than where I am actually using the socket from... some connection from Ansible are successful, some are not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions