Bug 484914 - gerrit-trigger plugin doesn't work with Hudson 3.3.2
Summary: gerrit-trigger plugin doesn't work with Hudson 3.3.2
Status: NEW
Alias: None
Product: Hudson
Classification: Technology
Component: Core (show other bugs)
Version: 3.3.2   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Winston Prakash CLA
QA Contact: Geoff Waymark CLA
URL:
Whiteboard:
Keywords:
: 485355 (view as bug list)
Depends on:
Blocks: 336262
  Show dependency tree
 
Reported: 2015-12-26 18:16 EST by Matthias Sohn CLA
Modified: 2016-02-01 05:31 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Sohn CLA 2015-12-26 18:16:31 EST
after upgrading the JGit HIPP to Hudson 3.3.2 I hit the following exception when manually triggering a build for a Gerrit change

java.lang.NoSuchMethodError: hudson.model.Hudson.getAuthentication()Lorg/springframework/security/Authentication;
	at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.ManualTriggerAction.findAndCreatePatchSetEvent(ManualTriggerAction.java:425)
	at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.ManualTriggerAction.doBuild(ManualTriggerAction.java:262)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:274)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:141)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:80)
	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:95)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:45)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:566)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:651)
	at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:365)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:566)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:651)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:482)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:153)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
	at org.hudsonci.servlets.internal.ServletRegistrationFilterAdapter.doFilter(ServletRegistrationFilterAdapter.java:162)
	at org.hudsonci.servlets.internal.ServletRegistrationFilterAdapter.doFilter(ServletRegistrationFilterAdapter.java:134)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
	at org.hudsonci.servlets.internal.ServletRegistrationFilterAdapter.doFilter(ServletRegistrationFilterAdapter.java:162)
	at org.hudsonci.servlets.internal.ServletRegistrationFilterAdapter.doFilter(ServletRegistrationFilterAdapter.java:134)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:81)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:47)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:73)
	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:157)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:70)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:497)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)

I get a very similar stack trace when trying to retrigger an existing change.

It seems this is the third reincarnation of a similar regression we hit after upgrading Hudson:

see Bug 390495 (Sept 2012, upgrade of shared )
and Bug 461174 (upgrade to Hudson 3.2.2, Mar 2015)

could you please fix this and add a test to your test suite which prevents that we see this regression again with the next Hudson upgrade to come ?
Comment 1 Matthias Sohn CLA 2015-12-26 18:19:29 EST
the version of the installed Gerrit trigger plugin is 2.5.3-h-2 which worked with the Hudson version we used before the upgrade (3.0.1-b2)
Comment 2 Mikaël Barbero CLA 2016-01-07 09:40:07 EST
*** Bug 485355 has been marked as a duplicate of this bug. ***
Comment 3 Andrey Loskutov CLA 2016-01-08 03:25:04 EST
Just wondering what is the root cause? Is there still any development community behind hudson, or everyone is on jenkins now?

https://projects.eclipse.org/projects/technology.hudson/who
https://github.com/jenkinsci/jenkins/graphs/commit-activity
Comment 4 Matthias Sohn CLA 2016-01-08 04:58:39 EST
compare these numbers available on OpenHub:

Jenkins [1]
- last 12 months: 4701 commits from 292 contributors
- last  1 month:   159 commits from  35 contributors

Hudson [2]
- last 12 months: 110 commits from 7 contributors
- last  1 month:    5 commits from 2 contributors

[1] https://www.openhub.net/p/jenkins/commits/summary
[2] https://www.openhub.net/p/hudson/commits/summary

Looking at these numbers it seems to be time to fix bug 336262
Comment 5 Winston Prakash CLA 2016-01-08 13:00:50 EST
(In reply to Matthias Sohn from comment #1)

Basically, Hudson core change did not cause this issue.

When we upgraded Spring security in Hudson 3.2.2, gerrit plugin was broken because Spring guys changed a  package name.

Looks like same thing happening in Hudson 3.3.2, when we moved to another version of Spring, the package name has changed again.

We have two options

- Keep all the plugins compatible to core but don't bother about outdated libraries in the core (like the Jenkins guys do, they still use Spring Security 1.x called acegi)

- Take a trade off (plugins may break) and upgrade libraries in the core for a secure and more stable core

Moving to Spring 3.1.2 in Hudson 3.3.2 is one such trade off because of major security issue in older version of Spring.

We tried our best to modify plugins that uses Spring API after releasing 3.3.2. Some how we missed Gerrit plugin.

I will compile the Gerrit plugin again with the changed package name and release a new version.
Comment 6 Winston Prakash CLA 2016-01-08 13:17:58 EST
(In reply to Matthias Sohn from comment #4)

Also according to this statistics, 

http://stats.jenkins-ci.org/jenkins-stats/svg/svgs.html

Jenkins has more than 126,000 installations. While, Hudson has less than 15,000 installations.

Main reason any one (especially Enterprises) still wants to use Hudson is because of its stability and security, which we tried to maintain with slow, steady and thoroughly QA-ed core development, released every 3-6 months (where as Jenkins is released every week). We have no plans to change that mode of development  in the future also.

So, if Eclipse wants to use fast paced Jenkins as its build tool, we at Hudson project won't feel offended :)
Comment 7 Winston Prakash CLA 2016-01-08 17:38:18 EST
(In reply to Winston Prakash from comment #5)

Sorry, I take that back. We did not upgrade Spring after Hudson 3.2.0. So Gerrit trigger plugin is 2.5.3-h-2 (released on Mar 26, 2015) is the correct version for  Hudson 3.3.2 also.

BTW, Gerrit Trigger 2.5.3-h-2 would not have worked with 3.0.1. That should be Gerrit Trigger 2.5.3-h-1.

Just make sure you have  Gerrit Trigger 2.5.3-h-2 installed for Hudson 3.2.0 and above
Comment 8 Matthias Sohn CLA 2016-01-10 17:35:33 EST
(In reply to Winston Prakash from comment #7)
> (In reply to Winston Prakash from comment #5)
> 
> Sorry, I take that back. We did not upgrade Spring after Hudson 3.2.0. So
> Gerrit trigger plugin is 2.5.3-h-2 (released on Mar 26, 2015) is the correct
> version for  Hudson 3.3.2 also.
> 
> BTW, Gerrit Trigger 2.5.3-h-2 would not have worked with 3.0.1. That should
> be Gerrit Trigger 2.5.3-h-1.

after Mikaël downgraded we have gerrit-trigger plugin 2.5.3-h-1.

> Just make sure you have  Gerrit Trigger 2.5.3-h-2 installed for Hudson 3.2.0
> and above

AFAIR after the upgrade we had gerrit-trigger plugin 2.5.3-h2. Though it's possible I did a mistake during the upgrade. I will try it again.

Where do I find the gerrit-trigger plugin 2.5.3-h2 ?
Hudson 3.0.1-b2 which we now again use after the downgrade doesn't show it in Plugin Manager in tab "Updates" or "Available" and http://wiki.hudson-ci.org/display/HUDSON/Plugins currently shows an error message that Confluence isn't available due to some cluster failure
Comment 9 Winston Prakash CLA 2016-01-11 11:49:03 EST
(In reply to Matthias Sohn from comment #8)

Hudson 3.0.1 core has older version of Spring, so gerrit-trigger plugin 2.5.3-h-2 will not work. When you upgrade to Hudson 3.3.2, the initial setup page will automatically pickup gerrit-trigger plugin 2.5.3-h-2 and advise you to upgrade to that version.

Hudson 3.0.1 uses http://hudson-ci.org/PluginCentral/site/3.0/ as Plugin Central, so its update center shows only version  gerrit-trigger plugin 2.5.3-h-1. Where as Hudson 3.3.2 uses http://hudson-ci.org/PluginCentral/site/3.3.2/, so you will see gerrit-trigger plugin 2.5.3-h-2 in its update center. 

If you missed to upgrade the plugins during initial setup, you can upgrade from update center later. We recommend to upgrade plugins at initial setup page, in order to avoid Hudson breaking at startup.


Using multiple Plugin Central helps us to upgrade core libraries, with out affecting older Hudson releases and its plugins.
Comment 10 Pierre-Charles David CLA 2016-01-25 10:15:11 EST
FWIW, we recently upgraded the Sirius HIPP (https://hudson.eclipse.org/sirius) from Hudson 3.0.1-b2 to 3.3.2, and the version of the gerrit-trigger plug-in that we got after the upgrade (2.5.3-h-2) seems to work fine for us, including manual re-triggering of builds.
Comment 11 Matthias Sohn CLA 2016-01-26 06:37:43 EST
thanks for this hint, I will retry the upgrade of our HIPPs
Comment 12 Matthias Sohn CLA 2016-01-26 08:11:15 EST
I upgraded the EGit HIPP again and updated all plugins to the version recommended by the update center. The gerrit-trigger plugin is now version 2.5.3-h-2.
I am unable to update the Dashboard from 2.5-h-1 (Installed) to 2.9.2-h-1.
When trying to update that I get a green checkbox looking like this update succeeded. But after restarting Hudson it's back to the old version.

And manual Gerrit trigger again hits the problem described above. No clue why this seems to work for other HIPPs but not for this one.
Comment 13 Thomas Wolf CLA 2016-01-30 12:41:35 EST
> And manual Gerrit trigger again hits the problem described above. No clue
> why this seems to work for other HIPPs but not for this one.

Indeed it does, also when retriggering a failed build:

Caused by: java.lang.NoSuchMethodError: hudson.model.Hudson.getAuthentication()Lorg/springframework/security/Authentication;
	at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritUserCause.<init>(GerritUserCause.java:93)
	at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger.retriggerThisBuild(GerritTrigger.java:551)
	at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.RetriggerAction.doIndex(RetriggerAction.java:144)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:274)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:141)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:80)
	at org.kohsuke.stapler.MetaClass$2.dispatch(MetaClass.java:140)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:566)
	... 62 more

Unfortunately, we have a few unstable test cases in our test suite (yes, tracking those down and fixing them is on my to-do list), so not being able to retrigger is a nuisance and forces me to upload new patch sets to retrigger.
Comment 14 Matthias Sohn CLA 2016-02-01 05:31:51 EST
(In reply to Thomas Wolf from comment #13)
> > And manual Gerrit trigger again hits the problem described above. No clue
> > why this seems to work for other HIPPs but not for this one.
> 
> Indeed it does, also when retriggering a failed build:
> 
> Caused by: java.lang.NoSuchMethodError:
> hudson.model.Hudson.getAuthentication()Lorg/springframework/security/
> Authentication;
> 	at
> com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritUserCause.
> <init>(GerritUserCause.java:93)
> 	at
...
> Unfortunately, we have a few unstable test cases in our test suite (yes,
> tracking those down and fixing them is on my to-do list), so not being able
> to retrigger is a nuisance and forces me to upload new patch sets to
> retrigger.

I requested rollback of the upgrade in https://bugs.eclipse.org/bugs/show_bug.cgi?id=484915#c6