• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ssh-agent-plugin
    • Jenkins 2.121.3
      ss-agent-plugin 1.15

      Random error `Text file busy` when using ssh-agent

       

      [Pipeline] {
      [Pipeline] withCredentials
      [Pipeline] {
      [Pipeline] sshagent
      [ssh-agent] Using credentials APP_SSH_KEY
      [ssh-agent] Looking for ssh-agent implementation...
      [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine)
      $ ssh-agent
      SSH_AUTH_SOCK=/tmp/ssh-QWEfM28796/agent.28796
      SSH_AGENT_PID=28800
      $ ssh-add /jenkins/workspace/myjob@tmp/private_key_1395343975081553490.key
      Identity added: /jenkins/workspace/myjob@tmp/private_key_1395343975081553490.key (/jenkins/workspace/myjob@tmp/private_key_1395343975081553490.key)
      $ ssh-add /jenkins/workspace/myjob@tmp/private_key_503513565487944952.key
      ssh_askpass: exec(/jenkins/workspace/myjob@tmp/askpass_1445148365080710750.sh): Text file busy [Pipeline] // sshagent [Pipeline] }
      [Pipeline] // withCredentials
      [Pipeline] }
      [Pipeline] // timestamps
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: Failed to run ssh-add
      
      

      Finished: FAILURE

          [JENKINS-53387] ssh-add - Text file busy

          Similar issue on Docker : https://github.com/moby/moby/issues/9547.

          Users recommend to use sync command after chmod action.

          phgr100x phgr100x added a comment - Similar issue on Docker : https://github.com/moby/moby/issues/9547. Users recommend to use sync command after chmod action.

          https://issues.jenkins-ci.org/browse/JENKINS-48258?focusedCommentId=324590&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-324590

          > The issue here appears to be caused by a Java bug, https://bugs.openjdk.java.net/browse/JDK-8068370. The issue is possible when multiple threads open a file for writing, close it, and then execute them (each thread using its own file). Even if all files are closed "properly", due to how file handles work around fork/exec, a child process in one thread may inherit the handle to anther thread's open file, and thus break that thread's later subprocess call.

          phgr100x phgr100x added a comment - https://issues.jenkins-ci.org/browse/JENKINS-48258?focusedCommentId=324590&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-324590 > The issue here appears to be caused by a Java bug,  https://bugs.openjdk.java.net/browse/JDK-8068370 . The issue is possible when multiple threads open a file for writing, close it, and then execute them (each thread using its own file). Even if all files are closed "properly", due to how file handles work around fork/exec, a child process in one thread may inherit the handle to anther thread's open file, and thus break that thread's later subprocess call.

            Unassigned Unassigned
            phgr100x phgr100x phgr100x
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: