Why do I keep getting a "Repository authentication failed, check credentials. Make sure the user has both read and write access" error message when I create a branch in studio signed in as system admin?

5vetlana
Tera Contributor

I am working on the NeedIt tutorial in the New to Service Now trainings.   Although I was able to do the previous steps I am unable to create a branch in the studio.   The instructions say:

Create a Branch from a Tag

  1. In Studio, open the Source Control menu and select the Create Branch menu item.
  2. Configure the Branch.               Branch Name CreateNeedItApp               Create from Tag: LoadForCreateNIAppModule
  3. Click the Create Branch button.
  4. Click the Close Dialog button.
  5. After the branch is created, the branch name appears in the Studio status bar (bottom right corner).The branch name appears in the status bar on the lower right corner

When I try to run this in studio it fails with the error message "Repository authentication failed, check credentials. Make sure the user has both read and write access'   I have tried to sign in as various users that have read and write access but can't get it to work.   Can anyone tell me what I'm doing wrong?

71 REPLIES 71

Thank you Scott, 
This is the correct solution. Please follow these steps. 

Blessing1
Kilo Explorer

What worked for me is that I deleted the forked file from my GitHub repository, forked it back again and then it worked.

Akshay Verneka1
Kilo Explorer

Create a profile token if Github 2-factor authentication is already configured and enabled. It worked for us, after generating new token and adding the generated token in credentials password field. Hope this might be helpful

JohnEye
Kilo Contributor

It seems that there's some legacy code on the ServiceNow backend because it cannot accept the new keys generated by OpenSSH which start with "-----BEGIN OPENSSH PRIVATE KEY-----". Instead it expects an old format of key starting with "-----BEGIN RSA PRIVATE KEY-----". It may also not work with the Ed25519 algorithm.

 

The solution is to convert the key like this:

ssh-keygen -p -f file -m pem -P passphrase -N passphrase

If you have no passphrase, just enter empty quotes ("") instead of the passphrase. Insert the edited key into the Credential and try to connect to Git again.

JTGrosjean
Tera Contributor

I was able to use 2FA. The issue was that spaces were included when copying the password from Git in to LastPass. I did also delete the fork and re-add it, as I had enabled 2FA after creating the original fork.