cancel
Showing results for 
Search instead for 
Did you mean: 

Error fetching from jenkins-library.git using gCTS for ABAP

Karan_Chopra_
Active Participant
0 Kudos

Hi Experts

I am trying to build pipleline for ABAP gCTS scenerio (https://www.project-piper.io/scenarios/gCTS_Scenario/) but I am getting error in pipeline during initial step itself when accessing jenkins-library.git.

Below is the error

Branch indexing
<small>09:54:04</small> Connecting to <a href="https://api.github.com/">https://api.github.com</a> using karanchopras/****** (Github_Access_Token)
Obtained Jenkinsfile from 9c4a76c07e292b2eea3070317eab47934ffec359
Loading library piper-lib-os@master
Attempting to resolve master from remote references...
 > git.exe --version # timeout=10
 > git --version # 'git version 2.36.1.windows.1'
 > git.exe ls-remote -h -- <a href="https://github.com/SAP/jenkins-library.git">https://github.com/SAP/jenkins-library.git</a> # timeout=10
Found match: refs/heads/master revision 8084ce1a9464d8c63ea866c0750a07e54fc8e147
The recommended git tool is: NONE
No credentials specified
 > git.exe rev-parse --resolve-git-dir C:\Users\kcho\AppData\Local\Jenkins\.jenkins\workspace\Devops_Abap_main@libs\dbcbfb7501bf2b64f7fbaf9665440b7133f9bd990904ef1b7c04595362ad2b2e\.git # timeout=10
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url <a href="https://github.com/SAP/jenkins-library.git">https://github.com/SAP/jenkins-library.git</a> # timeout=10
Fetching without tags
Fetching upstream changes from <a href="https://github.com/SAP/jenkins-library.git">https://github.com/SAP/jenkins-library.git</a>
 > git.exe --version # timeout=10
 > git --version # 'git version 2.36.1.windows.1'
 > git.exe fetch --no-tags --force --progress -- <a href="https://github.com/SAP/jenkins-library.git">https://github.com/SAP/jenkins-library.git</a> +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from <a href="https://github.com/SAP/jenkins-library.git">https://github.com/SAP/jenkins-library.git</a>
	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$1(SCMSourceRetriever.java:200)
	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:148)
	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:199)
	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:137)
	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:260)
	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:150)
	at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox$Scope.parse(GroovySandbox.java:163)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:563)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:515)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:336)
	at hudson.model.ResourceController.execute(ResourceController.java:107)
	at hudson.model.Executor.run(Executor.java:449)
Caused by: hudson.plugins.git.GitException: Command "git.exe fetch --no-tags --force --progress -- <a href="https://github.com/SAP/jenkins-library.git">https://github.com/SAP/jenkins-library.git</a> +refs/heads/*:refs/remotes/origin/*" returned status code 1:
stdout: 
stderr: From <a href="https://github.com/SAP/jenkins-library">https://github.com/SAP/jenkins-library</a>
   34fc844a..2f9928d5  CCFenner/opentelemetry -> origin/CCFenner/opentelemetry
 * [new branch]        ccfenner/opentelemetry -> origin/ccfenner/opentelemetry
error: cannot lock ref 'refs/remotes/origin/dependabot/maven/org.jenkins-ci.plugins.workflow-workflow-cps-global-lib-588.v576c103a_ff86': Unable to create 'C:/Users/kcho/AppData/Local/Jenkins/.jenkins/workspace/Devops_Abap_main@libs/dbcbfb7501bf2b64f7fbaf9665440b7133f9bd990904ef1b7c04595362ad2b2e/.git/refs/remotes/origin/dependabot/maven/org.jenkins-ci.plugins.workflow-workflow-cps-global-lib-588.v576c103a_ff86.lock': Filename too long
 ! [new branch]        dependabot/maven/org.jenkins-ci.plugins.workflow-workflow-cps-global-lib-588.v576c103a_ff86 -> origin/dependabot/maven/org.jenkins-ci.plugins.workflow-workflow-cps-global-lib-588.v576c103a_ff86  (unable to update local ref)

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2734)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2111)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:623)
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1001)
	... 24 more
ERROR: Error fetching remote repo 'origin'
ERROR: Maximum checkout retry attempts reached, aborting
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: Loading libraries failed

1 error

What can be wrong here.

Accepted Solutions (0)

Answers (3)

Answers (3)

krk-ro
Explorer

Below is error snippet from your Jenkins log, which says Filename too long. Best practice is always Jenkins workspace folder directly under root directory e.g., c:\Jenkins, D:\Jenkins. This error is commonly observed in windows.

error: cannot lock ref 'refs/remotes/origin/dependabot/maven/org.jenkins-ci.plugins.workflow-workflow-cps-global-lib-588.v576c103a_ff86': Unable to create 'C:/Users/kcho/AppData/Local/Jenkins/.jenkins/workspace/Devops_Abap_main@libs/dbcbfb7501bf2b64f7fbaf9665440b7133f9bd990904ef1b7c04595362ad2b2e/.git/refs/remotes/origin/dependabot/maven/org.jenkins-ci.plugins.workflow-workflow-cps-global-lib-588.v576c103a_ff86.lock': Filename too long
Karan_Chopra_
Active Participant
0 Kudos

Thanks I was able to remove this error by allowing long path for file names.

But now I am stuck with new error which comes at below pipeline step

9:49:24 Connecting to using karanchopras/****** (Github_Access_Token)
Obtained Jenkinsfile from e4a5694888f92d9e2a2c17b4b1bc1b1bbc2ae23a
Loading library piper-lib-os@master
Attempting to resolve master from remote references...
> git.exe --version # timeout=10
> git --version # 'git version 2.36.1.windows.1'
> git.exe ls-remote -h -- https://github.com/SAP/jenkins-library.git # timeout=10
Found match: refs/heads/master revision 8084ce1a9464d8c63ea866c0750a07e54fc8e147
The recommended git tool is: git.exe
No credentials specified
> git.exe rev-parse --resolve-git-dir C:\Users\kcho\AppData\Local\Jenkins\.jenkins\workspace\Devops_Abap_main@libs\dbcbfb7501bf2b64f7fbaf9665440b7133f9bd990904ef1b7c04595362ad2b2e\.git # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://github.com/SAP/jenkins-library.git # timeout=10
Fetching without tags
Fetching upstream changes from https://github.com/SAP/jenkins-library.git

> git.exe --version # timeout=10
> git --version # 'git version 2.36.1.windows.1'
> git.exe fetch --no-tags --force --progress -- https://github.com/SAP/jenkins-library.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision 8084ce1a9464d8c63ea866c0750a07e54fc8e147 (master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f 8084ce1a9464d8c63ea866c0750a07e54fc8e147 # timeout=10
Commit message: "Change to default cf create-service implementation (#4224)"
> git.exe rev-list --no-walk 8084ce1a9464d8c63ea866c0750a07e54fc8e147 # timeout=10
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in C:\Users\kcho\AppData\Local\Jenkins\.jenkins\workspace\Devops_Abap_main
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
The recommended git tool is: NONE
using credential Github_Access_Token
> git.exe rev-parse --resolve-git-dir C:\Users\kcho\AppData\Local\Jenkins\.jenkins\workspace\Devops_Abap_main\.git # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://github.com/karanchopras/workbench.git # timeout=10
Fetching without tags
Fetching upstream changes from https://github.com/karanchopras/workbench.git
> git.exe --version # timeout=10
> git --version # 'git version 2.36.1.windows.1'
using GIT_ASKPASS to set credentials Github_Access_Token
> git.exe fetch --no-tags --force --progress -- https://github.com/karanchopras/workbench.git +refs/heads/main:refs/remotes/origin/main # timeout=10
Checking out Revision e4a5694888f92d9e2a2c17b4b1bc1b1bbc2ae23a (main)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f e4a5694888f92d9e2a2c17b4b1bc1b1bbc2ae23a # timeout=10
Commit message: "Verbose true"
> git.exe rev-list --no-walk 45264e90f5bcee05d211d66542f3f3e6c647a3b6 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (gCTS Deploy)
[Pipeline] libraryResource
[Pipeline] readYaml
[Pipeline] echo
--- Begin library step of: gctsDeploy ---
[Pipeline] sh
[Pipeline] libraryResource
[Pipeline] echo
----------------------------------------------------------
--- An error occurred in the library step: gctsDeploy
----------------------------------------------------------
The following parameters were available to the step:
***
[script:WorkflowScript@362732ac, host:<hostname_hidden>, client:100, abapCredentialsId:S4S_KCHO, repository:karanchopras-workbench, verbose:true, remoteRepositoryURL:https://github.com/karanchopras/workbench, role:SOURCE, vSID:GIT]
***
The error was:
***
java.io.IOException: Cannot run program "nohup" (in directory "C:\Users\kcho\AppData\Local\Jenkins\.jenkins\workspace\Devops_Abap_main"): CreateProcess error=2, The system cannot find the file specified
***
Further information:
* Documentation of library step gctsDeploy: https://sap.github.io/jenkins-library/steps/gctsDeploy/
* Source code of library step gctsDeploy: https://github.com/SAP/jenkins-library/blob/master/vars/gctsDeploy.groovy
* Library documentation: https://sap.github.io/jenkins-library/
* Library repository: https://github.com/SAP/jenkins-library/
----------------------------------------------------------
--- End library step of: gctsDeploy ---
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (gctsExecuteABAPQualityChecks)
Stage "gctsExecuteABAPQualityChecks" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Results in Checkstyle)
Stage "Results in Checkstyle" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Rollback)
Stage "Rollback" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:499)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at hudson.Proc$LocalProc.<init>(Proc.java:254)..................
Caused: java.io.IOException: Cannot run program "nohup" (in directory "C:\Users\kcho\AppData\Local\Jenkins\.jenkins\workspace\Devops_Abap_main"): CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at hudson.Proc$LocalProc.<init>(Proc.java:254)
at hudson.Proc$LocalProc.<init>(Proc.java:223)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:997)
at hudson.Launcher$ProcStarter.start(Launcher.java:509)
at org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:176)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:132)
..................
at WorkflowScript.run(WorkflowScript:28)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute(ModelInterpreter.groovy:137)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:666)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:395)
ionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:85)
.......................................
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
GitHub has been notified of this commit’s build result
Finished: FAILURE
krk-ro
Explorer
0 Kudos

Did you specify any shell command "nohup" in your pipeline script?

0 Kudos

Hi Karan,

It seems that the problem is related to the credentials, the pipeline is not able to access your git repo. Recheck that and if the repo is public.

Karan_Chopra_
Active Participant
0 Kudos

Can somebody help on this? I created another pipeline for initial Piper setup using https://www.project-piper.io/guidedtour/ but still I get same error.