jenkinsci/git-changelog-plugin

not compatible jGIT 5 (latest git client plug ins)

Closed this issue · 13 comments

Hello,
I'm not 100% sure about the issue. Your plugins is great and worked smooth for a long time on an old Jenkins server. We rebuilt one from scratch and it does not work anymore. I'm using git changelog 2.21. The new server Git plugins is now 4.1.1, Git Client plugins is 3.1.1, while is was 2.8.0 on the old server

I get this error message :
ERROR: Step ‘Publish JIRA Filter’ aborted due to exception:
java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.resolveRev(GitLogBetween.java:44)
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getJGitLogBetween(GitLogBetween.java:32)

I found this on the wed, similar issue : https://issues.jenkins-ci.org/browse/JENKINS-53004
Seems like the conclusion is "reference to a symbol that JGit 4.x deprecated and JGit 5.x removed."

Not sure what this means … could it be the plugins needs a new revision to be compatible Git Client plug ins 3.1.1

Thanks for your help

There is an example of doing this with a pipeline. The example is in the readme of this repo.

I'm not sure I understand the reply. We used to have a working configuration, using an older version of Git ChangeLog / Git Client. We used the documentation at that time.

But it does not work anymore with the new version of Git Client, with latest jGIT library. I do not see how documentation to configure a new task would help....

@smarchandon you are using the Jira filter, right? This code is not touched for a certain time. I will find the time to look into it this week.

"documentation to configure a new task would help" because that new task is (probably) working.

Hello,

I have refreshed all my jenkins plugins to latest and I still get the error message

ERROR: Step ‘Publish JIRA Filter’ aborted due to exception:
java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.resolveRev(GitLogBetween.java:44)
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getJGitLogBetween(GitLogBetween.java:32)
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getGitLogBetween(GitLogBetween.java:25)
at de.wellnerbou.gitchangelog.app.GitChangelog.changelog(GitChangelog.java:83)
at de.wellnerbou.jenkins.gitchangelog.callable.GitChangelogMasterToSlaveCallable.call(GitChangelogMasterToSlaveCallable.java:28)
at de.wellnerbou.jenkins.gitchangelog.callable.GitChangelogMasterToSlaveCallable.call(GitChangelogMasterToSlaveCallable.java:14)
at hudson.FilePath.act(FilePath.java:1162)
at de.wellnerbou.jenkins.gitchangelog.publish.GitLogGenericPostPublishPerformer.perform(GitLogGenericPostPublishPerformer.java:50)
at de.wellnerbou.jenkins.gitchangelog.publish.GitLogJiraFilterPostPublisher.perform(GitLogJiraFilterPostPublisher.java:56)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1878)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:427)
ERROR: Step ‘Publish Git changelog’ aborted due to exception:
java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.resolveRev(GitLogBetween.java:44)
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getJGitLogBetween(GitLogBetween.java:32)
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getGitLogBetween(GitLogBetween.java:25)
at de.wellnerbou.gitchangelog.app.GitChangelog.changelog(GitChangelog.java:83)
at de.wellnerbou.jenkins.gitchangelog.callable.GitChangelogMasterToSlaveCallable.call(GitChangelogMasterToSlaveCallable.java:28)
at de.wellnerbou.jenkins.gitchangelog.callable.GitChangelogMasterToSlaveCallable.call(GitChangelogMasterToSlaveCallable.java:14)
at hudson.FilePath.act(FilePath.java:1162)
at de.wellnerbou.jenkins.gitchangelog.publish.GitLogGenericPostPublishPerformer.perform(GitLogGenericPostPublishPerformer.java:50)
at de.wellnerbou.jenkins.gitchangelog.publish.GitLogBasicChangelogPostPublisher.perform(GitLogBasicChangelogPostPublisher.java:46)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1878)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:427)

Do you happen some news on this issue ?

thanks for your help

Hi, we updated all our plugins recently and we are getting a similar error. I also found the same issue when trying to track down why the changelog was failing. Our output is

05:51:12 ERROR: Step ‘Publish Git changelog’ aborted due to exception:
05:51:12 Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to TravelMachine
05:51:12 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
05:51:12 at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
05:51:12 at hudson.remoting.Channel.call(Channel.java:998)
05:51:12 at hudson.FilePath.act(FilePath.java:1159)
05:51:12 at de.wellnerbou.jenkins.gitchangelog.publish.GitLogGenericPostPublishPerformer.perform(GitLogGenericPostPublishPerformer.java:50)
05:51:12 at de.wellnerbou.jenkins.gitchangelog.publish.GitLogBasicChangelogPostPublisher.perform(GitLogBasicChangelogPostPublisher.java:46)
05:51:12 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
05:51:12 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
05:51:12 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
05:51:12 at hudson.model.Build$BuildExecution.post2(Build.java:186)
05:51:12 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
05:51:12 at hudson.model.Run.execute(Run.java:1881)
05:51:12 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
05:51:12 at hudson.model.ResourceController.execute(ResourceController.java:97)
05:51:12 at hudson.model.Executor.run(Executor.java:428)
05:51:12 java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
05:51:12 at de.wellnerbou.gitchangelog.jgit.GitLogBetween.resolveRev(GitLogBetween.java:44)
05:51:12 at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getJGitLogBetween(GitLogBetween.java:32)
05:51:12 at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getGitLogBetween(GitLogBetween.java:25)
05:51:12 at de.wellnerbou.gitchangelog.app.GitChangelog.changelog(GitChangelog.java:83)
05:51:12 at de.wellnerbou.jenkins.gitchangelog.callable.GitChangelogMasterToSlaveCallable.call(GitChangelogMasterToSlaveCallable.java:28)
05:51:12 at de.wellnerbou.jenkins.gitchangelog.callable.GitChangelogMasterToSlaveCallable.call(GitChangelogMasterToSlaveCallable.java:14)
05:51:12 at hudson.remoting.UserRequest.perform(UserRequest.java:211)
05:51:12 at hudson.remoting.UserRequest.perform(UserRequest.java:54)
05:51:12 at hudson.remoting.Request$2.run(Request.java:369)
05:51:12 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
05:51:12 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05:51:12 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
05:51:12 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
05:51:12 at java.lang.Thread.run(Thread.java:748)
05:51:12 Caused: java.io.IOException: Remote call on TravelMachine failed
05:51:12 at hudson.remoting.Channel.call(Channel.java:1004)
05:51:12 at hudson.FilePath.act(FilePath.java:1159)
05:51:12 at de.wellnerbou.jenkins.gitchangelog.publish.GitLogGenericPostPublishPerformer.perform(GitLogGenericPostPublishPerformer.java:50)
05:51:12 at de.wellnerbou.jenkins.gitchangelog.publish.GitLogBasicChangelogPostPublisher.perform(GitLogBasicChangelogPostPublisher.java:46)
05:51:12 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
05:51:12 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
05:51:12 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
05:51:12 at hudson.model.Build$BuildExecution.post2(Build.java:186)
05:51:12 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
05:51:12 at hudson.model.Run.execute(Run.java:1881)
05:51:12 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
05:51:12 at hudson.model.ResourceController.execute(ResourceController.java:97)
05:51:12 at hudson.model.Executor.run(Executor.java:428)

@MaximilienRedemption you found a solution to sort this out ?

@paulwellnerbou gentle reminder, indeed this code was not touched for a while, that's may be the reason it's not compatible with JGit 5.x ...

thanks for your help.

Just in case someone has the same issue, seems like you are doomed to use old versions of git and git clients in Jenkins, not possible to use latest ones, this plugins is not compatible.

Last comments from https://issues.jenkins-ci.org/browse/JENKINS-53004 is pretty clear what's to be done, so I have downgraded :
Git from 4.2.2 to 3.12.2
Git client from 3.2.1 to 2.9.0
No other solution...

And it works, too bad this plugins is not maintained ...

I also think it is bad. It is a merge of 2 plugins, further explained in the readme. But it is clear that my part is maintained:
https://github.com/jenkinsci/git-changelog-plugin/graphs/contributors

I would argue that the part from @paulwellnerbou should be removed from the plugin because:

I responded to the issue same day as it was opened. Describing how to do this with my part. And as far as I know, my part is working with the API of JGit 5. I made a test to see if that is true. So as far as none is reporting an issue on that I assume there are no problems.

@tomasbjerre Yes, we con go ahead with the removal of my part of the plugin. It does not seem to be used much anywhere. It would make sense anyhow if both parts would share the same git library behind. (Unfortunately we developed the git lib almost at the same time and merged it together.)

The only feature that is not covered by your part is the automatic search for the latest release and the automatic creation of the Jira filter. Not sure if this is used by anyone... And even if it is used, it should be possible to use your changelog library for the same purpose.

Nevertheless I updated my source library now to the latest libraries and made it guava-free: #46, so it should work then.

As I don't use Jenkins in any of my projects any more, I don't follow the development very much.

@tomasbjerre @paulwellnerbou Thanks for the swift reply, appreciate that.

I'm not 100% clear what part is covered by whom, but if I have this error ... that's likely because I'm using that "not used much anymore" code (may be not). Anyway, looking forward for a next build (nothing urgent), I'll give it a try with latest versions...

thanks for you help.

PR opened, awaiting @paulwellnerbou approval: #47

Closing this, as the feature is now removed from version 3.0. #47