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

Linux /tmp directory mounted noexec breaks git clone

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins ver. 2.107.1
      git-plugin 2.7.1
      kubernetes-plugin 1.4

      When I try to build something I always got this error:

       > git fetch --no-tags --progress git@bitbucket.org:xxxxxx/xxxxx.git +refs/heads/*:refs/remotes/origin/*
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException: Command "git fetch --no-tags --progress git@bitbucket.org:xxxxxx/xxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
      stdout: 
      stderr: fatal: cannot exec '/home/jenkins/workspace/service-skeleton_master-7JMZPV5GKPYJ7FXGSQK6YYEOA6VIRJOEPUFA5ATSGLP5FPZSOMBA@tmp/ssh6122672630332030715.sh': Permission denied
      fatal: unable to fork
      
      

      It seems to look like what's described in Git plugin wiki: https://plugins.jenkins.io/git-client

       

      I just connected to my slave to check folder rights and everything belongs to the "jenkins" user... so I don't understand what is the problem.

       

      May it be a problem from Kubernetes?

       

      I'm looking for a solution for 2 days... But still blocked with this issue. Could you help me please? Thanks.

       

      NB: I've already ask help on IRC but no concluent solution

      PS: Additionnal info in comments

          [JENKINS-50471] Linux /tmp directory mounted noexec breaks git clone

          Thomas Ramé created issue -

          Thomas Ramé added a comment - - edited

          When executing the command "mount" I can see this line:

          /dev/sda1 on /home/jenkins type ext4 (rw,nosuid,nodev,noexec,relatime,commit=30,data=ordered)

           

          It could be the origin of the issue because of the "noexec". How can I fix this simply since I'm not managing slave creation (due to Kubernetes plugin) please?

           

          And even if I could fix that by overriding this mount or whatever... it seems strange this is not working from basic configuration of Kubernetes plugin, no?

          Thomas Ramé added a comment - - edited When executing the command "mount" I can see this line: /dev/sda1 on /home/jenkins type ext4 (rw,nosuid,nodev,noexec,relatime,commit=30,data=ordered)   It could be the origin of the issue because of the "noexec". How can I fix this simply since I'm not managing slave creation (due to Kubernetes plugin) please?   And even if I could fix that by overriding this mount or whatever... it seems strange this is not working from basic configuration of Kubernetes plugin, no?
          Thomas Ramé made changes -
          Description Original: When I try to build something I always got this error:
          {code:java}
           > git fetch --no-tags --progress git@bitbucket.org:xxxxxx/xxxxx.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error cloning remote repo 'origin'
          hudson.plugins.git.GitException: Command "git fetch --no-tags --progress git@bitbucket.org:xxxxxx/xxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: fatal: cannot exec '/home/jenkins/workspace/service-skeleton_master-7JMZPV5GKPYJ7FXGSQK6YYEOA6VIRJOEPUFA5ATSGLP5FPZSOMBA@tmp/ssh6122672630332030715.sh': Permission denied
          fatal: unable to fork

          {code}
          It seems to look like what's described in Git plugin wiki: [https://plugins.jenkins.io/git-client]

           

          I just connected to my slave to check folder rights and everything belongs to the "jenkins" user... so I don't understand what is the problem.

           

          May it be a problem from Kubernetes?

           

          I'm looking for a solution for 2 days... But still blocked with this issue. Could you help me please? Thanks.

           

          NB: I've already ask help on IRC but no concluent solution :(
          New: When I try to build something I always got this error:
          {code:java}
           > git fetch --no-tags --progress git@bitbucket.org:xxxxxx/xxxxx.git +refs/heads/*:refs/remotes/origin/*
          ERROR: Error cloning remote repo 'origin'
          hudson.plugins.git.GitException: Command "git fetch --no-tags --progress git@bitbucket.org:xxxxxx/xxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
          stdout:
          stderr: fatal: cannot exec '/home/jenkins/workspace/service-skeleton_master-7JMZPV5GKPYJ7FXGSQK6YYEOA6VIRJOEPUFA5ATSGLP5FPZSOMBA@tmp/ssh6122672630332030715.sh': Permission denied
          fatal: unable to fork

          {code}
          It seems to look like what's described in Git plugin wiki: [https://plugins.jenkins.io/git-client]

           

          I just connected to my slave to check folder rights and everything belongs to the "jenkins" user... so I don't understand what is the problem.

           

          May it be a problem from Kubernetes?

           

          I'm looking for a solution for 2 days... But still blocked with this issue. Could you help me please? Thanks.

           

          NB: I've already ask help on IRC but no concluent solution :(

          PS: Additionnal info in comments

          Mark Waite added a comment - - edited

          The kubernetes plugin does not control the mount options of the temp folder. I think you'll need to work with your administrators to change the cluster configuration.

          Another alternative is to use the JGit provider from the git plugin instead of command line git.

          See the CloudBees article for more details.

          Mark Waite added a comment - - edited The kubernetes plugin does not control the mount options of the temp folder. I think you'll need to work with your administrators to change the cluster configuration. Another alternative is to use the JGit provider from the git plugin instead of command line git. See the CloudBees article for more details.
          Mark Waite made changes -
          Link New: This issue is related to JENKINS-26993 [ JENKINS-26993 ]
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Summary Original: Insufficient permissions on the temp .sh file would make git commands fail with a stacktrace similar to the following New: Linux /tmp directory mounted noexec fails git clone

          Thomas Ramé added a comment - - edited

          markewaite I saw this article few hours ago but they are some problems:

          • They are already with a 755 chmod. It doesn't work due to the mount having the parameter "noexec"
          • And even if I remount partition be myself, my jenkins-slave are temporary due kubernetes plugin so I'm looking for a automatic way to do that. I guess I need to modify a setting in pod deployment YAML but I don't see at this moment where should I do that

           

          If you have some ideas/indications, don't hesitate to give them

           

          Thanks

          Thomas Ramé added a comment - - edited markewaite  I saw this article few hours ago but they are some problems: They are already with a 755 chmod. It doesn't work due to the mount having the parameter "noexec" And even if I remount partition be myself, my jenkins-slave are temporary due kubernetes plugin so I'm looking for a automatic way to do that. I guess I need to modify a setting in pod deployment YAML but I don't see at this moment where should I do that   If you have some ideas/indications, don't hesitate to give them   Thanks
          Mark Waite made changes -
          Summary Original: Linux /tmp directory mounted noexec fails git clone New: Linux /tmp directory mounted noexec breaks git clone

          Mark Waite added a comment -

          sneko use JGit. The Jenkins git plugin includes support for command line git (default) and for JGit (needs to be enabled in the Jenkins global configuration by adding JGit as an option). Once you've enabled JGit globally in Jenkins, a pick list will appear in the job definition to allow you to choose the git implementation.

          Mark Waite added a comment - sneko use JGit. The Jenkins git plugin includes support for command line git (default) and for JGit (needs to be enabled in the Jenkins global configuration by adding JGit as an option). Once you've enabled JGit globally in Jenkins, a pick list will appear in the job definition to allow you to choose the git implementation.

            Unassigned Unassigned
            sneko Thomas Ramé
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: