Git clone is taking a long time to complete
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
Platform Notice: Server, Data Center, and Cloud By Request - This article was written for the Atlassian server and data center platforms but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.
Problem
When running a git clone, it takes a long time to complete even if the repository is small.
There aren't errors in the application logs. In profiling logs, it shows that authentication takes a long time to complete:
2018-05-25 13:40:10,086 | http-nio-80-exec-7 | @5IZFEEx801x2949x0 | rmadalozzo | -
[86782ms] - "GET /scm/tes/repotest.git/info/refs HTTP/1.1"
[86751ms] - Authentication org.springframework.security.authentication.AuthenticationProvider.authenticate(Authentication)
[86735ms] - attemptAuthentication - com.atlassian.bitbucket.server.bitbucket-authentication:crowdHttpAuthHandler
[86735ms] - AuthenticationResult com.atlassian.stash.internal.user.CaptchaService.authenticateWithCaptcha(CaptchaTicket,UncheckedOperation)
[16ms] - Page com.atlassian.bitbucket.user.UserService.findGroupsByUser(String,PageRequest)
[31ms] - void com.atlassian.stash.internal.scm.git.protocol.http.HttpRefAdvertisement.handleRequest()
[31ms] - C:\Program Files\Git\cmd\git.exe upload-pack --advertise-refs --stateless-rpc E:\Atlassian\ApplicationData\Stash\shared\data\repositories\25
Cause
Check for the Follow referrals attribute in LDAP settings.
Resolution
Check to see from the LDAP settings if follow referrals attribute are enabled.
If it is, uncheck the Follow referrals LDAP attribute by going to Administration → User Directories → Edit → Advanced Settings → Follow Referrals.