5

I've been using AWS CodeCommit for a while but currently having the following issue, have no idea what was the reason why it appeared:

  1. After trying to run any git command, I get a dialog box, as I have removed git-credential-osxkeychain from the Keychain Access Control list. Pressing "Deny" (if not doing so, I get 403 immediately).

  2. After pressing "Deny" it gives me

    'NoneType' object has no attribute 'secret_key'
    
  3. Then it asks me for Username and Password

    Username for 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/somerepo': username
    Password for 'https://[email protected]/v1/repos/somerepo':
    
  4. After providing correct credentials here, I get an 403 error

    fatal: unable to access 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/somerepo/': The requested URL returned error: 403
    

I've already tried to reinstall and reset both AWS CLI and Git credentials, have double-checked for possible solutions here and also here, followed all the instructions, but nothing helped.

Please help me with some possible solution. Let me know if any additional information is needed. Thanks!

4
  • It means access denied. Are you sure you still have access? Commented Jan 29, 2019 at 7:07
  • Yes, I can access CodeCommit from the browser as usual. Commented Jan 29, 2019 at 7:11
  • Does git config --list --show-origin provide any useful information? Commented Jan 29, 2019 at 7:18
  • It looks like my issue is solved. I have reinstalled git entirely, and reset all the configurations. Not sure what exactly, but probably there was something wrong in my git configurations. Anyway, thank you for your help! Commented Jan 29, 2019 at 7:29

3 Answers 3

1

Refer https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html

Step 1: Initial configuration for CodeCommit

Step 2: Install Git

Step 3: Create Git credentials for HTTPS connections to CodeCommit

Step 4: Connect to the CodeCommit console and clone the repository

Steps 1 and 2 are common, but you may not be aware about step 3.

  1. Go to the AWS console
  2. Go to the IAM user that you are using to access codecommit from the CLI and generate username and password. (The URL looks like https://console.aws.amazon.com/iam/home?region=us-west-2#/users/\<userName>)
  3. Then use this username and password when prompted on the terminal.
Sign up to request clarification or add additional context in comments.

Comments

1

Answered here, this can be caused by incorrect characters in your ~/.aws/credentials file.

Comments

-1

export AWS_ACCESS_KEY_ID and AWS_ACCESS_SECRET_KEY as environment values solved my issue. I obtained these values creating an IAM Role with AWSElasticBeanstalkFullAccess & AWSCodeCommitFullAccess.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.