Reputation: 401
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:
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).
After pressing "Deny" it gives me
'NoneType' object has no attribute 'secret_key'
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':
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!
Upvotes: 5
Views: 13278
Reputation: 51
Answered here, this can be caused by incorrect characters in your ~/.aws/credentials
file.
Upvotes: 1
Reputation: 5119
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.
Upvotes: 1
Reputation: 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.
Upvotes: -1