SonarQubeAnalyze suddenly failing from Azure DevOps

SonarQube Server v10.8.1
SonarScanner v9.0.2, also reproduced with v9.2.1 (latest) on local machine and Azure DevOps
Azure DevOps Server 2022.0.1
SonarQube Server Azure DevOps Extension 7.1.1 (latest)

This issue popped up last Thursday after months of working scans. The same pipelines that worked before are failing now.

I have been able to get the same error to happen on my local machine using the latest dotnet cli tool with the same error and stack trace. What is especially strange is that I am able to hit the url from the error log from my machine and from the server running the Azure DevOps agent with no problem. So it doesn’t appear to be network or firewall related.

The url is https://sonarqube.xxxxx/api/rules/list.protobuf?qprofile=AYqVS56ygN-OTOM5YzVl&ps=500&p=1

Here’s the error and stack trace I am getting from my Azure DevOps pipeline:

ERROR:	Error during SonarScanner execution
org.springframework.beans.factory.UnsatisfiedDependencyException:
	Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@55182842-org.sonar.scanner.report.ReportPublisher':
	Unsatisfied dependency expressed through constructor parameter 7; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
	Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@55182842-org.sonar.scanner.report.ActiveRulesPublisher':
	Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException:
	Error creating bean with name 'ActiveRules' defined in org.sonar.scanner.rule.ActiveRulesProvider:
	Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
	Failed to instantiate [org.sonar.api.batch.rule.internal.DefaultActiveRules]:
	Factory method 'provide' threw exception; nested exception is java.lang.IllegalStateException:
	Fail to request url:
		https://sonarqube.xxxxx/api/rules/list.protobuf?qprofile=AYqVS56ygN-OTOM5YzVl&ps=500&p=1
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:794)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:220)
	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:336)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:225)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:144)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)anner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)

Caused by:
	org.springframework.beans.factory.UnsatisfiedDependencyException:
	Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@55182842-org.sonar.scanner.report.ActiveRulesPublisher':
	Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException:
	Error creating bean with name 'ActiveRules' defined in org.sonar.scanner.rule.ActiveRulesProvider:
	Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
	Failed to instantiate [org.sonar.api.batch.rule.internal.DefaultActiveRules]:
	Factory method 'provide' threw exception; nested exception is java.lang.IllegalStateException:
	Fail to request url:
		https://sonarqube.xxxxx/api/rules/list.protobuf?qprofile=AYqVS56ygN-OTOM5YzVl&ps=500&p=1
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:794)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:220)
	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:336)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1609)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1573)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1439)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1349)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:781)
	... 31 more

Caused by:
	org.springframework.beans.factory.BeanCreationException:
	Error creating bean with name 'ActiveRules' defined in org.sonar.scanner.rule.ActiveRulesProvider:
	Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
	Failed to instantiate [org.sonar.api.batch.rule.internal.DefaultActiveRules]:
	Factory method 'provide' threw exception; nested exception is java.lang.IllegalStateException:
	Fail to request url:
		https://sonarqube.xxxxx/api/rules/list.protobuf?qprofile=AYqVS56ygN-OTOM5YzVl&ps=500&p=1
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:646)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:626)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
	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:336)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:781)
	... 48 more

Caused by:
	org.springframework.beans.BeanInstantiationException:
	Failed to instantiate [org.sonar.api.batch.rule.internal.DefaultActiveRules]:
	Factory method 'provide' threw exception; nested exception is java.lang.IllegalStateException:
	Fail to request url:
		https://sonarqube.xxxxx/api/rules/list.protobuf?qprofile=AYqVS56ygN-OTOM5YzVl&ps=500&p=1
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:641)
	... 62 more

Caused by:
	java.lang.IllegalStateException:
	Fail to request url:
		https://sonarqube.xxxxx/api/rules/list.protobuf?qprofile=AYqVS56ygN-OTOM5YzVl&ps=500&p=1
	at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:217)
	at org.sonarqube.ws.client.HttpConnector.executeRequest(HttpConnector.java:132)
	at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:118)
	at org.sonar.scanner.http.DefaultScannerWsClient.call(DefaultScannerWsClient.java:87)
	at org.sonar.scanner.rule.DefaultActiveRulesLoader.load(DefaultActiveRulesLoader.java:66)
	at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:105)
	at org.sonar.scanner.rule.ActiveRulesProvider.load(ActiveRulesProvider.java:62)
	at org.sonar.scanner.rule.ActiveRulesProvider.provide(ActiveRulesProvider.java:50)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 63 more

Caused by:
	java.net.SocketTimeoutException: timeout
	at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675)
	at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684)
	at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:143)
	at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:97)
	at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:110)
	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:263)
	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.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221)
	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:215)
	... 75 more

ERROR:
	The SonarScanner did not complete successfully
	09:12:49.659  Post-processing failed. Exit code: 1
	SonarQube Server:
	Error while executing task Analyze:
	The process 'D:\azagent01\_work\_tool\SonarScanner .NET\9.2.1\x64\SonarScanner.MSBuild.exe' failed with exit code 1
	The process 'D:\azagent01\_work\_tool\SonarScanner .NET\9.2.1\x64\SonarScanner.MSBuild.exe' failed with exit code 1

Hi,

I agree that it’s odd that you can successfully make the failing call manually. And I have to ask what changed in your environment last Thursday (or late Wednesday). Because the ultimate cause of the error:

Makes me suspect that something “helpful” on your network is blocking the call.

Can you check the headers on the calls to see whether all the same ones are in place in both sets? Can you check with your network folks?

 
Ann

1 Like

Turns out that a new security tool was rolled out last week and no one told us. I suspect that’s the root cause. I don’t know why it only blocks sometimes. That made it much more difficult to diagnose. Thank you for taking the time to respond.

1 Like

I have a new wrinkle on this one. Our networking team has determined that this traffic is not subject to the tool that had been noted. That tool is not used in the space where this is running.

I went and pulled access logs from SonarQube and found that the following logs show a success 200 response:

[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5h6gN-OTOM5YycX&ps=500&p=1 HTTP/1.1" 200 6977 "-" "ScannerMSBuild/9.0.2" "42ba5fe2-b677-4d95-868c-bc2b7b894035" 53
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5j0gN-OTOM5YydV&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "6d39d9e8-13a8-441f-9b1a-6a403acb496b" 49
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5lQgN-OTOM5Yyey&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "53e02fe6-7e7f-4575-a316-f169dca26449" 35
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5mngN-OTOM5YyfS&ps=500&p=1 HTTP/1.1" 200 12 "-" "ScannerMSBuild/9.0.2" "96bfd864-5036-4e39-8b8d-6c0022fc5c44" 5
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5oIgN-OTOM5Yymy&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "d21e651f-069f-49ed-8f84-1121149eac3e" 258
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5sZgN-OTOM5YyxL&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "f654ad65-cd9a-4905-b80e-6d48b71539c8" 189
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=4772fb72-25ac-44ae-b00e-9f0c0bb99987&ps=500&p=1 HTTP/1.1" 200 5127 "-" "ScannerMSBuild/9.0.2" "fe251b4b-2b32-4ff3-a4e1-5153517a68e6" 33
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=e3770c46-e95e-4eb1-9ad6-c62c7da68e61&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "1f20ed5a-f837-44fd-b96a-4e328770b9a3" 49
[04/Mar/2025:17:18:42 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5x4gN-OTOM5Yy7L&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "f9589e7e-db56-4403-82b1-37e3fbf40be6" 56
[04/Mar/2025:17:18:43 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS5vpgN-OTOM5Yy42&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "9f69dacc-23c1-4464-8220-a4901ff640c1" 137
[04/Mar/2025:17:18:43 -0700] "GET /api/rules/list.protobuf?qprofile=a8c3948a-885e-4c08-99bf-8ad95408b8ba&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "10831e35-c5e4-4c3d-92e4-ed9fb6020c3e" 87
[04/Mar/2025:17:18:43 -0700] "GET /api/rules/list.protobuf?qprofile=0ec1e5ef-3060-4b51-aa0f-7837a540dcc2&ps=500&p=1 HTTP/1.1" 200 3490 "-" "ScannerMSBuild/9.0.2" "7bcf88a7-5e67-4263-b091-f382217eb90b" 29
[04/Mar/2025:17:18:43 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS50KgN-OTOM5YzLi&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "6999991c-975c-44bc-9411-7e2ec6c05585" 365
[04/Mar/2025:17:18:43 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS50KgN-OTOM5YzLi&ps=500&p=2 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "fcf66409-d91f-46af-b5ce-140b69ddc64c" 71
[04/Mar/2025:17:18:43 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS551gN-OTOM5YzUW&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "748d61d7-9403-4740-8e60-b08a140a0728" 57
[04/Mar/2025:17:18:43 -0700] "GET /api/rules/list.protobuf?qprofile=AYqVS58XgN-OTOM5YzXk&ps=500&p=1 HTTP/1.1" 200 - "-" "ScannerMSBuild/9.0.2" "33af2113-9a50-415e-8871-cadce5bf9247" 42

The failure is ALWAYS happening with a request with the query string parameter qprofile set to AYqVS56ygN-OTOM5YzVl and that one doesn’t show up in the access log at all. I am wondering if maybe there is something going on server side that is causing the response to this exact request to not respond or to respond very slowly.

It seems very unlikely that something on our network lets all of the above requests through, and blocks or slows down this exact request every time.

Do you know of any logs that I can look at that may help me understand if this request is making it through?

Hi,

First, I’ve seen stranger things in the realm of “network security.”

Second, it seems equally unlikely to me that SonarQube would be silently filtering out or ignoring requests for that specific profile. Even if the response was very slow, you would see something, somewhere.

So it’s worth checking your other server logs for errors.

 
Ann

FYI, this morning we upgraded from SonarQube Server v10.8.1 to v2025.1 and this issue went away. I tried a scan right before and right after the upgrade. We didn’t change anything else about our environment.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.