Error in loading global properties in sonar server after an upgrade to postgreSQL11

Must-share information (formatted with Markdown):
We are seeing an unexpected error after the migration to postgreSQL11. An execution failure is noted while loading global settings. The error reported is
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘GlobalServerSettings’ defined in

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    9.5.0.56709
  • what are you trying to achieve
    Upgrade postgreSQL 9.6 to postgreSQL11 on the above version of sonar.
  • what have you tried so far to achieve this
    1.Database migrated
  1. We have run VACCUM ANALYSE as per this thread
    SonarQube becomes slow after PostgreSQL upgrade
  2. Tried a few analysis on java, c++ languages. Analysis is indefinitely waiting to return quality gate status or looks the process itself is not finishing
  3. Another issue in loading global properties. The error logs captured from log is added below.
    Tried couple of re-start of sonarqube, that doesn’t fix the issue.
    Please advise us with some leads to fix this issue.
    Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
    ERROR: Error during SonarScanner execution

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@41e1e210-org.sonar.scanner.bootstrap.ScannerPluginRepository’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@41e1e210-org.sonar.scanner.bootstrap.ScannerPluginInstaller’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@41e1e210-org.sonar.scanner.bootstrap.PluginFiles’: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘GlobalConfiguration’ defined in org.sonar.scanner.bootstrap.GlobalConfigurationProvider: Unsatisfied dependency expressed through method ‘provide’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘GlobalServerSettings’ defined in org.sonar.scanner.bootstrap.GlobalServerSettingsProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.scanner.bootstrap.GlobalServerSettings]: Factory method ‘provide’ threw exception; nested exception is java.lang.IllegalStateException: Fail to request url: https://myserverurl/api/settings/values.protobuf

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)

at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)

at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)

at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@41e1e210-org.sonar.scanner.bootstrap.PluginFiles’: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘GlobalConfiguration’ defined in org.sonar.scanner.bootstrap.GlobalConfigurationProvider: Unsatisfied dependency expressed through method ‘provide’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘GlobalServerSettings’ defined in org.sonar.scanner.bootstrap.GlobalServerSettingsProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.scanner.bootstrap.GlobalServerSettings]: Factory method ‘provide’ threw exception; nested exception is java.lang.IllegalStateException: Fail to request url: https://myserverurl/api/settings/values.protobuf

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309)

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

... 42 more

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘GlobalConfiguration’ defined in org.sonar.scanner.bootstrap.GlobalConfigurationProvider: Unsatisfied dependency expressed through method ‘provide’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘GlobalServerSettings’ defined in org.sonar.scanner.bootstrap.GlobalServerSettingsProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.scanner.bootstrap.GlobalServerSettings]: Factory method ‘provide’ threw exception; nested exception is java.lang.IllegalStateException: Fail to request url:
at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)

... 85 more

Caused by: java.net.SocketTimeoutException: timeout

at okio.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:143)

at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:162)

at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:335)

at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:427)

at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:320)

at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29)

at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178)

at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)

at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)

at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:222)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)

at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)

at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)

at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)

at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)

at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:203)
... 96 more

Caused by: javax.net.ssl.SSLException: Socket closed
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)

at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)
at okio.InputStreamSource.read(JvmOkio.kt:90)
at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129)

... 116 more

Caused by: java.net.SocketException: Socket closed
at java.base/java.net.SocketInputStream.read(Unknown Source)

at java.base/java.net.SocketInputStream.read(Unknown Source)

at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)

at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(Unknown Source)

at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(Unknown Source)

... 119 more

ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

1 Like

Curious would you be finding that this request is intermittent?

Also would you be using your database behind a clustering service like Patroni?

1 Like