Hello,
We are trying to checkout aws code commit repo using Jenkins Pipeline SCM. All the prerequisities are followed and looks good. But still encountering below error. Unfortunatly the same url and login credentials are working fine on our test instance. Jenkinsfile is in subfolder.
halkeye
(Gavin Mogan)
April 18, 2023, 8:47pm
2
searching the forums for "not in a git directory"
has turned up a number of threads.
Please make sure you search existing topics before open a new one.
Hello,
I’m trying to set up an IaC pipeline that deploys some resources using terraform. I am storing this pipeline in a top-level Jenkins file in our IaC repository. Our repository is stored on a self-hosted bitbucket server. I have created a multibranch pipeline with “Single repsitory & branch” as the branch source, and specified the correct repository URL and credentials there. However, when executing trying to create the pipeline from git (i.e. executing in Jenkins), the following error alw…
ERROR: Error fetching remote repo ‘origin’
hudson.plugins.git.GitException: Failed to fetch from https://github.com/gh-org-data-platform/dp-tools-jenkins-sharedlib
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1003)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1245)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1309)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$doRetrieve…
Update, I wanted to try to see if maybe I could find a solution that wasn’t a drastic one just to see what would happen.
So in the agent dockefle I set:
git config --global --add safe.directory '*'
This fixed the issue for a freestyle project but not for the pipeline.
Both of the jobs are cloning the same repo and has the same configuration for the git checkout except for pipeline vs freestyle.
The error message for the pipeline has not changed so I am fully at a loss now.