Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35336

SSH agent not starting because file not created

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: ssh-agent-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      *Enviroment: *
      Ubuntu 14.04.2 LTS
      Jenkins 2.7 running under Nginx
      ssh-agent 1.10

      Logs
      ```Started by user Ezequiel Golub
      Changing BUILD_ID variable (job build time) with the date pattern yyyy-MM-dd_HH-mm-ss.
      Changing BUILD_ID variable (job build time) with the date pattern yyyy-MM-dd_HH-mm-ss.
      Published SNS notification: subject=Build STARTED: build-environment #6950 topic=arn:aws:sns:us-east-1:139903529341:jenkins-production-infrastructure
      [EnvInject] - Loading node environment variables.
      Changing BUILD_ID variable (job build time) with the date pattern yyyy-MM-dd_HH-mm-ss.
      Building on masterChanging BUILD_ID variable (job build time) with the date pattern yyyy-MM-dd_HH-mm-ss.
      in workspace /home/deploy/environments
      [ssh-agent] Looking for ssh-agent implementation...
      [ssh-agent] Java/JNR ssh-agent
      [ssh-agent] FATAL: Could not find a suitable ssh-agent provider
      [ssh-agent] Diagnostic report
      [ssh-agent] * Java/JNR ssh-agent
      [ssh-agent] java.io.IOException: No such file or directory
      [ssh-agent] at java.io.UnixFileSystem.createFileExclusively(Native Method)
      [ssh-agent] at java.io.File.createNewFile(File.java:1006)
      [ssh-agent] at java.io.File.createTempFile(File.java:1989)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.jna.AgentServer.createLocalSocketAddress(AgentServer.java:142)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.jna.AgentServer.start(AgentServer.java:78)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.<init>(JNRRemoteAgent.java:70)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgentStarter.call(JNRRemoteAgentStarter.java:68)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgentStarter.call(JNRRemoteAgentStarter.java:39)
      [ssh-agent] at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgentFactory.start(JNRRemoteAgentFactory.java:62)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.<init>(SSHAgentBuildWrapper.java:360)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.createSSHAgentEnvironment(SSHAgentBuildWrapper.java:248)
      [ssh-agent] at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.preCheckout(SSHAgentBuildWrapper.java:225)
      [ssh-agent] at jenkins.scm.SCMCheckoutStrategy.preCheckout(SCMCheckoutStrategy.java:76)
      [ssh-agent] at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
      [ssh-agent] at hudson.model.Run.execute(Run.java:1738)
      [ssh-agent] at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      [ssh-agent] at hudson.model.ResourceController.execute(ResourceController.java:98)
      [ssh-agent] at hudson.model.Executor.run(Executor.java:410)
      FATAL: [ssh-agent] Unable to start agent
      hudson.util.IOException2: [ssh-agent] Unable to start agent
      at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.createSSHAgentEnvironment(SSHAgentBuildWrapper.java:255)
      at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.preCheckout(SSHAgentBuildWrapper.java:225)
      at jenkins.scm.SCMCheckoutStrategy.preCheckout(SCMCheckoutStrategy.java:76)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Caused by: java.lang.RuntimeException: [ssh-agent] Could not find a suitable ssh-agent provider.
      at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.<init>(SSHAgentBuildWrapper.java:378)
      at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.createSSHAgentEnvironment(SSHAgentBuildWrapper.java:248)
      ... 7 more
      Changing BUILD_ID variable (job build time) with the date pattern yyyy-MM-dd_HH-mm-ss.
      Changing BUILD_ID variable (job build time) with the date pattern yyyy-MM-dd_HH-mm-ss.
      Published SNS notification: subject=Build FAILURE: build-environment #6950 topic=arn:aws:sns:us-east-1:139903529341:jenkins-production-infrastructure
      Changing BUILD_ID variable (job build time) with the date pattern yyyy-MM-dd_HH-mm-ss.
      Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
      Finished: FAILURE```

      Analysis
      My best guess is that it's trying to create a file in `AgentServer.java:142`, but it's generating and invalid path. I tried chmod 777 on it's workspace, just to be sure, and it didn't help.
      We were upgrading from ssh-agent 1.5 to 1.10, didn't work, ended up downgrading to 1.9 to avoid this issue.
      I'm not a java guy, but i'll be happy to provide any other information needed to fix this.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ezegolub ezequiel golub
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: