Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Git authentication problems

Anton Gustafsson August 26, 2018

I recently started using Bitbucket together with the Git bash terminal on Windows. On my first time using it, I was promted to enter my email and password. Said and done and it worked perfectly fine for about a month. Now however, I have to enter my password every single time I want to connect and do something on a remote repository. I have tried clearing my Git credentials in the Windows credential manager, reinstalled git, tried other git clients such as Source tree and Team explorer (inside Visual studio) but non seems to fix my issue. As I use a pw manager, my pw is very long and difficult to type so everytime I need to login, I need to enter this awkward password. 

 

I have searched and found out that people have had this issue before and that it could be alleviated my disabling https, but I don't wanna do that. Surely there must be something else to do than reinstall Windows?

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 27, 2018

Hi Anton, welcome to the Community :)

We've seen some cases where the issue has been resolved by uninstalling git and installing again without credentials manager.

If that doesn't solve the issue, we'll need to find out why your credentials are not being cached correctly, I recommend adding the following environment variables:

setx GIT_TRACE %userprofile%\git.log
setx GCM_TRACE %userprofile%\git.log

That'll log Git and Git Credential Manager events to the file at %userprofile%\git.log. We'll then be able to see the contents of that file and help you parse it for meaningful entries which help explain what is happening.

 

Let us know how it goes!

Ana 

Anton Gustafsson August 27, 2018

Remove

Anton Gustafsson August 27, 2018

Remove

Anton Gustafsson August 27, 2018

Remove

Anton Gustafsson August 27, 2018

Hi I have been trying to write a reply three times but they keep disappearing...

 

This is my log:

 

12:05:49.517421 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:05:49.798973 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:05:49.798973 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:05:59.943041 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:05:59.943041 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:06:01.010199 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:01.012194 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:06:04.456675 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:04.456675 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:06:04.970772 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:04.971772 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:06:05.552350 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:05.553350 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:06:28.038508 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:28.040505 git.c:415 trace: built-in: git add .
12:06:28.128235 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:28.129232 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:06:33.229780 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:33.231776 git.c:415 trace: built-in: git commit -mupdated
12:06:33.299772 run-command.c:637 trace: run_command: git gc --auto
12:06:33.316734 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:06:33.319717 git.c:415 trace: built-in: git gc --auto
12:06:33.397509 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:33.398506 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
12:06:41.596961 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:41.598979 git.c:415 trace: built-in: git push origin DELETETHISBRANCH
12:06:41.604964 run-command.c:637 trace: run_command: GIT_DIR=.git git remote-https origin https:REPO_URL.git
12:06:41.619907 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:06:41.621894 git.c:654 trace: exec: git-remote-https origin https:REPO_URL.git
12:06:41.621894 run-command.c:637 trace: run_command: git-remote-https origin https:REPO_URL.git
12:06:41.638881 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:06:42.606562 run-command.c:637 trace: run_command: 'git credential-manager get'
12:06:42.649389 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:06:42.651385 git.c:654 trace: exec: git-credential-manager get
12:06:42.651385 run-command.c:637 trace: run_command: git-credential-manager get
12:06:42.717279 ...\Common.cs:665 trace: [Main] git-credential-manager (v1.16.2) 'get'
12:06:42.773164 ...\Git\Where.cs:343 trace: [FindGitInstallations] found 1 Git installation(s).
12:06:42.777119 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 38 entries.
12:06:42.806074 ...\Common.cs:84 trace: [CreateAuthentication] detecting authority type for 'https:MYNAME@bitbucket.org'.
12:06:42.818010 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:06:42.818010 ...\Common.cs:173 trace: [CreateAuthentication] authority for 'https:MYNAME@bitbucket.org' is Bitbucket
12:06:42.825989 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://MYNAME@bitbucket.org' read from store.
12:06:42.825989 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
12:06:42.831973 ...\Authority.cs:214 trace: [ValidateCredentials] authentication type = 'Credential'.
12:06:45.074060 ...\Git\Trace.cs:139 trace: [WriteException] ! error: 'An error occurred while sending the request.'.
12:06:45.074060 ...\Git\Trace.cs:143 trace: [WriteException] > 'The underlying connection was closed: The connection was closed unexpectedly.'.
12:06:45.088035 ...\Common.cs:630 trace: [LogEvent] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Authentication.Network.<HttpGetAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Rest.RestClient.<TryGetUser>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Authority.<ValidateCredentials>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Authority.<ValidateCredentials>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Authentication.<ValidateCredentials>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<QueryCredentials>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<>c__DisplayClass23_1.<<Get>b__0>d.MoveNext()
12:06:45.090051 ...\Program.cs:578 trace: [Run] fatal: HttpRequestException encountered.
An error occurred while sending the request.
12:06:45.129826 run-command.c:637 trace: run_command: 'C:/Program Files/Git/mingw64/libexec/git-core/git-gui--askpass' 'Password for '\''https://MYNAME@bitbucket.org'\'': '
12:06:50.226966 run-command.c:637 trace: run_command: 'git credential-manager store'
12:06:50.274880 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:06:50.276874 git.c:654 trace: exec: git-credential-manager store
12:06:50.276874 run-command.c:637 trace: run_command: git-credential-manager store
12:06:50.344732 ...\Common.cs:665 trace: [Main] git-credential-manager (v1.16.2) 'store'
12:06:50.402575 ...\Git\Where.cs:343 trace: [FindGitInstallations] found 1 Git installation(s).
12:06:50.407525 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 38 entries.
12:06:50.421487 ...\Common.cs:84 trace: [CreateAuthentication] detecting authority type for 'https:MYNAME@bitbucket.org'.
12:06:50.433455 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:06:50.433455 ...\Common.cs:173 trace: [CreateAuthentication] authority for 'https:MYNAME@bitbucket.org' is Bitbucket
12:06:50.433455 ...\Program.cs:493 trace: [Store] storing Bitbucket credentials for 'https:MYNAME@bitbucket.org'.
12:06:50.441434 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://MYNAME@bitbucket.org' read from store.
12:06:50.442432 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
12:06:50.444426 ...uthentication.cs:258 trace: [SetCredentials] MYNAME at https:MYNAME@bitbucket.org
12:06:50.451410 ...seSecureStore.cs:286 trace: [WriteCredential] credentials for 'git:https://MYNAME@bitbucket.org' written to store.
12:06:50.478040 run-command.c:637 trace: run_command: git send-pack --stateless-rpc --helper-status --thin --progress https:REPO_URL.git/ --stdin
12:06:50.492221 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:06:50.494216 git.c:415 trace: built-in: git send-pack --stateless-rpc --helper-status --thin --progress https:REPO_URL.git/ --stdin
12:06:50.501197 run-command.c:637 trace: run_command: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
12:06:50.517016 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:06:50.519010 git.c:415 trace: built-in: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
12:06:52.177393 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:06:52.178391 git.c:415 trace: built-in: git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events