SAML Plugin with Gerrit and GUICE exceptions at startup.

31 views
Skip to first unread message

mike...@aol.com

unread,
Sep 24, 2025, 11:01:54 AM (3 days ago) Sep 24
to Repo and Gerrit Discussion
Hi All, 
I have the gerrit.war file, version 3.12.2.
I have the Saml plugin downloaded from the master branch installed at /gerrit/lib and that is version 2a24daff4f. It seems it's only available on the master branch from https://gerrit-ci.gerritforge.com/plugin-manager/

When I start gerrit, I see the call stack (as pasted below) in the error logs.
I've searched the google group conversations and am not landing on anything that directly applies. I believe I have version harmony between gerrit and the SAML plugin.
How can I resolve this?  

Thanks!

[2025-09-24T14:37:56.188Z] [main] INFO  com.google.gerrit.server.git.WorkQueue : Adding metrics for 'SshCommandStart' queue
[2025-09-24T14:37:56.219Z] [main] WARN  com.google.gerrit.sshd.HostKeyProvider : Only an ssh-rsa host key type exists. This is a weak key type, consider adding newer key types by running gerrit init.
[2025-09-24T14:37:56.316Z] [main] INFO  com.google.gerrit.server.git.WorkQueue : Adding metrics for 'SSH-Stream-Worker' queue
[2025-09-24T14:37:56.317Z] [main] INFO  com.google.gerrit.server.git.WorkQueue : Adding metrics for 'SSH-Interactive-Worker' queue
[2025-09-24T14:37:56.318Z] [main] INFO  com.google.gerrit.server.git.WorkQueue : Adding metrics for 'SSH-Batch-Worker' queue
[2025-09-24T14:37:56.318Z] [main] INFO  com.google.gerrit.server.git.WorkQueue : Adding metrics for 'MigrateExternalIdCase' queue
[2025-09-24T14:37:56.525Z] [main] INFO  org.eclipse.jetty.util.log : Logging initialized @5588ms to org.eclipse.jetty.util.log.Slf4jLog
[2025-09-24T14:37:56.615Z] [main] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) [Guice/ErrorInjectingConstructor]: IllegalArgumentException: Unable to instantiate front-end HTTP Filter SamlWebFilter
  at JettyServer.<init>(JettyServer.java:218)
  at JettyModule.configure(JettyModule.java:31)
  while locating JettyServer

Learn more:
  https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR
Caused by: IllegalArgumentException: Unable to instantiate front-end HTTP Filter SamlWebFilter
at JettyServer.makeContext(JettyServer.java:562)
at JettyServer.makeContext(JettyServer.java:504)
at JettyServer.<init>(JettyServer.java:258)
at JettyServer$$FastClassByGuice$$44e64881.GUICE$TRAMPOLINE(<generated>)
at JettyServer$$FastClassByGuice$$44e64881.apply(<generated>)
at DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
at ConstructorInjector.provision(ConstructorInjector.java:114)
at ConstructorInjector.construct(ConstructorInjector.java:91)
at ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
at ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at SingletonScope$1.get(SingletonScope.java:169)
at InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
at InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)
at InternalInjectorCreator.build(InternalInjectorCreator.java:113)
at InjectorImpl.createChildInjector(InjectorImpl.java:240)
at Daemon.createHttpdInjector(Daemon.java:694)
at Daemon.initHttpd(Daemon.java:645)
at Daemon.start(Daemon.java:412)
at Daemon.run(Daemon.java:303)
at AbstractProgram.main(AbstractProgram.java:62)
at java.base/DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/Method.invoke(Method.java:580)
at GerritLauncher.invokeProgram(GerritLauncher.java:251)
at GerritLauncher.mainImpl(GerritLauncher.java:147)
at GerritLauncher.main(GerritLauncher.java:92)
at Main.main(Main.java:30)
Caused by: ConfigurationException: Guice configuration errors:

1) [Guice/MissingImplementation]: No implementation for Set<String> annotated with @AuthHeaders() was bound.

Requested by:
1  : SamlWebFilter.<init>(SamlWebFilter.java:92)
      \_ for 5th parameter authHeaders
     while locating SamlWebFilter

Learn more:
  https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION

1 error

======================
Full classname legend:
======================
AuthHeaders:   "com.googlesource.gerrit.plugins.saml.AuthHeaders"
SamlWebFilter: "com.googlesource.gerrit.plugins.saml.SamlWebFilter"
========================
End of classname legend:
========================

at InjectorImpl.getProvider(InjectorImpl.java:1174)
at InjectorImpl.getProvider(InjectorImpl.java:1134)
at InjectorImpl.getInstance(InjectorImpl.java:1186)
at JettyServer.makeContext(JettyServer.java:546)
... 26 more

2) [Guice/ErrorInjectingConstructor]: IllegalArgumentException: Unable to instantiate front-end HTTP Filter SamlWebFilter
  at JettyServer.<init>(JettyServer.java:218)
  at JettyModule.configure(JettyModule.java:31)
  at JettyMetrics.<init>(JettyMetrics.java:29)
      \_ for 1st parameter jetty
  at JettyModule.configure(JettyModule.java:34)
  while locating JettyMetrics

Learn more:
  https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR
Caused by: IllegalArgumentException: Unable to instantiate front-end HTTP Filter SamlWebFilter
at JettyServer.makeContext(JettyServer.java:562)
at JettyServer.makeContext(JettyServer.java:504)
at JettyServer.<init>(JettyServer.java:258)
at JettyServer$$FastClassByGuice$$44e64881.GUICE$TRAMPOLINE(<generated>)
at JettyServer$$FastClassByGuice$$44e64881.apply(<generated>)
at DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
at ConstructorInjector.provision(ConstructorInjector.java:114)
at ConstructorInjector.construct(ConstructorInjector.java:91)
at ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
at ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at SingletonScope$1.get(SingletonScope.java:169)
at InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at SingleParameterInjector.inject(SingleParameterInjector.java:40)
at SingleParameterInjector.getAll(SingleParameterInjector.java:60)
at ConstructorInjector.provision(ConstructorInjector.java:113)
at ConstructorInjector.construct(ConstructorInjector.java:91)
at ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
at ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at SingletonScope$1.get(SingletonScope.java:169)
at InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
at InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)
at InternalInjectorCreator.build(InternalInjectorCreator.java:113)
at InjectorImpl.createChildInjector(InjectorImpl.java:240)
at Daemon.createHttpdInjector(Daemon.java:694)
at Daemon.initHttpd(Daemon.java:645)
at Daemon.start(Daemon.java:412)
at Daemon.run(Daemon.java:303)
at AbstractProgram.main(AbstractProgram.java:62)
at java.base/DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/Method.invoke(Method.java:580)
at GerritLauncher.invokeProgram(GerritLauncher.java:251)
at GerritLauncher.mainImpl(GerritLauncher.java:147)
at GerritLauncher.main(GerritLauncher.java:92)
at Main.main(Main.java:30)
Caused by: ConfigurationException: Guice configuration errors:

1) [Guice/MissingImplementation]: No implementation for Set<String> annotated with @AuthHeaders() was bound.

Requested by:
1  : SamlWebFilter.<init>(SamlWebFilter.java:92)
      \_ for 5th parameter authHeaders
     while locating SamlWebFilter

Learn more:
  https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION

1 error

======================
Full classname legend:
======================
AuthHeaders:   "com.googlesource.gerrit.plugins.saml.AuthHeaders"
SamlWebFilter: "com.googlesource.gerrit.plugins.saml.SamlWebFilter"
========================
End of classname legend:
========================

at InjectorImpl.getProvider(InjectorImpl.java:1174)
at InjectorImpl.getProvider(InjectorImpl.java:1134)
at InjectorImpl.getInstance(InjectorImpl.java:1186)
at JettyServer.makeContext(JettyServer.java:546)
... 34 more

2 errors

======================
Full classname legend:
======================
AbstractProgram:                                "com.google.gerrit.pgm.util.AbstractProgram"
ConfigurationException:                         "com.google.inject.ConfigurationException"
ConstructorBindingImpl$Factory:                 "com.google.inject.internal.ConstructorBindingImpl$Factory"
ConstructorInjector:                            "com.google.inject.internal.ConstructorInjector"
Daemon:                                         "com.google.gerrit.pgm.Daemon"
DefaultConstructionProxyFactory$FastClassProxy: "com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy"
DirectMethodHandleAccessor:                     "jdk.internal.reflect.DirectMethodHandleAccessor"
GerritLauncher:                                 "com.google.gerrit.launcher.GerritLauncher"
InjectorImpl:                                   "com.google.inject.internal.InjectorImpl"
InternalFactoryToProviderAdapter:               "com.google.inject.internal.InternalFactoryToProviderAdapter"
InternalInjectorCreator:                        "com.google.inject.internal.InternalInjectorCreator"
JettyMetrics:                                   "com.google.gerrit.pgm.http.jetty.JettyMetrics"
JettyModule:                                    "com.google.gerrit.pgm.http.jetty.JettyModule"
JettyServer:                                    "com.google.gerrit.pgm.http.jetty.JettyServer"
JettyServer$$FastClassByGuice$$44e64881:        "com.google.gerrit.pgm.http.jetty.JettyServer$$FastClassByGuice$$44e64881"
Method:                                         "java.lang.reflect.Method"
ProviderToInternalFactoryAdapter:               "com.google.inject.internal.ProviderToInternalFactoryAdapter"
SamlWebFilter:                                  "com.googlesource.gerrit.plugins.saml.SamlWebFilter"
SingleParameterInjector:                        "com.google.inject.internal.SingleParameterInjector"
SingletonScope$1:                               "com.google.inject.internal.SingletonScope$1"
========================
End of classname legend:
========================

at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:589)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:190)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:113)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:240)
at com.google.gerrit.pgm.Daemon.createHttpdInjector(Daemon.java:694)
at com.google.gerrit.pgm.Daemon.initHttpd(Daemon.java:645)
at com.google.gerrit.pgm.Daemon.start(Daemon.java:412)
at com.google.gerrit.pgm.Daemon.run(Daemon.java:303)
at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:62)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:251)
at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:147)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:92)
at Main.main(Main.java:30)



Luca Milanesio

unread,
Sep 25, 2025, 2:14:32 PM (2 days ago) Sep 25
to Repo and Gerrit Discussion, Luca Milanesio

On 24 Sep 2025, at 16:01, 'mike...@aol.com' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:

Hi All, 
I have the gerrit.war file, version 3.12.2.
I have the Saml plugin downloaded from the master branch installed at /gerrit/lib and that is version 2a24daff4f. It seems it's only available on the master branch from https://gerrit-ci.gerritforge.com/plugin-manager/


Correct, there isn’t a build available yet.
Did you build the code from source? Or did you use the SAML built on master on top of Gerrit v3.12.2?

When I start gerrit, I see the call stack (as pasted below) in the error logs.
I've searched the google group conversations and am not landing on anything that directly applies. I believe I have version harmony between gerrit and the SAML plugin.
How can I resolve this?  

It looks like you are the first one using it, I’d suggest to:
1) Build from source and run the tests
2) If tests are successful, debug on the point of failure

HTH

Luca.

--
--
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 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.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/c1824c35-50fe-4e91-8ecb-6448b6f4c95an%40googlegroups.com.

mike...@aol.com

unread,
Sep 25, 2025, 3:04:00 PM (2 days ago) Sep 25
to Repo and Gerrit Discussion, Luca Milanesio
Hi Luca,
Yep, I am the first. I did pull the saml plugin code from the saml plugin repo master.
Also, the build instructions seem stale. I had to ln -s the saml repo into <gerrit_code_root>/plugins and add a reference to it inside a yaml file. 
I was able to build it successfully with issuing bazelisk build plugins:core
After that, i get a runtime exception on startup. 

I did my best to debug this. The issue seems to me that there is a binding lacking.  I am no java expert. At all. I did ask github copilot. It suggested adding something like this in the Module.java file. 

    bind(new TypeLiteral<HashSet<String>>() {}).annotatedWith(AuthHeaders.class).toInstance(new HashSet<>());
... in context...
public class Module extends AbstractModule {
  @Override
  protected void configure() {
    bind(SamlConfig.class);
    bind(SAML2Client.class).toProvider(SamlClientProvider.class);
    bind(new TypeLiteral<HashSet<String>>() {}).annotatedWith(AuthHeaders.class).toInstance(new HashSet<>());
  }
but after adding that, the saml plugin utterly fails to build. So IDK what the actual proper syntax would be.

For history sake, here is the git branches involved.
> plugins ((HEAD detached at v3.12.2)) $ cd saml
> saml (master) $ 
Where saml (master) is 2a24daff4f65952f095f61bc9967fc20ac882d29 from Nov 4th 2024. 

Finally, my workaround....
What I had to do was to revert back to gerrit 3.6.4 which was still running on the server I migrated from. The SAML plugin was from that same era. 

Thanks!
Mike 
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/2nnCbaucBW0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.

To view this discussion visit

Luca Milanesio

unread,
Sep 26, 2025, 3:41:35 AM (yesterday) Sep 26
to Repo and Gerrit Discussion, Luca Milanesio

On 25 Sep 2025, at 20:03, mike...@aol.com wrote:

Hi Luca,
Yep, I am the first. I did pull the saml plugin code from the saml plugin repo master.
Also, the build instructions seem stale. I had to ln -s the saml repo into <gerrit_code_root>/plugins and add a reference to it inside a yaml file. 
I was able to build it successfully with issuing bazelisk build plugins:core
After that, i get a runtime exception on startup. 

I did my best to debug this. The issue seems to me that there is a binding lacking.  I am no java expert. At all. I did ask github copilot. It suggested adding something like this in the Module.java file. 

    bind(new TypeLiteral<HashSet<String>>() {}).annotatedWith(AuthHeaders.class).toInstance(new HashSet<>());
... in context...
public class Module extends AbstractModule {
  @Override
  protected void configure() {
    bind(SamlConfig.class);
    bind(SAML2Client.class).toProvider(SamlClientProvider.class);
    bind(new TypeLiteral<HashSet<String>>() {}).annotatedWith(AuthHeaders.class).toInstance(new HashSet<>());
  }
but after adding that, the saml plugin utterly fails to build. So IDK what the actual proper syntax would be.

As you may know, GitHub copilot isn’t a Java expert either; it just gets the code from other projects and puts it in a plausible way.
There is no logic or understanding of what it’s doing, just syntax.

I wouldn’t use it for solving Gerrit issues if I were you.

For history sake, here is the git branches involved.
> plugins ((HEAD detached at v3.12.2)) $ cd saml
> saml (master) $ 
Where saml (master) is 2a24daff4f65952f095f61bc9967fc20ac882d29 from Nov 4th 2024. 

Finally, my workaround....
What I had to do was to revert back to gerrit 3.6.4 which was still running on the server I migrated from. The SAML plugin was from that same era. 

Sounds great, thanks for sharing it.

Luca.
Reply all
Reply to author
Forward
0 new messages