1

I have problems cloning repositories over HTTP in Jenkins. The problem only occurs for repositories with over 12 branches, or with a total of 18 branches and tags.

Running the following command: git clone http://USERNAME:PASSWORD@bitbucket.company.org/scm/key/repo.git

The cloning works perfectly fine when there is 11 branches, or a total of 17 branches and tags. When it is above that number the cloning fails with the following error:

error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 
fatal: The remote end hung up unexpectedly

Bitbucket is running with loglevel DEBUG, and I couldn't find any more information in the logs.

Versions on server:

Bitbucket Server 5.14.0 Git 2.19.0

Versions locally:

Git 2.17.1

PS: I am not running Bitbucket behind a proxy.

I have checked the atlassian-bitbucket.log and it does show an error related to the cloning of the repository:

    The following was written to stderr:
    fatal: the remote end hung up unexpectedly
    com.atlassian.utils.process.ProcessException: Non-zero exit code: 1
    at com.atlassian.bitbucket.scm.SummarizingProcessHandler.complete(SummarizingProcessHandler.java:47)
    ...

I have tried to set the postBuffer: git config --global http.postBuffer 524288000

I have tried to clone with Username and Password as input, and it still fails on more than 12 branches: git clone http://bitbucket.company.org/scm/key/repo.git

The size of the repository does not matter as I am able to clone large repos with fewer branches.

It does work if I use SSH, but this is not an option for my use case. Since we have one release branch per release, and the number of tags do grow over time I would expect this to be a problem for other people as well.

As I am trying to clone in a Jenkins pipeline I have tried the following configuration to get more than just the shallow clone.

checkout([
  $class: 'GitSCM',
  branches: scm.branches,
  extensions: [
    [
      $class: 'CloneOption',
      honorRefspec: false,
      noTags: false,
      shallow: false,
    ]
  ],
  userRemoteConfigs: scm.userRemoteConfigs,
])

I would expect it to be able to clone the repositories no matter the number of branches. Does anyone have any idea on why this happens? Any help would be greatly accepted.

  • See https://stackoverflow.com/questions/44780221/git-push-failing-http-500-curl-22-the-requested-url-returned-error-500-internal – alex Sep 12 '19 at 14:50
  • Unfortunatley I have already tried this. I have also tried to push to the repo after cloning with ssh and reconfiguring the remote to use basic auth and this works, but pull/fetch/clone does not. – Jesper Nylend Sep 13 '19 at 06:35
  • sounds like a server side issue. try to find a correlating messages on the server side. – Yuri G. Sep 18 '19 at 17:03
  • Hmm, all I find are the same error message as I put in the question. However I am wondering if it has something to do with it being on HTTP and not HTTPS? This is basic auth after all. – Jesper Nylend Sep 19 '19 at 06:48

1 Answers1

0

have you tried the regular git step inside a with credentials step?

Holleoman
  • 261
  • 1
  • 7
  • 1
    Yes, and I have even tried to do this locally on my own machine as well. The same error occurs, so I am actually guessing that this is not an issue with Jenkins pipelines, but rather an issue with Bitbucket. – Jesper Nylend Oct 03 '19 at 12:33
  • Sounds like that. – Holleoman Oct 26 '19 at 17:02