We are setting up a CI/CD Pipeline process for our SFDX project.
We’ve used GitLab as our source code repository.
And Jenkins – Multibranch pipeline project for deployment.
I’m encountering an issue with the GitLab Plugin in my Jenkins Multibranch Pipeline setup. When attempting to clone my GitLab project using SSH key authentication, I’m facing an error in the pipeline script at the ‘checkout scm’ command. The error log indicates a problem with the Git URL being encoded incorrectly. Here’s the error log for reference:
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
using credential id_ed25519
> C:Program FilesGitbingit.exe rev-parse --resolve-git-dir D:JenkinsworkspaceLI-DevOps_main@2.git # timeout=10
Fetching changes from the remote Git repository
> C:Program FilesGitbingit.exe config remote.origin.url %[email protected]:22222]:akashkhichi/salesforceproject.git # timeout=10
Fetching without tags
Fetching upstream changes from %[email protected]:22222]:akashkhichi/salesforceproject.git
> C:Program FilesGitbingit.exe --version # timeout=10
> git --version # 'git version 2.22.0.windows.1'
> C:Program FilesGitbingit.exe fetch --no-tags --force --progress -- %[email protected]:22222]:akashkhichi/salesforceproject.git +refs/heads/main:refs/remotes/origin/main # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from %[email protected]:22222]:akashkhichi/salesforceproject.git
It seems the SSH URL i.e. [[email protected]:22222]:akashkhichi/salesforceproject.git is getting encoded to %[email protected]:22222]:akashkhichi/salesforceproject.git.
We’ve verified the configurations for the GitLab URL. And the SSH key is also working fine.
In attempting to resolve the issue, I verified the configuration settings for the GitLab URL and ensured that the SSH key was correctly configured and functioning. I also reviewed the Jenkins Multibranch Pipeline configuration to ensure that all settings related to GitLab integration were correctly set up.
We’ve tried the Git plugin for the same process and it worked fine but we have to use the GitLab plugin to utilize it’s features.
Ritvik Bhomia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.