Skip to content

Instantly share code, notes, and snippets.

@ljayz
Last active July 13, 2024 16:08
Show Gist options
  • Save ljayz/9fa6721c13f2c2d6a8f772a1e4ef1a37 to your computer and use it in GitHub Desktop.
Save ljayz/9fa6721c13f2c2d6a8f772a1e4ef1a37 to your computer and use it in GitHub Desktop.
Fix aws codecommit unable to access repository (The requested URL returned error: 403) in windows
this was tested using windows10 pro
when cloning a git this error was produced
fatal: unable to access 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/RepositoryName': The requested URL returned error: 403
to fix add the following git configuration
git config --global credential.helper "!aws codecommit credential-helper $@"
git config --global credential.UseHttpPath true
check if git has system credential.helper by typing
git config --system -l
if it has remove it by typing
git config --system --unset credential.helper
@141293
Copy link

141293 commented Jun 17, 2020

I performed the above steps, still the issue persist.

@Dylan-Carriere
Copy link

I had the same isssue and the command git config --global credential.UseHttpPath true saved me !

@Desh-Deepak-Dhobi
Copy link

It worked for me,,Thanks

@neatDevNetizon
Copy link

First, check the HTTPS Git credentials for AWS CodeCommit in My Security Credentials!!!

@rodrilima
Copy link

git config --global credential.UseHttpPath true

Works ! Thanks

@nicholasklaene
Copy link

git config --system --unset credential.helper

Worked for me. Thanks

@bilalanwer24h
Copy link

check if git has system credential.helper by typing
git config --system -l
if it has remove it by typing
git config --system --unset credential.helper

Worked for me. Thanks

@Wanfai5
Copy link

Wanfai5 commented Feb 28, 2022

It worked for me but still couldn't clone repository same error 403, any help

@siddu6003
Copy link

tried all of these still doesn't work :(

@pascalarrey
Copy link

git config --global credential.UseHttpPath true

Thanks, this also worked for me

@jthebest
Copy link

git config --system --unset credential.helper

Worked for me. Thanks

git config --system --unset credential.helper

Worked for me. Thanks

Thanks

@Easy-Cloud-in
Copy link

git config --system --unset credential.helper

It worked for me, Thanks

@benwzj
Copy link

benwzj commented May 27, 2023

work for me as well! thanks

@anirbanchakrabort
Copy link

The following steps worked for me . Thanks

@jucapitanio
Copy link

I had similar errors on a Mac. It only worked after I deleted the entries for git-codecommit from keychain access.

@msarmad3
Copy link

msarmad3 commented Sep 2, 2023

For windows, if the problem still exists "fatal: unable to access 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/RepositoryName': The requested URL returned error: 403"
Try fixing your environment variables in windows. If the credentials are changed for clonning the repos, the environment is led with the old set of region and key values.

  1. Search for "edit system environment variables"
  2. Look for "Environment Variables"
  3. Set up the new accesskey, secert accesskey and default region.
  4. click "ok"

@omonlar
Copy link

omonlar commented Sep 16, 2023

git config --global credential.UseHttpPath true

Works ! Thanks

it worked for me too

@nourhanahmedelbadawie
Copy link

I had the same isssue and the command git config --global credential.UseHttpPath true saved me !

thanks, working for me

@Pinky057
Copy link

git config --global credential.UseHttpPath true worked for me thanks

@M-Amman-C
Copy link

Where do i add "git config --global credential.UseHttpPath true"? Pls help

@Pinky057
Copy link

Where do i add "git config --global credential.UseHttpPath true"? Pls help

To execute the following task, please enter the specified command in your project repository's terminal.

@mmctca
Copy link

mmctca commented May 26, 2024

I seem to be running into the same problems as above in this thread and cannot seem to get past the error:
"fatal: unable to access 'https://git-codecommit.us-east-2.amazonaws.com/v1/repos/wildrydes-site2/': The requested URL returned error: 403"

If I am in the AWS Amplify console and trying to deploy via the console (via 'Redeploy this version'), does the 'CloudShell' reflect the environment variables that are being used? I open 'CloudShell' and have tried to run the following commands from the command line:
git config --global credential.helper "!aws codecommit credential-helper $@"
git config --global credential.UseHttpPath true

I do not get any errors when I run the commands, but it does not seem to have any change when I try to execute 'Redeploy this version'. The account I am using has 'AWSCodeCommitFullAccess' permissions, but unsure what account AWS Amplify is using when trying to access the CodeCommit repository. That seems to be the crux of the issue - that the account trying to access the CodeCommit repository does not have permissions, but I can't seem to derive what account AWS Amplify is using to access CodeCommit.

Any ideas/suggestions would be greatly appreciated.

@tornado67
Copy link

tornado67 commented Jun 17, 2024

Same issue here.
Neither
git config --system --unset credential.helper
nor
git config --global credential.UseHttpPath true
nor cloning over ssh helped me.
I couldn't ever imagine that AWS would make it's service so extremely, outstandingly BAD! Shame on you AWS!

@Levispsic
Copy link

Levispsic commented Jul 13, 2024

I had this problem, when following an AWS tutorial, in the "Enable Web hosting with the AWS Amplify console" step. At this stage, when deploying to AWS Amplify via CodeCommit, the build reported this error. After a lot of research, I understood that for this process, it is necessary to attach a "service function" to the application.
Follow this procedure to create this "function" and how to attach it to the application.

https://docs.aws.amazon.com/amplify/latest/userguide/how-to-service-role-amplify-console.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment