User lockout while doing parallel cloning or repositories

We are running multiple scripts from one user account to clone multiple repositories in parallel.

When we cloning 10 repos together, it's working fine. When we try cloning 15 repos together, it lock out stash user and gives below error.

Cloning 'xyz' mirror

Fetching 'xyz'

Cloning into bare repository '/lhome/abcd/tmp/xyz1'...

Cloning into bare repository '/lhome/abcd/tmp/xyz2'...

Cloning into bare repository '/lhome/abcd/tmp/xyz3'...

Cloning into bare repository '/lhome/abcd/tmp/xyz4'...

fatal: Authentication failed

We have integration with crowd for user authentication.

Thanks !!

1 answer

0 votes

This is caused by the way git authenticates over HTTP. For any request, git will do the following:

  • send a HTTP request (typically /scm/project-key/repo-slug/info/refs) without username/password. Stash will send back a 401 Unauthorized
  • send another HTTP request, this time with the username, but without a password. Stash will try to authenticate but will fail and increase the failed authentication count. Stash sends back another 401.
  • send another HTTP request, this time with username and password. Authentication will succeed and the failed authentication count will be set to 0.

In your case, I think the same user is trying clone multiple repositories in parallel and the 'failed authentication count' exceeds your configured CAPTCHA limit. 

There are a couple of ways to get around the problem:

  • switch to SSH. Authentication with an SSH key will never trigger CAPTCHA
  • increase the CAPTCHA limit
  • serialize the clone operations (don't start them in parallel)

 

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

434 views 6 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you