2

I am trying to push code to the my remote branch. I get the below error logs.

Unhandled Exception: System.TypeInitializationException: The type
initializer for 'Microsoft.Alm.Cli.Program' threw an exception.
--->
System.Runtime.InteropServices.SEHException: External component has
thrown an exception.    
  at AzureDevOps.Authentication.TokenScope.op_BitwiseOr(TokenScope left, TokenScope right)    
  at Microsoft.Alm.Cli.Program..cctor()    
  --- End of inner exception stack trace ---    
at Microsoft.Alm.Cli.Program.Main(String[] args) 
  fatal: Authentication failed for
'https://dev.azure.com/ubplDevOps/ConnectrixCompanyAndroidApp/_git/ConnectrixCompanyAndroidApp/'

When I send the push command, a password popup opens up but when I enter my password it gives the above error. I can login to my account on web using the same password but it's not allowing me to push .

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84
  • Note that this has nothing to do with Git itself. It's some sort of Azure-specific authentication issue. – torek Jan 30 '20 at 07:19

1 Answers1

1

Check if, when you are cloning the Azure repository, you see the option "Generate Git Credentials", as seen here

Check also the remote URL used:

git config --get remote.<azure-remote-name>.url
# or simply
git remote -v

# check the URL referring to azure

If it has the project account in it, replace that URL with your Azure username (the one used when you login to your Azure account).


I was working on the same repository for around 2 months. Yesterday it started giving this error.

There are no recent Azure incidents, so try and change your password, to see if that reset has an influence on your current issue


The OP Vivek Mishra points in the comments to personal access tokens, which in the OP's case has expired.

Azure has some personal access token, that was expired for my user.
I regenerated that token and added and it started working

That was introduced in 2018, and does include an expiration date.

https://blog.devmatter.com/wp-content/uploads/2018/12/NewPATScreen-1024x649.png

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250