Score:0

Jenkins cannot run ssh-agent, but local container can

gb flag

I'm trying to configure an SSH key on my Jenkins instance with the SSH Agent Plugin. Jenkins is using Kubernetes containers as workers. My worker container image is alpine based, and just installs ansible and sshd. If I run a container locally, I am able to configure my keys and connect to my ssh servers with no issue.

If I try to configure ssh-agent through Jenkins, however, I get an error when trying to run anything related to ssh-agent:

mkdtemp: private socket dir: No such file or directory

I have tried running chmod 1777 /tmp but that has not helped. The container user is root (I know this is an issue, I am going to add a user once ssh works).

The JNLP container is able to SSH correctly, just my custom image cannot. So far it seems to be an odd permissions issue.

What could be causing Jenkins to have this error when the local image has no such problem?

Iñigo Moreno avatar
tr flag
Did you ever fix this? Having a similar issue
jackwise avatar
gb flag
@IñigoMoreno Unfortunately I didn't, I ended up using EC2 workers instead of k8s since that was more straightforward to get running.
Iñigo Moreno avatar
tr flag
In my case it ended up being an issue with the TMPDIR env variable being set to a non-existing directory.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.