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

Missing openssh-client in alpine images

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • docker
    • None
    • Jenkins ver. 2.7.4
      kubernetes plugin v0.10
      kubernetes version 1.5.0

      1. We have:
      Jenkins ver. 2.7.4
      kubernetes plugin v0.10
      kubernetes version 1.5.0
      Checkout step over ssh doesn't work:

      2. Please check the below checkout code from pipeline

      ....
      checkout(
        scm: [
          $class: 'GitSCM',
          branches: [[name: "${GERRIT_BRANCH}"]],
          extensions: [
            [$class: 'CleanCheckout'],
            [$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']],
            [$class: 'WipeWorkspace']
          ],
          userRemoteConfigs: [[
            credentialsId: "ci-gerrit",
            name: 'gerrit',
            url: "ssh://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}.git",
            refspec: "${GERRIT_REFSPEC}"
          ]]
        ]
      )
      ....
      

      3. Checkout failed with error `ssh: not found`

      Wiping out workspace first.
      Cloning the remote Git repository
      Cloning repository ssh://gerrit@gerrit_host:29418/project.git
       > git init /home/jenkins/workspace//project # timeout=10
      Fetching upstream changes from ssh://gerrit@gerrit_host:29418/project.git
       > git --version # timeout=10
      using GIT_SSH to set credentials credentials for Jenkins to Gerrit ssh connectivity
      
       > git fetch --tags --progress ssh://gerrit@gerrit_host:29418/project.git +refs/heads/*:refs/remotes/gerrit/*
      ERROR: Error cloning remote repo 'gerrit'
      hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://gerrit@gerrit_host:29418/project.git +refs/heads/*:refs/remotes/gerrit/*" returned status code 128:
      stdout: 
      stderr: /tmp/ssh5702738799948889518.sh: line 6: ssh: not found
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights
      and the repository exists.
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1752)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1495)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:507)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:332)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at hudson.remoting.Engine$1$1.run(Engine.java:88)
      	at java.lang.Thread.run(Thread.java:745)
      	at ......remote call to kubernetes-8cd5b89b87c84a87b17fddc3652f1bd2-112fb0f32e8309(Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
      	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      	at hudson.remoting.Channel.call(Channel.java:781)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
      	at sun.reflect.GeneratedMethodAccessor368.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
      	at com.sun.proxy.$Proxy79.execute(Unknown Source)
      	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1042)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1082)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
      	at hudson.security.ACL.impersonate(ACL.java:213)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] echo
      Failed: hudson.AbortException
      

      Though build image has ssh installed and manual sh step works:

       sh 'ssh -v'
      
      # # + ssh -v
      usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
                 [-D [bind_address:]port] [-E log_file] [-e escape_char]
                 [-F configfile] [-I pkcs11] [-i identity_file]
                 [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]
                 [-O ctl_cmd] [-o option] [-p port]
                 [-Q cipher | cipher-auth | mac | kex | key]
                 [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
                 [-w local_tun[:remote_tun]] [user@]hostname [command]
      [Pipeline] }
      [Pipeline] // stage
      

      Probably there is some issue with PATH variable during checkouting

            csanchez Carlos Sanchez
            skulanov Sergey Kulanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: