title: AWS Codecommit - fatal: unable to access : The requested URL returned error: 403
body: <p>I was able to pull and/or push updated from my AWS CodeCommit repository until I reinstalled <code>aws-cli</code>.
  I tried all the suggested solutions I could find but nothing seems to work.</p>
  <p>I am working on Ubuntu 21.10 and installed:</p>
  <pre><code>$ aws --v
    aws-cli/1.19.1 Python/3.9.7 Linux/5.13.0-41-generic botocore/1.20.0
  </code></pre>
  <p><code>git version 2.32.0</code></p>
  <p>The error I am getting is:</p>
  <pre><code>fatal: unable to access 'https://git-codecommit.eu-west-2.amazonaws.com/v1/repos/myrepo/': The requested URL returned error: 403
  </code></pre>
  <p>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.</p>
  <p>The aws credential helper is set as recommended by most solutions online. More specifically my <code>.gitconfig</code> file looks like this:</p>
  <pre><code>[user]
      name = My_name
      email = My_email
  [credential]
      helper = !aws codecommit credential-helper $@
      UseHttpPath = true
  
  </code></pre>
  <p>Additionally, I set up correctly (with the correct region) the <code>$ aws configure</code> configuration.</p>
  <p>Listing <code>$ git config --list --show-origin</code> I am getting:</p>
  <pre><code>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
  </code></pre>
  <p>Honestly I have no idea what else to try, any help would be appreciated!</p>
  <p><strong>EDIT:</strong>
  The way I resolved the issue is:</p>
  <ul>
  <li>Uninstalled aws client from my system and re installed and configured it from scratch.</li>
  <li>I cloned my IAM account and gave it Full AWSCodeCommit access.</li>
  </ul>
  <p>I am not sure what was the part that solved it, probably the first step.</p>