Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fastlane - Error cloning certificates repo

I am having some issues with fastlane and cloning a git repo from BitBucket. I am getting following error:

fatal: could not read Username for 'https://bitbucket.org': terminal prompts disabled
[17:21:34]: Exit status: 128
[17:21:34]: Error cloning certificates repo, please make sure you have read access to the repository you want to use
[17:21:34]: Run the following command manually to make sure you're properly authenticated:

I can manually git clone the repo without issue but when I am running it with fastlane, I am facing issues.

like image 766
Paul Dunne Avatar asked Feb 15 '18 17:02

Paul Dunne


2 Answers

This error means git can't find the username for the repo when run with terminal prompts disabled. You should be able to reproduce this by trying to clone the repo yourself like so:

$ GIT_TERMINAL_PROMPT=0 git clone https://bitbucket.org/org_name/repo_name

git is requiring you to enter the username manually because it does not have a credential stored.

Since you're using fastlane, I'm going to assume the most likely cause: you're on macOS but you haven't configured the git-credential-osxkeychain tool which provides credentials from the keychain to the git command line tool.

  1. Run

    $ git credential-osxkeychain
    

    to verify the tool is installed.

    If this fails, either install Xcode command line tools, or run brew install git to install it.

  2. Run

    $ git config --global credential.helper osxkeychain
    

    to configure the tool.

  3. Clone your repo (git clone …) as normal and login

Now your BitBucket credentials should be stored in your keychain and both GIT_TERMINAL_PROMPT=0 git clone and fastlane match should succeed.

If you're not on macOS, you'll need to install and configure a similar credential.helper for your operating system.

like image 57
Aaron Brager Avatar answered Oct 20 '22 16:10

Aaron Brager


I had the same issue and I have added githubkey path

match(git_private_key:"/Users/ajeetsharma/Desktop/Study/Fastlane/FastLaneDemo2/fastlane/gitHubKey")

And It has resolved

like image 38
ajeet sharma Avatar answered Oct 20 '22 16:10

ajeet sharma