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 Files\Git\bin\git.exe rev-parse --resolve-git-dir D:\Jenkins\workspace\LI-DevOps_main@2\.git # timeout=10
Fetching changes from the remote Git repository
> C:\Program Files\Git\bin\git.exe config remote.origin.url %255bgit@gitlab.com:22222]:akashkhichi/salesforceproject.git # timeout=10
Fetching without tags
Fetching upstream changes from %255bgit@gitlab.com:22222]:akashkhichi/salesforceproject.git
> C:\Program Files\Git\bin\git.exe --version # timeout=10
> git --version # 'git version 2.22.0.windows.1'
> C:\Program Files\Git\bin\git.exe fetch --no-tags --force --progress -- %255bgit@gitlab.com: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 %255bgit@gitlab.com:22222]:akashkhichi/salesforceproject.git
It seems the SSH URL i.e. [git@gitlab.com:22222]:akashkhichi/salesforceproject.git is getting encoded to %255bgit@gitlab.com:22222]:akashkhichi/salesforceproject.git.
We’ve verified the configurations for the GitLab URL. And the SSH key is also working fine.