Details
-
Bug
-
Resolution: Obsolete
-
Highest
Description
i have pipeline in jenkins and use git plugin to clone repository, As of lately i found a lot same error.
1: 403 Forbidden Permission
We use "jenkins-autodeployment" account for accessing git repos. This account is a member admin group on BitBucket. admin is granted permission to access all git repos of corporation . So by right, "jenkins-autodeployment" account should have access to all bitbucket but somehow we get 403 forbidden access for this account sometimes. We notice that this problem occurs more often lately. By adding "jenkins-autodeployment" account manually to git repo, we solve this 403 forbidden access problem.
2: fatal: The remote end hung up unexpectedly
For all the cases reported, beside the 403 problem, they are all caused by the remote server end hung up unexpectedly. In this case it is BitBucket terminates connection for some unknown reason. We notice that by disable git shallow fetch ( --depth=1 ), the problem does not occur anymore.
Please kindly support and investigate this case because now blocking developer to work
Configure Jenkins
checkout([ $class: 'GitSCM', branches: [[name: "*/master"]], doGenerateSubmoduleConfigurations: false, extensions: [[ $class: 'CloneOption', depth: 1, noTags: true, reference: '', shallow: false ]], submoduleCfg: [], userRemoteConfigs: [[ credentialsId: bitbucket-credential, url: git_openshift_configuration ]]
Jenkins log
using credential bitbucket-credential Cloning the remote Git repository Avoid fetching tags Cloning repository https://bitbucket.org/xxxxxx/app-configs.git > git init /home/jenkins/workspace/update-config # timeout=10 Fetching upstream changes from https://bitbucket.org/xxxxxx/app-configs.git > git --version # timeout=10 using GIT_ASKPASS to set credentials > git fetch --no-tags --progress https://bitbucket.org/xxxxxx/app-configs.git +refs/heads/*:refs/remotes/origin/* # timeout=10 ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git fetch --no-tags --progress https://bitbucket.org/xxxxxx/app-configs.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: error: RPC failed; result=22, HTTP code = 403 fatal: The remote end hung up unexpectedly