-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Powered by SuggestiMate -
Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2, Blue Ocean 1.1-beta4, Blue Ocean 1.1
Observable in jenkinsci/workflow-demo:2017-04-05:
... io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckout SEVERE: Unexpected error when retrieving changeset hudson.plugins.git.GitException: Error launching git whatchanged at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:854) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:137) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:67) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:108) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:84) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:150) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:131) at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:114) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1053) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:430) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:393) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:238) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:405)
- is duplicated by
-
JENKINS-46639 autofavourite fails with git-client plugin and jgit 4.5.3
-
- Closed
-
-
JENKINS-48582 GitException: Error: jgit includes()
-
- Closed
-
- relates to
-
JENKINS-39832 org.eclipse.jgit.errors.MissingObjectException: Missing commit
-
- Closed
-
- links to
- mentioned in
-
Wiki Page Loading...
[JENKINS-43400] Autofavorite broken on remote agents
Unfortunately, I don't know what might cause that error. I've seen cases where the "git whatchanged" call fails because the repository is not in the expected directory, but I would have expected a different message, not that dramatic exception,
I ran that instance, but I don't see the same failure. Maybe there are more steps needed that I didn't take?
markewaite I ran the container and saw it very early on in the log.
Facts from my debugging session:
- git executable on docker container has `whatchanged`
- SCMListener.onCheckout's workspace variable always points to the location where we did the git checkout.
- FavoritingScmListener is performing its operations against that workspace. It looks good.
The only thing I can think of is that the listener is getting run as part of a master side poll operation and it might not have the checkout under some circumstances? I am a bit stumped.
I am also seeing this same error, I am running Jenkins 2.32.1 and using the latest blueocean version
is there a way to disable the autofavoriting feature?
This only happens on the first build of a new job/pr. this behavior is similar to:
https://issues.jenkins-ci.org/browse/JENKINS-39704
Apr 17, 2017 3:06:27 PM SEVERE io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckout Unexpected error when retrieving changeset hudson.plugins.git.GitException: Error launching git whatchanged at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:856) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:137) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:67) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:221) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: Process working directory '/var/lib/jenkins/workspace/dp-ops_dp-openresty_PR-5-B473PJOCVHSFT2UDTFSJGRSVZPDUGCJJMZTF5A4LO6VECI3Q4YSQ@2/libLoader' doesn't exist! at hudson.Proc$LocalProc.<init>(Proc.java:243) at hudson.Proc$LocalProc.<init>(Proc.java:214) at hudson.Launcher$LocalLauncher.launch(Launcher.java:846) at hudson.Launcher$ProcStarter.start(Launcher.java:384) at hudson.Launcher$ProcStarter.join(Launcher.java:395) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:853) ... 13 more Apr 17, 2017 3:06:30 PM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish dp-ops/dp-openresty/PR-5 #1 completed: FAILURE
Code changed in jenkins
User: James Dumay
Path:
src/main/java/io/jenkins/blueocean/autofavorite/FavoritingScmListener.java
http://jenkins-ci.org/commit/blueocean-autofavorite-plugin/614b076678aa40f6eb9233b8c044324b35074598
Log:
JENKINS-43400 Bail out early if the workspace does not exist or is a directory
Code changed in jenkins
User: James William Dumay
Path:
src/main/java/io/jenkins/blueocean/autofavorite/FavoritingScmListener.java
http://jenkins-ci.org/commit/blueocean-autofavorite-plugin/e4e4ca577979ad86932cca0f1fbc26051c2233d6
Log:
JENKINS-43400 Bail out early if the workspace does not exist or is a directory (#6)
shawnchasse looks like your working directory doesn't exist when autofavorite has a chance to run. Ive made it bail out quietly so you shouldn't have those errors.
Fix does not work.
… io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckout SEVERE: Unexpected error when retrieving changeset hudson.plugins.git.GitException: Error launching git whatchanged at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:854) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:143) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:73) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at …
Easiest to confirm in the demo. Make a proposed patch, mvn -DskipTests install it, then
workflow-aggregator-plugin$ git diff HEAD diff --git a/demo/plugins.txt b/demo/plugins.txt index 9740ea4..62a5d53 100644 --- a/demo/plugins.txt +++ b/demo/plugins.txt @@ -1,7 +1,7 @@ org.jenkins-ci.ui:ace-editor:1.1 org.jenkins-ci.plugins:authentication-tokens:1.3 io.jenkins.blueocean:blueocean:1.0.0 -org.jenkins-ci.plugins:blueocean-autofavorite:0.7 +org.jenkins-ci.plugins:blueocean-autofavorite:0.8-SNAPSHOT io.jenkins.blueocean:blueocean-commons:1.0.0 io.jenkins.blueocean:blueocean-config:1.0.0 io.jenkins.blueocean:blueocean-dashboard:1.0.0 workflow-aggregator-plugin$ make -C demo run # …watch output…
getting something very similar, I don't know where it is getting this path from since all directories is on C:/jenkins or E:/jenkins on our windows machine:
Autofavorite for Blue Ocean 0.7
jun. 02, 2017 9:51:03 AM io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckout SEVERE: Unexpected error when retrieving changeset hudson.plugins.git.GitException: Error launching git whatchanged at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:888) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:143) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:73) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:123) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:260) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Process working directory 'E:\Users\builder\workspace\pp_feature_bluetooth_rename-UOXVQ3TMF3BYRYHJYZDRKY7XV6SRLSIFICLKHS5LZVKT6J55PNTA' doesn't exist! at hudson.Proc$LocalProc.<init>(Proc.java:243) at hudson.Proc$LocalProc.<init>(Proc.java:214) at hudson.Launcher$LocalLauncher.launch(Launcher.java:846) at hudson.Launcher$ProcStarter.start(Launcher.java:384) at hudson.Launcher$ProcStarter.join(Launcher.java:395) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:885) ... 13 more
It seems to be executing something on master... that should be executed on agent.
The path is based on our mac agents who use /Users/builder/workspace as agent path
This is the code I have issue with:
https://github.com/jenkinsci/blueocean-autofavorite-plugin/blob/master/src/main/java/io/jenkins/blueocean/autofavorite/FavoritingScmListener.java#L123-L124
Git gitBuilder = Git.with(TaskListener.NULL, new EnvVars()) .in(new File(workspace.getRemote()));
The new File on a possible agent path
Released blueocean-autofavorite 1.0-beta-1 to the experimental update center. We will give it a run on ci.blueocean.io for a few days and see how it goes.
While that patch may well have solved some bug, it did not solve this one, which is still trivially reproducible after
diff --git a/demo/plugins.txt b/demo/plugins.txt index 24552af..bee898d 100644 --- a/demo/plugins.txt +++ b/demo/plugins.txt @@ -2,7 +2,7 @@ org.jenkins-ci.ui:ace-editor:1.1 org.jenkins-ci.plugins:ansicolor:0.5.0 org.jenkins-ci.plugins:authentication-tokens:1.3 io.jenkins.blueocean:blueocean:1.0.1 -org.jenkins-ci.plugins:blueocean-autofavorite:0.7 +org.jenkins-ci.plugins:blueocean-autofavorite:1.0.0 io.jenkins.blueocean:blueocean-commons:1.0.1 io.jenkins.blueocean:blueocean-config:1.0.1 io.jenkins.blueocean:blueocean-dashboard:1.0.1
See PR 9 for proper diagnostics, and discussion of what an actual fix might consist of.
(and please do not close again without confirming a fix in the originally supplied test case)
Code changed in jenkins
User: Jesse Glick
Path:
src/main/java/io/jenkins/blueocean/autofavorite/FavoritingScmListener.java
http://jenkins-ci.org/commit/blueocean-autofavorite-plugin/398fc00bc2d4b3caab4d62dd347a43147103ed6d
Log:
JENKINS-43400 Print the error to the build log rather than swallowing it. (#9)
Hello! Since this last change, our logs have been flooded with this message ("Unexpected error when retrieving changeset"), which makes it much more difficult to see other "Severe" logs.
I think that alone should elevate this issue from "Minor" to at least "Major" priority. Is there any plan to reinvestigate the possible root cause of the issue and fix it? Or, as a stop-gap measure, change the logging level to WARN?
This issue started occurring for me on BlueOcean 1.17.0 / autofavorite plugin 1.2.4. In addition to filling our logs with stack traces, it also seems to break the rendering of pipeline input steps. Is anyone else experiencing this?
I am seeing this in logs often also.
on BlueOcean 1.16.0 autofavorite plugin 1.2.4
Hello again. jglick, jamesdumay, would a PR be welcome to at least change the logging level of this message? Thanks!
jglick, jamesdumay and anyone else interested, I've just (finally) opened a tiny PR to at least improve the logging situation, here:
https://github.com/jenkinsci/blueocean-autofavorite-plugin/pull/20
I have a similar issue but there is a different stack trace.
It starts with similar svere log and followed by something REMOTE CALL FAIL. copying the log from server:
2020-09-11 12:52:29.384+0000 [id=5792910] SEVERE i.j.b.a.FavoritingScmListener#onCheckout: Unexpected error when retrieving changeset
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to MYAGENTNAME
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:998)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor548.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy415.execute(Unknown Source)
at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:159)
at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:84)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:150)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
hudson.plugins.git.GitException: Error: git whatchanged -no-abbrev -M "-format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(0,4,4)%B" -n 1 2697101451ffb585330c0db9f3ee3d669d8a6151 in d:\jenkins\experience_sw
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1214)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Would still like a fix for this problem. Lowering the severity to "WARNING" doesn't mean we're not still getting spammed with stack-traces. Driving me nuts
Getting the same error on a Pull request (Bitbucket) with shared libraries in k8s agent pod
2021-08-22 08:08:05.955+0000 [id=25701] SEVERE i.j.b.a.FavoritingScmListener#onCheckout: Unexpected error when retrieving changeset hudson.plugins.git.GitException: Error: git whatchanged --no-abbrev -M "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(0,4,4)%B" -n 1 ssda9327a7esadsadsadsadsadsdd in /var/jenkins_home/workspace/bitbucket-repos_api_PR-231@libs/pipeline-library at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1272) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:159) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:84) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:155) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$doRetrieve$1(SCMSourceRetriever.java:190) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:140) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:189) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:129) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:196) at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:210) at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:155) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate2(ACL.java:449) at hudson.security.ACL.impersonate(ACL.java:461) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
dordor the solution for this problem is to uninstall the blueocean autofavorite plugin. Update to the most recent version of blue ocean and the autofavorite plugin can be uninstalled. The autofavorite plugin did not provide me enough value to justify leaving it in my Jenkins installation
Hi markewaite , thank you for your answer, it seems that I can't uninstall blueocean autofavorite plugin because it's used as a dependency for the Blue Ocean plugin (here)
How can I remove it?
As others have noted: adding the following line to my jenkins/init.groovy.d/startup.groovy worked:
System.setProperty("BLUEOCEAN_FEATURE_AUTOFAVORITE_ENABLED", "false")
Doesn't fix the underlying problem obviously, but does prevent a lot of errors.
dordor In my installation I removed it by unchecking (disabling) the "Blue Ocean Aggregator" and then uninstalling the "Autofavorite for Blue Ocean" plugin. I've now switched to managing plugin versions with a plugins.txt file and the plugin installation manager tool.
markewaite any clues to what might cause this error?