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 vote

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

30,778 views 26 12
Join discussion

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