gerrit-oauth-provider icon indicating copy to clipboard operation
gerrit-oauth-provider copied to clipboard

client-secret is added to secure.config (Was: Cannot start gerrit after install)

Open filviu opened this issue 10 years ago • 17 comments

I installed the plugin following the build instructions from the README. I created the google project and obtained the proper API id and secret. Yest starting gerrit produces the following errors:

CentOS 7 Gerrit 2.10.2 gerrit-oauth-provider from master

[2015-04-08 20:41:43,397] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /app/gerrit/jentla_review/cache
[2015-04-08 20:41:44,483] INFO  com.google.gerrit.server.config.ScheduleConfig : gc schedule parameter "gc.interval" is not configured
[2015-04-08 20:41:45,566] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher arcfour256: invalid parameter passed to RC4 init - org.bouncycastle.crypto.params.ParametersWithIV
[2015-04-08 20:41:45,566] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher arcfour128: invalid parameter passed to RC4 init - org.bouncycastle.crypto.params.ParametersWithIV
[2015-04-08 20:41:45,600] WARN  com.google.gerrit.httpd.GitWebConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2015-04-08 20:41:45,902] INFO  org.eclipse.jetty.util.log : Logging initialized @6299ms
[2015-04-08 20:41:46,251] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 196m
[2015-04-08 20:41:46,281] INFO  com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /app/gerrit/jentla_review/plugins
[2015-04-08 20:41:46,372] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin gerrit-oauth-provider, version v2.10.1-5-ge618be0
[2015-04-08 20:41:47,007] INFO  com.google.gerrit.sshd.SshDaemon : Started Gerrit SSHD-CORE-0.9.0-4-G5967CFD on *:29418
[2015-04-08 20:41:47,011] INFO  org.eclipse.jetty.server.Server : jetty-9.2.1.v20140609
[2015-04-08 20:41:47,129] WARN  org.eclipse.jetty.util.component.AbstractLifeCycle : FAILED o.e.j.s.ServletContextHandler@265ae4b8{/,file:/home/gerrit2/.gerritcodereview/tmp/gerrit_6431819335175045762_app/gerrit_war/,STARTING}: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Invalid Api secret
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:69)
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.class(GoogleOAuthService.java:55)
  while locating com.googlesource.gerrit.plugins.oauth.GoogleOAuthService
  while locating com.google.gerrit.extensions.auth.oauth.OAuthServiceProvider annotated with @com.google.gerrit.extensions.annotations.Export(value=-google-oauth)

1 error
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Invalid Api secret
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:69)
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.class(GoogleOAuthService.java:55)
  while locating com.googlesource.gerrit.plugins.oauth.GoogleOAuthService
  while locating com.google.gerrit.extensions.auth.oauth.OAuthServiceProvider annotated with @com.google.gerrit.extensions.annotations.Export(value=-google-oauth)

1 error
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1018)
        at com.google.gerrit.httpd.auth.oauth.OAuthWebFilter.pickSSOServiceProvider(OAuthWebFilter.java:215)
        at com.google.gerrit.httpd.auth.oauth.OAuthWebFilter.init(OAuthWebFilter.java:80)
        at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:112)
        at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:99)
        at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:220)
        at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:137)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:831)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:300)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:744)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.server.Server.start(Server.java:357)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
        at org.eclipse.jetty.server.Server.doStart(Server.java:324)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:125)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:292)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:204)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
        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 com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
        at Main.main(Main.java:25)
Caused by: java.lang.IllegalArgumentException: Invalid Api secret
        at org.scribe.utils.Preconditions.check(Preconditions.java:84)
        at org.scribe.utils.Preconditions.checkEmptyString(Preconditions.java:44)
        at org.scribe.builder.ServiceBuilder.apiSecret(ServiceBuilder.java:113)
        at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:79)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:86)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
        ... 29 more
[2015-04-08 20:41:47,137] INFO  org.eclipse.jetty.server.ServerConnector : Started ServerConnector@56bb488b{HTTP/1.1}{0.0.0.0:8090}
[2015-04-08 20:41:47,139] WARN  org.eclipse.jetty.util.component.AbstractLifeCycle : FAILED org.eclipse.jetty.server.Server@7496e37c: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Invalid Api secret
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:69)
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.class(GoogleOAuthService.java:55)
  while locating com.googlesource.gerrit.plugins.oauth.GoogleOAuthService
  while locating com.google.gerrit.extensions.auth.oauth.OAuthServiceProvider annotated with @com.google.gerrit.extensions.annotations.Export(value=-google-oauth)

1 error
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Invalid Api secret
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:69)
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.class(GoogleOAuthService.java:55)
  while locating com.googlesource.gerrit.plugins.oauth.GoogleOAuthService
  while locating com.google.gerrit.extensions.auth.oauth.OAuthServiceProvider annotated with @com.google.gerrit.extensions.annotations.Export(value=-google-oauth)

1 error
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1018)
        at com.google.gerrit.httpd.auth.oauth.OAuthWebFilter.pickSSOServiceProvider(OAuthWebFilter.java:215)
        at com.google.gerrit.httpd.auth.oauth.OAuthWebFilter.init(OAuthWebFilter.java:80)
        at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:112)
        at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:99)
        at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:220)
        at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:137)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:831)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:300)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:744)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.server.Server.start(Server.java:357)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
        at org.eclipse.jetty.server.Server.doStart(Server.java:324)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:125)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:292)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:204)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
        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 com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
        at Main.main(Main.java:25)
Caused by: java.lang.IllegalArgumentException: Invalid Api secret
        at org.scribe.utils.Preconditions.check(Preconditions.java:84)
        at org.scribe.utils.Preconditions.checkEmptyString(Preconditions.java:44)
        at org.scribe.builder.ServiceBuilder.apiSecret(ServiceBuilder.java:113)
        at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:79)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:86)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
        ... 29 more
[2015-04-08 20:41:47,140] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
java.lang.IllegalStateException: Cannot start HTTP daemon
        at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:139)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:292)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:204)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
        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 com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
        at Main.main(Main.java:25)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.IllegalArgumentException: Invalid Api secret
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:69)
  at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.class(GoogleOAuthService.java:55)
  while locating com.googlesource.gerrit.plugins.oauth.GoogleOAuthService
  while locating com.google.gerrit.extensions.auth.oauth.OAuthServiceProvider annotated with @com.google.gerrit.extensions.annotations.Export(value=-google-oauth)

1 error
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1018)
        at com.google.gerrit.httpd.auth.oauth.OAuthWebFilter.pickSSOServiceProvider(OAuthWebFilter.java:215)
        at com.google.gerrit.httpd.auth.oauth.OAuthWebFilter.init(OAuthWebFilter.java:80)
        at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:112)
        at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:99)
        at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:220)
        at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:137)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:831)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:300)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:744)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.server.Server.start(Server.java:357)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
        at org.eclipse.jetty.server.Server.doStart(Server.java:324)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:125)
        ... 12 more
Caused by: java.lang.IllegalArgumentException: Invalid Api secret
        at org.scribe.utils.Preconditions.check(Preconditions.java:84)
        at org.scribe.utils.Preconditions.checkEmptyString(Preconditions.java:44)
        at org.scribe.builder.ServiceBuilder.apiSecret(ServiceBuilder.java:113)
        at com.googlesource.gerrit.plugins.oauth.GoogleOAuthService.<init>(GoogleOAuthService.java:79)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:86)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
        ... 29 more
[2015-04-08 20:41:47,500] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot build BloomFilter for jdbc:h2:file:/app/gerrit/jentla_review/cache/diff
org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-174]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
        at org.h2.message.DbException.get(DbException.java:172)
        at org.h2.message.DbException.get(DbException.java:149)
        at org.h2.message.DbException.get(DbException.java:138)
        at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1413)
        at org.h2.jdbc.JdbcStatement.checkClosed(JdbcStatement.java:980)
        at org.h2.jdbc.JdbcStatement.checkClosed(JdbcStatement.java:954)
        at org.h2.jdbc.JdbcResultSet.checkClosed(JdbcResultSet.java:3102)
        at org.h2.jdbc.JdbcResultSet.checkColumnIndex(JdbcResultSet.java:3086)
        at org.h2.jdbc.JdbcResultSet.get(JdbcResultSet.java:3116)
        at org.h2.jdbc.JdbcResultSet.getObject(JdbcResultSet.java:488)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$KeyType.get(H2CacheImpl.java:248)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.buildBloomFilter(H2CacheImpl.java:382)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.open(H2CacheImpl.java:337)
        at com.google.gerrit.server.cache.h2.H2CacheImpl.start(H2CacheImpl.java:167)
        at com.google.gerrit.server.cache.h2.H2CacheFactory$1.run(H2CacheFactory.java:113)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

This is my configuration:

[gerrit]
        basePath = git
        canonicalWebUrl = http://gerrit.
[database]
        type = jdbc
        username = gerrit2
        url = jdbc:mysql://localhost:3306/reviewdb?user=xxx&password=xxx&useUnicode=true&characterEncoding=utf8
        driver = com.mysql.jdbc.Driver
[auth]
        type = OAUTH
[sendemail]
        smtpServer = localhost
[container]
        user = gerrit2
        javaHome = /usr/lib/jvm/java-openjdk/jre
[sshd]
        listenAddress = *:1234
[httpd]
        listenUrl = proxy-http://*:8090/
[cache]
        directory = cache
[index]
        type = LUCENE
[plugin "gerrit-oauth-provider-google-oauth"]
        client-id = 7xxxxxx
        link-to-existing-openid-accounts = true

What am I doing wrong? I would appreciate any hints.

Thanks

filviu avatar Apr 08 '15 11:04 filviu

client-secret option is missing.

davido avatar Apr 08 '15 17:04 davido

Yes, that was it, but strangely enough I followed the -d init procedure a few times and each time I entered the client-secret correctly, I assumed that it's stored someplace else.

Thanks

filviu avatar Apr 09 '15 06:04 filviu

Upon further checking the secret was added to secure.config but it's not read from there, I had to move it to gerrit.conf

filviu avatar Apr 09 '15 06:04 filviu

Yes, I changed it recently, and I thought I tested it. When it fails to read from secure.config then it's serious bug.

davido avatar Apr 09 '15 09:04 davido

Works here as expected. The problem must be on your side. Verify, that

gerrit.config contains something like that:

[plugin "gerrit-oauth-provider-google-oauth"]
    client-id = <id>
    link-to-existing-openid-accounts = true

And secure.config contains something like:

[plugin "gerrit-oauth-provider-google-oauth"]
    client-secret = <secret>

davido avatar Apr 12 '15 06:04 davido

It didn't work for me; had to move client-secret as I wrote above. Unfortunately I can't test further as I am one week away and we already moved to PR, and the ST where I tested will be gone by than.

Works here as expected. The problem must be on your side. Verify, that

gerrit.config contains something like that:

[plugin "gerrit-oauth-provider-google-oauth"] client-id = link-to-existing-openid-accounts = true

And secure.config contains something like:

[plugin "gerrit-oauth-provider-google-oauth"] client-secret =

— Reply to this email directly or view it on GitHub https://github.com/davido/gerrit-oauth-provider/issues/18#issuecomment-91997623 .

filviu avatar Apr 12 '15 13:04 filviu

I had exactly the same problem as @silviuvulcan, and the same work around worked for me.

brianmay avatar Apr 22 '15 01:04 brianmay

The same problem also happens with github as well as Google. It works fine with the secrets are put in gerrit.config.

brianmay avatar Apr 22 '15 01:04 brianmay

when login with this plugin i had a error

'''

  1. That’s an error.

Error: redirect_uri_mismatch

Application: Gerrit

You can email the developer of this application at:

The redirect URI in the request: http://domain/oauth did not match a registered redirect URI. '''

what's I wrong? Do you have any suggestion @davido ?

I guest I have to add redirect url into gerrit.config, am I wrong?

lyhoanglong avatar Apr 22 '15 04:04 lyhoanglong

@lyhoanglong Please can you open a new ticket; that has nothing to do with this ticket on the location of the secrets. Thanks

brianmay avatar Apr 22 '15 04:04 brianmay

@brianmay I'm sorry. I'll open a new ticket.

lyhoanglong avatar Apr 22 '15 04:04 lyhoanglong

Can someone who can reproduce the problem set up dev environment and try to debug it? Alternatively I could add some verbose log statements.

davido avatar Apr 22 '15 05:04 davido

If you can produce a test version with verbose log statements that works with Gerrit 2.11 I should be able to test it for you.

brianmay avatar Apr 22 '15 06:04 brianmay

Thanks. Will do it, upload to my site and let you know.

davido avatar Apr 22 '15 06:04 davido

Hope I didn't miss anything, as I haven't heard from you since that last email.

Thanks

brianmay avatar May 01 '15 06:05 brianmay

Nope. Was busy with other stuff.

davido avatar May 01 '15 07:05 davido

Ok. Let me know when you want me to test it.

brianmay avatar May 21 '15 06:05 brianmay