Exception thrown after upgrade from 2.41.1 to 2.16.2 from SAML plugin

228 views
Skip to first unread message

mike...@aol.com

unread,
Dec 30, 2018, 9:22:34 AM12/30/18
to Repo and Gerrit Discussion
I have painstakingly recompiled my SAML plugin to use a newer version of PAC4J thinking that there was some incompatibility between the new gerrit and the older version of my compiled saml plugin based on the exception I'm seeing thrown in the error_log file. 

I've replaced my existing saml plugin in the /GERRIT_HOME/lib directory with the newly compiled one. The newly compiled one is using PAC4J 2.2.0 instead of the 2.0.0 that I was using in my previous. Why 2.2.0, because that is the highest version that I could get to compile. No other reason.

I've provided a link to the .jar file just incase someone wants to look at it. https://drive.google.com/file/d/1b8gbD0_mLXGnzE8Bfq0qH6j9BfA9aQIJ/view?usp=sharing
At runtime, here is what I am seeing in my logs.  Could use some advice.  
========  SNIP ============
java.lang.NoClassDefFoundError: org/apache/velocity/runtime/log/LogChute

 at java
.lang.ClassLoader.defineClass1(Native Method)

 at java
.lang.ClassLoader.defineClass(ClassLoader.java:763)

 at java
.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

 at java
.net.URLClassLoader.defineClass(URLClassLoader.java:468)

 at java
.net.URLClassLoader.access$100(URLClassLoader.java:74)

 at java
.net.URLClassLoader$1.run(URLClassLoader.java:369)

 at java
.net.URLClassLoader$1.run(URLClassLoader.java:363)

 at java
.security.AccessController.doPrivileged(Native Method)

 at java
.net.URLClassLoader.findClass(URLClassLoader.java:362)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:424)

 at java
.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:817)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:357)

 at org
.pac4j.saml.util.VelocityEngineFactory.getEngine(VelocityEngineFactory.java:30)

 at org
.pac4j.saml.sso.impl.SAML2WebSSOMessageSender.getMessageEncoder(SAML2WebSSOMessageSender.java:144)

 at org
.pac4j.saml.sso.impl.SAML2WebSSOMessageSender.sendMessage(SAML2WebSSOMessageSender.java:59)

 at org
.pac4j.saml.sso.impl.SAML2WebSSOMessageSender.sendMessage(SAML2WebSSOMessageSender.java:31)

 at org
.pac4j.saml.sso.impl.SAML2WebSSOProfileHandler.send(SAML2WebSSOProfileHandler.java:30)

 at org
.pac4j.saml.sso.impl.SAML2WebSSOProfileHandler.send(SAML2WebSSOProfileHandler.java:16)

 at org
.pac4j.saml.redirect.SAML2RedirectActionBuilder.redirect(SAML2RedirectActionBuilder.java:42)

 at org
.pac4j.core.client.IndirectClient.getRedirectAction(IndirectClient.java:99)

 at org
.pac4j.core.client.IndirectClient.redirect(IndirectClient.java:68)

 at com
.thesamet.gerrit.plugins.saml.SamlWebFilter.redirectToIdentityProvider(SamlWebFilter.java:179)

 at com
.thesamet.gerrit.plugins.saml.SamlWebFilter.doFilter(SamlWebFilter.java:154)

 at org
.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)

 at org
.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)

 at org
.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)

 at org
.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)

 at org
.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)

 at org
.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)

 at org
.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)

 at org
.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)

 at org
.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)

 at org
.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)

 at org
.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)

 at org
.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)

 at org
.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

 at org
.eclipse.jetty.server.Server.handle(Server.java:503)

 at org
.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)

 at org
.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)

 at org
.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)

 at org
.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)

 at org
.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)

 at org
.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)

 at org
.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)

 at org
.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)

 at org
.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)

 at org
.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)

 at org
.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)

 at org
.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)

 at java
.lang.Thread.run(Thread.java:748)

Caused by: java.lang.ClassNotFoundException: org.apache.velocity.runtime.log.LogChute

 at java
.net.URLClassLoader.findClass(URLClassLoader.java:382)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:424)

 at java
.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:817)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:357)

 
... 50 more

mat...@unsolvable.org

unread,
Dec 30, 2018, 9:32:49 AM12/30/18
to Repo and Gerrit Discussion

mike...@aol.com

unread,
Dec 30, 2018, 9:47:20 AM12/30/18
to Repo and Gerrit Discussion
Mat,
Sorry I'm not using any mail templates.
I did remove the *.vm.* templates from /etc/mail just to be sure.. 
Restarted gerrit. Yet still, see the same error with the SAML plugin.

Could it be that the SAML plugin needs to be updated to not use velocity?
Link to the SAML plugin code.

mat...@unsolvable.org

unread,
Dec 30, 2018, 1:09:10 PM12/30/18
to Repo and Gerrit Discussion
On Sunday, 30 December 2018 14:47:20 UTC, mike...@aol.com wrote:
Mat,
Sorry I'm not using any mail templates.
I did remove the *.vm.* templates from /etc/mail just to be sure.. 
Restarted gerrit. Yet still, see the same error with the SAML plugin.

Could it be that the SAML plugin needs to be updated to not use velocity?
Link to the SAML plugin code.

Yep, looks like the SAML plugin itself uses Velocity, which means it won't work with 2.16 until that is changed. 

mike...@aol.com

unread,
Dec 30, 2018, 1:14:30 PM12/30/18
to mat...@unsolvable.org, repo-d...@googlegroups.com
Looks like David O is on it. He's got some PRs pushed up to the http://github.com/thesamet/gerrit-saml-plugin. He even bazel-ized it. Thank God for that because compiling with sbt surely sucks.

Anyway...I started working with him to test.  

Thanks for answer.
Mike


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/aPfJX6T0n0k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lucamilanesio

unread,
Jan 3, 2019, 10:52:24 AM1/3/19
to Repo and Gerrit Discussion
The current plugin maintainer has given the agreement to fork his repository and continue the project on gerrit-review.googlesource.com (see [1]).

I propose to create a project (oops, repository) as follows:

name: plugins/saml
description: Plugin for Gerrit authentication with a SAML provider 

New maintainer: David Ostrovsky volunteered to continue to support the development

David Ostrovsky

unread,
Jan 3, 2019, 11:16:14 AM1/3/19
to Repo and Gerrit Discussion

Am Donnerstag, 3. Januar 2019 16:52:24 UTC+1 schrieb lucamilanesio:
The current plugin maintainer has given the agreement to fork his repository and continue the project on gerrit-review.googlesource.com (see [1]).

I propose to create a project (oops, repository) as follows:

name: plugins/saml
description: Plugin for Gerrit authentication with a SAML provider 


+1. Can you import the project from GH?

New maintainer: David Ostrovsky volunteered to continue to support the development


With the help of the community ;-)

Luca Milanesio

unread,
Jan 3, 2019, 11:17:20 AM1/3/19
to David Ostrovsky, Luca Milanesio, Repo and Gerrit Discussion

On 3 Jan 2019, at 16:16, David Ostrovsky <david.o...@gmail.com> wrote:


Am Donnerstag, 3. Januar 2019 16:52:24 UTC+1 schrieb lucamilanesio:
The current plugin maintainer has given the agreement to fork his repository and continue the project on gerrit-review.googlesource.com (see [1]).

I propose to create a project (oops, repository) as follows:

name: plugins/saml
description: Plugin for Gerrit authentication with a SAML provider 


+1. Can you import the project from GH?

We should: the plugin's owner has already signed the CLA in the past.


New maintainer: David Ostrovsky volunteered to continue to support the development


With the help of the community ;-)

Happy to help :-)

You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Joe Hansche

unread,
Jan 3, 2019, 11:37:37 AM1/3/19
to Repo and Gerrit Discussion


On Thursday, January 3, 2019 at 10:52:24 AM UTC-5, lucamilanesio wrote:
The current plugin maintainer has given the agreement to fork his repository and continue the project on gerrit-review.googlesource.com (see [1]).

I propose to create a project (oops, repository) as follows:

name: plugins/saml
description: Plugin for Gerrit authentication with a SAML provider 

Note: maybe to follow other existing names, it might be better to namespace this with `plugins/auth-saml`, to indicate that it's a plugin that augments the authentication subsystem?

Luca Milanesio

unread,
Jan 3, 2019, 12:02:45 PM1/3/19
to Joe Hansche, Luca Milanesio, Repo and Gerrit Discussion

On 3 Jan 2019, at 16:37, 'Joe Hansche' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:



On Thursday, January 3, 2019 at 10:52:24 AM UTC-5, lucamilanesio wrote:
The current plugin maintainer has given the agreement to fork his repository and continue the project on gerrit-review.googlesource.com (see [1]).

I propose to create a project (oops, repository) as follows:

name: plugins/saml
description: Plugin for Gerrit authentication with a SAML provider 

Note: maybe to follow other existing names, it might be better to namespace this with `plugins/auth-saml`, to indicate that it's a plugin that augments the authentication subsystem?

Good idea, however, the other auth plugins do not start with auth at all :-O

- OAuth => oauth
- GitHub auth => github
- Cloudfoundry auth => cfoauth

You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Joe Hansche

unread,
Jan 3, 2019, 12:07:27 PM1/3/19
to Repo and Gerrit Discussion


On Thursday, January 3, 2019 at 12:02:45 PM UTC-5, lucamilanesio wrote:


On 3 Jan 2019, at 16:37, 'Joe Hansche' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:



On Thursday, January 3, 2019 at 10:52:24 AM UTC-5, lucamilanesio wrote:
The current plugin maintainer has given the agreement to fork his repository and continue the project on gerrit-review.googlesource.com (see [1]).

I propose to create a project (oops, repository) as follows:

name: plugins/saml
description: Plugin for Gerrit authentication with a SAML provider 

Note: maybe to follow other existing names, it might be better to namespace this with `plugins/auth-saml`, to indicate that it's a plugin that augments the authentication subsystem?

Good idea, however, the other auth plugins do not start with auth at all :-O

- OAuth => oauth
- GitHub auth => github
- Cloudfoundry auth => cfoauth


Doh, disregard then 🤷‍♂️

lucamilanesio

unread,
Jan 5, 2019, 5:34:46 PM1/5/19
to Repo and Gerrit Discussion


On Thursday, January 3, 2019 at 4:17:20 PM UTC, lucamilanesio wrote:


On 3 Jan 2019, at 16:16, David Ostrovsky <david.o...@gmail.com> wrote:


Am Donnerstag, 3. Januar 2019 16:52:24 UTC+1 schrieb lucamilanesio:
The current plugin maintainer has given the agreement to fork his repository and continue the project on gerrit-review.googlesource.com (see [1]).

I propose to create a project (oops, repository) as follows:

name: plugins/saml
description: Plugin for Gerrit authentication with a SAML provider 


+1. Can you import the project from GH?

We should: the plugin's owner has already signed the CLA in the past.

The repository has been created:

I could not import anything beyond the SHA=6b0ae2792764077bed660b7b78bed874b95dcc17, the last commit made purely by the plugin original author (Nadav Samet) who has a CLA signed.
The other commits were not major but have come through merge of PRs and thus authored by people that:
a) Have not explicitly agreed to have their name and commits published to gerrit-review
b) Have not signed any CLA and are not even valid accounts on gerrit-review

They are not major contributions anyway, I'm sure that the Gerrit community can fill the gaps from now on.

@Nadav, @DavidO and me are the current owners and maintainers of the plugin.

I've amended the Gerrit-CI build to fetch from Gerrit-Review:

... and take the freedom to fix the master build which was broken :-)
(simple versions updates)

Luca.

 

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages