Issue
I've set up several multi-branch pipeline jobs, and all of them have a similar declarative pipeline. On one of my jobs, I get this. For the life of me I can't figure out what it means. Any clues?
FailedConsole Output
16:56:25 [Pipeline] End of Pipeline
16:56:25 Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 10.227.23.xxx/10.227.23.xxx:59718
16:56:25 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
16:56:25 at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
16:56:25 at hudson.remoting.Channel.call(Channel.java:1001)
16:56:25 at hudson.FilePath.act(FilePath.java:1247)
16:56:25 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1.run(GitChangelogStep.java:326)
16:56:25 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
16:56:25 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
16:56:25 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
16:56:25 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
16:56:25 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
16:56:25 at java.lang.Thread.run(Thread.java:748)
16:56:25 se.bjurr.gitchangelog.api.exceptions.GitChangelogRepositoryException: master not found in:
16:56:25 Repo: Repository[C:\jenkins\workspace\ature_devops-3-upload-zip-file_4\.git]
16:56:25 HEAD
16:56:25 refs/remotes/origin/development
16:56:25 refs/remotes/origin/feature/devops-3-upload-zip-file
16:56:25 refs/remotes/origin/release/1.4.24
16:56:25 refs/remotes/origin/release/1.4.25
16:56:25 refs/remotes/origin/release/1.4.26
16:56:25 refs/remotes/origin/release/1.4.27
16:56:25 refs/remotes/origin/release/1.4.28
16:56:25 refs/remotes/origin/release/1.4.29
16:56:25
16:56:25 at se.bjurr.gitchangelog.internal.git.GitRepo.getRef(GitRepo.java:142)
16:56:25 at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:443)
16:56:25 at se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:77)
16:56:25 at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:99)
16:56:25 at se.bjurr.gitchangelog.api.GitChangelogApi.render(GitChangelogApi.java:123)
16:56:25 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.perform(GitChangelogStep.java:407)
16:56:25 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep.access$000(GitChangelogStep.java:44)
16:56:25 at org.jenkinsci.plugins.gitchangelog.steps.GitChangelogStep$1$1.call(GitChangelogStep.java:322)
16:56:25 at hudson.remoting.UserRequest.perform(UserRequest.java:212)
16:56:25 at hudson.remoting.UserRequest.perform(UserRequest.java:54)
16:56:25 at hudson.remoting.Request$2.run(Request.java:369)
16:56:25 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
16:56:25 at java.util.concurrent.FutureTask.run(Unknown Source)
16:56:25 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
16:56:25 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
16:56:25 at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
16:56:25 at java.lang.Thread.run(Unknown Source)
16:56:25 Finished: FAILURE
Solution
The error is stated in the log
master not found in: 16:56:25 Repo: Repository[C:\jenkins\workspace\ature_devops-3-upload-zip-file_4.git]
Jenkins git plugin is unable to find the master branch. You can verify this by manually executing the below command from the path
C:\jenkins\workspace\ature_devops-3-upload-zip-file_4\
git show-ref
If you do not see the line
refs/remotes/origin/master
in the output, then you have a problem with your git repository
Answered By - Monish Sen