I was able to pull and/or push updated from my AWS CodeCommit repository until I reinstalled aws-cli.
I tried all the suggested solutions I could find but nothing seems to work.
I am working on Ubuntu 21.10 and installed:
$ aws --v
aws-cli/1.19.1 Python/3.9.7 Linux/5.13.0-41-generic botocore/1.20.0
git version 2.32.0
The error I am getting is:
fatal: unable to access 'https://git-codecommit.eu-west-2.amazonaws.com/v1/repos/myrepo/': The requested URL returned error: 403
It used to ask me for my username and password, but after my experiments to solve the issue it stopped asking for my credentials completely. Either way I confirmed that I was using the correct credentials. Also, I do have the necessary permissions at AWS. I was successfully pulling and pushing updates until a few hours ago.
The aws credential helper is set as recommended by most solutions online. More specifically my .gitconfig file looks like this:
[user]
name = My_name
email = My_email
[credential]
helper = !aws codecommit credential-helper $@
UseHttpPath = true
Additionally, I set up correctly (with the correct region) the $ aws configure configuration.
Listing $ git config --list --show-origin I am getting:
file:/etc/gitconfig user.email=My_email
file:/home/f_user/.gitconfig user.name=My_name
file:/home/f_user/.gitconfig user.email=My_email
file:/home/f_user/.gitconfig credential.helper=!aws codecommit credential-helper $@
file:/home/f_user/.gitconfig credential.usehttppath=true
Honestly I have no idea what else to try, any help would be appreciated!
EDIT: The way I resolved the issue is:
I am not sure what was the part that solved it, probably the first step.
If you're using Mac go to keychain access, look up codecommit and delete the stored key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With