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

Error to connect bitbucket source code management to jenkins

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I'm trying to connect bitbucket to jenkins. All the public/private key is configured, firewall is configured, but I keep having this error:

      Failed to connect to repository : Command "git.exe ls-remote -h git@bitbucket.org:myrepo/myproject.git HEAD" returned status code 128: stdout: stderr: Load key "C:\\Windows\\TEMP
      ssh6081589915199893224.key": invalid format
       Permission denied (publickey). fatal: Could not read from remote repository.

      Please make sure you have the correct access rights and the repository exists.

      The credential is set to "Private Key" -> "Enter directly" -> "my key" and my passphrase is setted too.

      Why is jenkins trying to get the key from TEMP and not from .ssh inside jenkins' folder?

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          The git plugin uses the Jenkins credentials system.  The Jenkins credentials system does not rely on the agent (or the account which is running the agent) to have a correctly configured and maintained ~/.ssh/ configuration.  The plugin provides that configuration itself and writes it into temporary files which it maintains.

          You may want to try a private key without a passphrase, in case there is some issue in your entry of the passphrase for the private key.

          This is unlikely to be a bug in the git plugin.  I regularly use Bitbucket from Windows machines with passphrase protected private keys.

          Show
          markewaite Mark Waite added a comment - - edited The git plugin uses the Jenkins credentials system.  The Jenkins credentials system does not rely on the agent (or the account which is running the agent) to have a correctly configured and maintained ~/.ssh/ configuration.  The plugin provides that configuration itself and writes it into temporary files which it maintains. You may want to try a private key without a passphrase, in case there is some issue in your entry of the passphrase for the private key. This is unlikely to be a bug in the git plugin.  I regularly use Bitbucket from Windows machines with passphrase protected private keys.
          Hide
          lgmguto Luiz Gustavo Maia added a comment - - edited

          OK, I understood that, but I keep getting this error. 

          It says that is "invalid format". Need I put the id_rsa key or the id_rsa.pub key?

          Show
          lgmguto Luiz Gustavo Maia added a comment - - edited OK, I understood that, but I keep getting this error.  It says that is "invalid format". Need I put the id_rsa key or the id_rsa.pub key?
          Hide
          markewaite Mark Waite added a comment -

          You need to provide the private key.  The remote side has the public key.

          In general, we prefer that user questions be asked on the internet relay chat channel, or on the jenkins users mailing list, rather than using a bug report.  Many more people monitor the mailing lists and the IRC channel than monitor bugs against specific plugins.

          Show
          markewaite Mark Waite added a comment - You need to provide the private key.  The remote side has the public key. In general, we prefer that user questions be asked on the internet relay chat channel, or on the jenkins users mailing list, rather than using a bug report.  Many more people monitor the mailing lists and the IRC channel than monitor bugs against specific plugins.
          Hide
          lgmguto Luiz Gustavo Maia added a comment -

          OK, thank you Mark Waite!
          You can close this issue, I will use community channels to get help.

          Show
          lgmguto Luiz Gustavo Maia added a comment - OK, thank you Mark Waite ! You can close this issue, I will use community channels to get help.

            People

            • Assignee:
              Unassigned
              Reporter:
              lgmguto Luiz Gustavo Maia
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: