Custom plugin's PostProjectAnalysisTask is not being triggered

Hello,

I am currently using SonarQube version 9.9.2 and attempting to use a plugin to search for issues. On my local machine, I can clearly see the results of my execution in both the Sonar console and Maven build, achieving the expected outcomes. However, in the testing environment, I encountered some issues. On Maven build, I can see the logs for PostJob, but I cannot see the logs for PostProjectAnalysisTask in the Sonar console. Due to the absence of any error messages and my insufficient understanding of Sonar, I am unable to find a solution.

Known Differences (Including Version Differences)

Environment Local UT
Sonar Version 10.4.1 9.9.2
Sonar Scanner local okd
Starting Sonar console (Plugin) Program Log Appears No Program Log Appears
Executing Maven build (PostJob) Program Log Appears Program Log Appears
Executing Sonar console (PostProjectAnalysisTask) O X

Program Versions

  1. sonar-plugin-api: 9.9.0.229
  2. sonar-ws: 9.9.4.87374

Solutions Tried

  1. Restart Sonar
  2. Disable sonar.updatecenter.active Due to continuous “Fail to download” issues, it was temporarily disabled, but it still failed.

Attached Log Screenshots


Sorry, I cannot provide the entire log. If you need more details, I will provide them later.

Simple Architecture Diagram

My Question
What could be the possible reasons for this outcome? This will help me continue troubleshooting.

Thank you for response.

Hi,

Are you the plugin developer?

If not, I suggest you contact the maintainer with this question.

If so, then what you’ve posted here is a bit vague for anyone to be immediately helpful. You’ll need to post specifics about what you’re doing (exact code / calls), what output/result you expect, and is/isn’t happening.

 
Ann

Hi,

I apologize for the insufficient information provided, I will add the relevant details.

PostJobInScanner.java is intended to confirm that the package is executed, but it does not have any actual effect. The logic implementation is all in QualityGateStatus.java. The log at the bottom only shows TestPlugin.java and PostJobInScanner.java being triggered, but not QualityGateStatus.java.

Code 1:


public class TestPlugin implements Plugin {

@Override

public void define(Context context) {

System.out.println("Plugin================================================define");

// tutorial on hooks

context.addExtensions(PostJobInScanner.class, QualityGateStatus.class);

}

}

Code 2:


public class PostJobInScanner implements PostJob {

public PostJobInScanner() {

System.out.println("PostJob================================================PostJobInScanner");

}

@Override

public void describe(PostJobDescriptor descriptor) {

System.out.println("PostJob================================================describe");

}

@Override

public void execute(PostJobContext context) {

System.out.println("PostJob================================================execute");

}

}

Code 3:


public class QualityGateStatus implements PostProjectAnalysisTask {

public QualityGateStatus() {

System.out.println("PostProjectAnalysisTask================================================");

}

@Override

public void finished(ProjectAnalysis analysis) {

System.out.println("PostProjectAnalysisTask================================================finished");

WsClient ws = getWsClient();

SearchRequest sr = new SearchRequest();

sr.setPs(“500”);

sr.setProjects(Arrays.asList(analysis.getProject().getName()));

SearchWsResponse code = ws.issues().search(sr);

for (Issue iterable_element : code.getIssuesList()) {

// do something

}

}

@Override

public String getDescription() {

System.out.println("PostProjectAnalysisTask================================================getDescription");

return "Collect analysis results and insert them into MongoDB.";

}

private WsClient getWsClient() {

System.out.println("PostProjectAnalysisTask================================================getWsClient");

return WsClientFactories.getDefault().newClient( //

HttpConnector.newBuilder().url(“urkl) //

.credentials(“test”, “tes”t) //

.build());

}

}

Log 1: Maven build


[INFO] Scanning for projects...

[INFO]

[INFO] --------------------< com.c:test-repo >--------------------

[INFO] Building test-repo 1.1.0-RELEASE

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ test-repo ---

[INFO] Deleting /s/target

[INFO]

[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ test-repo ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Using 'UTF-8' encoding to copy filtered properties files.

[INFO] Copying 5 resources

[INFO] Copying 1 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ test-repo ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 25 source files to /s/target/classes

[INFO]

[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ test-repo ---

[INFO] Not copying test resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ test-repo ---

[INFO] Not compiling test sources

[INFO]

[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ test-repo ---

[INFO] Tests are skipped.

[INFO]

[INFO] --- sonar-maven-plugin:3.11.0.3922:sonar (default-cli) @ test-repo ---

[INFO] 06:17:28.032 Java 11.0.23 Debian (64-bit)

[INFO] 06:17:28.032 Linux 6.1.18-200.fc37.x86_64 (amd64)

[INFO] 06:17:28.196 User cache: /root/.sonar/cache

[INFO] 06:17:28.875 Communicating with SonarQube Server 9.9.2.77730

[INFO] 06:17:28.913 Default locale: "en", source code encoding: "UTF-8"

[INFO] 06:17:29.343 Load global settings

[INFO] 06:17:29.447 Load global settings (done) | time=104ms

[INFO] 06:17:29.449 Server id: 1155850A-AYAm192_23baF6jGdElc

[INFO] 06:17:29.456 User cache: /root/.sonar/cache

[INFO] 06:17:29.459 Load/download plugins

[INFO] 06:17:29.460 Load plugins index

[INFO] 06:17:29.512 Load plugins index (done) | time=52ms

[INFO] 06:17:32.041 Load/download plugins (done) | time=2582ms

Plugin================================================define

[INFO] 06:17:32.719 Process project properties

[INFO] 06:17:32.730 Process project properties (done) | time=12ms

[INFO] 06:17:32.732 Execute project builders

[INFO] 06:17:32.734 Execute project builders (done) | time=2ms

[INFO] 06:17:32.736 Project key: com.c:test-repo

[INFO] 06:17:32.737 Base dir: /s

[INFO] 06:17:32.737 Working dir: /s/target/sonar

[INFO] 06:17:32.744 Load project settings for component key: 'com.c:test-repo'

[INFO] 06:17:36.298 JavaClasspath initialization

[INFO] 06:17:36.305 JavaClasspath initialization (done) | time=7ms

[INFO] 06:17:36.305 JavaTestClasspath initialization

[INFO] 06:17:36.309 JavaTestClasspath initialization (done) | time=4ms

[INFO] 06:17:36.317 Server-side caching is enabled. The Java analyzer will not try to leverage data from a previous analysis.

[INFO] 06:17:36.321 Using ECJ batch to parse 25 Main java source files with batch size 80 KB.

[INFO] 06:17:36.469 Starting batch processing.

[INFO] 06:17:36.952 The Java analyzer cannot skip unchanged files in this context. A full analysis is performed for all files.

[INFO] 06:17:38.223 100% analyzed

[INFO] 06:17:38.223 Batch processing: Done.

[INFO] 06:17:38.225 Did not optimize analysis for any files, performed a full analysis for all 25 files.

[INFO] 06:17:38.227 No "Test" source files to scan.

[INFO] 06:17:38.227 No "Generated" source files to scan.

[INFO] 06:17:38.227 Sensor JavaSensor [java] (done) | time=1938ms

[INFO] 06:17:38.227 Sensor JaCoCo XML Report Importer [jacoco]

[INFO] 06:17:38.228 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml

[INFO] 06:17:38.229 No report imported, no coverage information will be imported by JaCoCo XML Report Importer

[INFO] 06:17:38.229 Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms

[INFO] 06:17:38.229 Sensor CSS Rules [javascript]

[INFO] 06:17:38.229 No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.

[INFO] 06:17:38.230 Sensor CSS Rules [javascript] (done) | time=0ms

[INFO] 06:17:38.230 Sensor C# Project Type Information [csharp]

[INFO] 06:17:38.230 Sensor C# Project Type Information [csharp] (done) | time=0ms

[INFO] 06:17:38.230 Sensor C# Analysis Log [csharp]

[INFO] 06:17:38.258 Sensor C# Properties [csharp]

[INFO] 06:17:38.258 Sensor C# Properties [csharp] (done) | time=0ms

[INFO] 06:17:38.259 Sensor SurefireSensor [java]

[INFO] 06:17:38.260 parsing [/s/target/surefire-reports]

[INFO] 06:17:38.261 Sensor SurefireSensor [java] (done) | time=2ms

[INFO] 06:17:38.261 Sensor HTML [web]

[INFO] 06:17:38.265 Sensor HTML [web] (done) | time=4ms

[INFO] 06:17:38.265 Sensor XML Sensor [xml]

[INFO] 06:17:38.274 1 source file to be analyzed

[INFO] 06:17:38.427 1/1 source file has been analyzed

[INFO] 06:17:38.427 Sensor XML Sensor [xml] (done) | time=162ms

[INFO] 06:17:38.427 Sensor TextAndSecretsSensor [text]

[INFO] 06:17:38.436 26 source files to be analyzed

[INFO] 06:17:38.463 26/26 source files have been analyzed

[INFO] 06:17:38.464 Sensor TextAndSecretsSensor [text] (done) | time=37ms

[INFO] 06:17:38.464 Sensor VB.NET Project Type Information [vbnet]

[INFO] 06:17:38.465 Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms

[INFO] 06:17:38.465 Sensor VB.NET Analysis Log [vbnet]

[INFO] 06:17:38.477 Sensor VB.NET Analysis Log [vbnet] (done) | time=12ms

[INFO] 06:17:38.478 Sensor VB.NET Properties [vbnet]

[INFO] 06:17:38.478 Sensor VB.NET Properties [vbnet] (done) | time=0ms

[INFO] 06:17:38.478 Sensor IaC Docker Sensor [iac]

[INFO] 06:17:38.481 0 source files to be analyzed

[INFO] 06:17:38.527 0/0 source files have been analyzed

[INFO] 06:17:38.527 Sensor IaC Docker Sensor [iac] (done) | time=49ms

[INFO] 06:17:38.531 ------------- Run sensors on project

[INFO] 06:17:38.613 Sensor Zero Coverage Sensor (done) | time=16ms

[INFO] 06:17:38.613 Sensor Java CPD Block Indexer

[INFO] 06:17:38.663 Sensor Java CPD Block Indexer (done) | time=50ms

[INFO] 06:17:38.675 CPD Executor 4 files had no CPD blocks

[INFO] 06:17:38.676 CPD Executor Calculating CPD for 21 files

[INFO] 06:17:38.689 CPD Executor CPD calculation finished (done) | time=13ms

[INFO] 06:17:38.750 Analysis report generated in 55ms, dir size=207.8 kB

[INFO] 06:17:38.788 Analysis report compressed in 38ms, zip size=78.5 kB

[INFO] 06:17:38.845 Analysis report uploaded in 56ms

[INFO] 06:17:38.847 ANALYSIS SUCCESSFUL, you can find the results at: http://dialmsonar01:9000/dashboard?id=com.c%3Atest-repo

[INFO] 06:17:38.847 Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report

[INFO] 06:17:38.847 More about the report processing at http://dialmsonar01:9000/api/ce/task?id=AY89GebwXTm1doOeOY-c

PostJob================================================PostJobInScanner

PostJob================================================describe

[INFO] 06:17:38.851 Executing post-job 'After scan'

PostJob================================================execute

[INFO] 06:17:38.860 Analysis total time: 6.468 s

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 11.623 s

[INFO] Finished at: 2024-05-03T06:17:38Z

[INFO] ------------------------------------------------------------------------

[Finish] Java Build

Log 2: Sonar console


2024.05.03 14:12:20 INFO web[][o.s.p.ProcessEntryPoint] Starting Web Server

2024.05.03 14:12:21 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.9.2.77730 / dd63ff5d0db91f039afd5d40319122666c9961ef

2024.05.03 14:12:21 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://DDALMS01;databaseName=SONAR;encrypt=false

2024.05.03 14:12:21 INFO web[][c.z.h.HikariDataSource] HikariPool-1 - Starting...

2024.05.03 14:12:21 INFO web[][c.z.h.p.HikariPool] HikariPool-1 - Added connection ConnectionID:1 ClientConnectionId: 77dbe666-c347-484c-b201-874b8e3a87c2

2024.05.03 14:12:21 INFO web[][c.z.h.HikariDataSource] HikariPool-1 - Start completed.

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: D:\sonarqube-9.9.2.77730

2024.05.03 14:12:22 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy C# Code Quality and Security / 8.51.0.59060 / e14c642f118958f22fd08841dc42f9aae480366a

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Configuration detection fot Code Quality and Security / 1.2.0.267 / 4f37ba9ffb37a96d5883e52ad392ed32c5c6eaab

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Flex Code Quality and Security / 2.8.0.3166 / 01f66bdddc678966c81a9064ed139156a6a89c97

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Go Code Quality and Security / 1.11.0.3905 / e1f28bc000e04ca01881e84218d01d464a17a36f

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy HTML Code Quality and Security / 3.7.1.3306 / d720acc6860c6d8b69ec4d17570a398a1e216da1

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy IaC Code Quality and Security / 1.11.0.2847 / 6892bd3a7320b3c110717acfdb18c4c7451069fd

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy JaCoCo / 1.3.0.1538 / 74a7798c7cea687c72ed9df40c93eb7ea2a58c49

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Java Code Quality and Security / 7.16.0.30901 / 4b1436558dfd5fc00c8d9aae8bb0364ba122c73e

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy JavaScript/TypeScript/CSS Code Quality and Security / 9.13.0.20537 / 68ff7657415044b86033814795ed95fc1f1558f1

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Kotlin Code Quality and Security / 2.12.0.1956 / a6df1ae252bd62d63f8673c28f87ad14258a7904

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy PHP Code Quality and Security / 3.27.1.9352 / 3ddc5a03e1a7e3729d41e7c1a30a37d5715958c7

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Python Code Quality and Security / 3.24.1.11916 / cc8f4fa745eb33d31c3869bdfdfd45514e67c1fe

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Ruby Code Quality and Security / 1.11.0.3905 / e1f28bc000e04ca01881e84218d01d464a17a36f

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Scala Code Quality and Security / 1.11.0.3905 / e1f28bc000e04ca01881e84218d01d464a17a36f

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy Text Code Quality and Security / 2.0.2.1090 / 7eb026363b98f5f98b43c603772b5177869c2c6a

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy VB.NET Code Quality and Security / 8.51.0.59060 / e14c642f118958f22fd08841dc42f9aae480366a

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy XML Code Quality and Security / 2.7.0.3820 / 656bccc1910d50c8984536bd2dfd917066b858e6

2024.05.03 14:12:22 INFO web[][o.s.s.p.ServerPluginManager] Deploy cna-plugin-sonar-mongo-1.0.0 / 1.0.0 / null

2024.05.03 14:12:24 INFO web[][o.s.s.p.d.m.c.MssqlCharsetHandler] Verify that database collation is case-sensitive and accent-sensitive

2024.05.03 14:12:24 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://127.0.0.1:9001]

2024.05.03 14:12:24 WARN web[][o.s.a.s.w.WebService$Action] Description is not set on action api/monitoring/metrics

2024.05.03 14:12:24 WARN web[][o.s.a.s.w.WebService$Action] Since is not set on action api/monitoring/metrics

2024.05.03 14:12:24 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/monitoring/metrics

2024.05.03 14:12:24 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness

2024.05.03 14:12:24 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@2e362407 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]

2024.05.03 14:12:24 INFO web[][o.s.s.p.DetectPluginChange] Detect plugin changes

2024.05.03 14:12:24 INFO web[][o.s.s.p.DetectPluginChange] No plugin change detected

2024.05.03 14:12:24 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000

2024.05.03 14:12:25 INFO web[][o.s.s.s.LogServerId] Server ID: 1155850A-AYAm192_23baF6jGdElc

2024.05.03 14:12:25 WARN web[][o.s.s.a.LogOAuthWarning] For security reasons, OAuth authentication should use HTTPS. You should set the property 'Administration > Configuration > Server base URL' to a HTTPS URL.

2024.05.03 14:12:26 INFO web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties

2024.05.03 14:12:26 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action saml/validation_init

2024.05.03 14:12:26 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness

2024.05.03 14:12:26 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/plugins/download

2024.05.03 14:12:26 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/analysis_cache/get

2024.05.03 14:12:26 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/check_pat

2024.05.03 14:12:26 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/push/sonarlint_events

2024.05.03 14:12:26 WARN web[][o.s.s.p.d.CheckAnyonePermissionsAtStartup] Authentication is not enforced, and permissions assigned to the 'Anyone' group globally expose the instance to security risks. Unauthenticated visitors may unintentionally have permissions on projects.

2024.05.03 14:12:26 INFO web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired session tokens has removed 3 elements

2024.05.03 14:12:26 INFO web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired SAML message ids has removed 0 elements

2024.05.03 14:12:26 INFO web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.)

2024.05.03 14:12:26 INFO web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.

2024.05.03 14:12:26 INFO web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index

2024.05.03 14:12:26 INFO web[][o.s.s.s.RegisterPermissionTemplates] Register permission templates

2024.05.03 14:12:26 INFO web[][o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys

2024.05.03 14:12:26 INFO web[][o.s.s.s.RegisterPlugins] Register plugins

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.SonarLintConnectionFilter@8a9ee64 [pattern=UrlPattern{inclusions=[/api/*], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@2dee30ea [pattern=UrlPattern{inclusions=[/api/issues/delete_comment.*, ...], exclusions=[/api/authentication/login.*, ...]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceReroutingFilter@605c3c8b [pattern=UrlPattern{inclusions=[/api/components/bulk_update_key, ...], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.DefaultAdminCredentialsVerifierFilter@7cbadb20 [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@3b27d01d [pattern=UrlPattern{inclusions=[/sessions/init/*], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.SamlValidationRedirectionFilter@6712cef3 [pattern=UrlPattern{inclusions=[/oauth2/callback/saml], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@662b0efe [pattern=UrlPattern{inclusions=[/oauth2/callback/*], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ResetPasswordFilter@4c62bac0 [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LoginAction@347d6598 [pattern=UrlPattern{inclusions=[/api/authentication/login], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LogoutAction@43160593 [pattern=UrlPattern{inclusions=[/api/authentication/logout], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.ValidateAction@1513ae04 [pattern=UrlPattern{inclusions=[/api/authentication/validate], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.saml.ws.ValidationInitAction@1bab2290 [pattern=UrlPattern{inclusions=[/saml/validation_init], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.saml.ws.ValidationAction@7347eb41 [pattern=UrlPattern{inclusions=[/saml/validation], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.user.ws.ChangePasswordAction@49402c69 [pattern=UrlPattern{inclusions=[/api/users/change_password], exclusions=[]}]

2024.05.03 14:12:26 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.plugins.PluginsRiskConsentFilter@385406e4 [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]

2024.05.03 14:12:26 INFO web[][o.s.s.q.ProjectsInWarningDaemon] Counting number of projects in warning is not started as there are no projects in this situation.

2024.05.03 14:12:26 INFO web[][o.s.s.p.p.PlatformLevelStartup] Running Community Edition

2024.05.03 14:12:27 INFO web[][o.s.s.p.Platform] Web Server is operational

2024.05.03 14:14:26 ERROR web[AY89Fnmzldpp/HynAAAZ][o.s.s.p.UpdateCenterClient] Fail to connect to update center

org.sonar.api.utils.SonarException: Fail to download: https://update.sonarsource.org/update-center.properties

….

Caused by: java.net.SocketTimeoutException: Connect timed out

... 149 common frames omitted

Suppressed: java.net.SocketTimeoutException: Connect timed out

... 172 common frames omitted

Hi,

Okay, so your plugin currently consists of logging so you can see what happens when. And since you’re not seeing the expected server-side logging in web.log you think something’s wrong.

But web.log isn’t where I would look for logging related to server-side analysis processing. ce.log (Compute Engine log) is.

 
Ann

1 Like

Hi,

I found my ce.log, and in the second-to-last log entry, I confirmed that QualityGateStatus.java was triggered, but only getDescription() was executed, and finished(ProjectAnalysis analysis) was not. Could you tell me what might cause the method not to be triggered?

2024.05.08 10:26:06 INFO  ce[][o.s.p.ProcessEntryPoint] Starting Compute Engine
2024.05.08 10:26:06 INFO  ce[][o.s.ce.app.CeServer] Compute Engine starting up...
2024.05.08 10:26:06 INFO  ce[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://DDALMS01;databaseName=SONAR;encrypt=false
2024.05.08 10:26:06 INFO  ce[][c.z.h.HikariDataSource] HikariPool-1 - Starting...
2024.05.08 10:26:06 INFO  ce[][c.z.h.p.HikariPool] HikariPool-1 - Added connection ConnectionID:1 ClientConnectionId: 23708ae2-71d1-42f6-ae06-00366273e88f
2024.05.08 10:26:06 INFO  ce[][c.z.h.HikariDataSource] HikariPool-1 - Start completed.
2024.05.08 10:26:07 INFO  ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: D:\sonarqube-9.9.2.77730
2024.05.08 10:26:07 INFO  ce[][o.s.c.c.CePluginRepository] Load plugins
2024.05.08 10:26:09 INFO  ce[][o.s.c.c.ComputeEngineContainerImpl] Running Community edition
2024.05.08 10:26:09 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is started
2024.05.08 11:12:10 INFO  ce[][o.s.p.ProcessEntryPoint] Gracefully stopping process
2024.05.08 11:12:10 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is stopping...
2024.05.08 11:12:10 INFO  ce[][o.s.c.t.CeProcessingSchedulerImpl] Gracefully stopping workers...
2024.05.08 11:12:10 INFO  ce[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown initiated...
2024.05.08 11:12:10 INFO  ce[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown completed.
2024.05.08 11:12:10 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is stopped
2024.05.08 11:12:56 INFO  ce[][o.s.p.ProcessEntryPoint] Starting Compute Engine
2024.05.08 11:12:56 INFO  ce[][o.s.ce.app.CeServer] Compute Engine starting up...
2024.05.08 11:12:56 INFO  ce[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://DDALMS01;databaseName=SONAR;encrypt=false
2024.05.08 11:12:57 INFO  ce[][c.z.h.HikariDataSource] HikariPool-1 - Starting...
2024.05.08 11:12:57 INFO  ce[][c.z.h.p.HikariPool] HikariPool-1 - Added connection ConnectionID:1 ClientConnectionId: 0889d208-c892-4738-9537-e6719a2376fa
2024.05.08 11:12:57 INFO  ce[][c.z.h.HikariDataSource] HikariPool-1 - Start completed.
2024.05.08 11:12:57 INFO  ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: D:\sonarqube-9.9.2.77730
2024.05.08 11:12:58 INFO  ce[][o.s.c.c.CePluginRepository] Load plugins
2024.05.08 11:12:59 INFO  ce[][o.s.c.c.ComputeEngineContainerImpl] Running Community edition
2024.05.08 11:12:59 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is started
2024.05.08 15:51:55 INFO  ce[][o.s.c.t.CeWorkerImpl] Execute task | project=com.c:test-repo | type=REPORT | id=AY9XMADfBtF7klwPbalW | submitter=test
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Extract report | status=SUCCESS | time=255ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist scanner context | status=SUCCESS | time=10ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Propagate analysis warnings from scanner report | status=SUCCESS | time=0ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Generate analysis UUID | status=SUCCESS | time=0ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Load analysis metadata | status=SUCCESS | time=71ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Initialize | status=SUCCESS | time=0ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Build tree of components | components=43 | status=SUCCESS | time=69ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Validate project | status=SUCCESS | time=13ms
2024.05.08 15:51:56 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://127.0.0.1:9001]
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Load quality profiles | status=SUCCESS | time=608ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Load file hashes and statuses | status=SUCCESS | time=16ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Load Quality gate | status=SUCCESS | time=15ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Load new code period | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Detect file moves | reportFiles=26 | dbFiles=26 | addedFiles=0 | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Detect file moves in Pull Request scope | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Load duplications | duplications=2 | status=SUCCESS | time=31ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute cross project duplications | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute size measures | status=SUCCESS | time=47ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute new coverage | status=SUCCESS | time=157ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute coverage measures | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute comment measures | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute duplication measures | status=SUCCESS | time=15ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute size measures on new code | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute language distribution | status=SUCCESS | time=79ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute test measures | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute complexity measures | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Load measure computers | status=SUCCESS | time=0ms
2024.05.08 15:51:57 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute Quality Profile status | status=SUCCESS | time=15ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Execute component visitors | status=SUCCESS | time=288ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Checks executed after computation of measures | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute Quality Gate measures | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute Quality profile measures | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Generate Quality profile events | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Generate Quality gate events | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Check upgrade possibility for not analyzed code files. | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist scanner analysis cache | status=SUCCESS | time=16ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist components | status=SUCCESS | time=16ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist analysis | status=SUCCESS | time=15ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist analysis properties | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist measures | inserts=52 | status=SUCCESS | time=63ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist live measures | insertsOrUpdates=2085 | status=SUCCESS | time=328ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist duplication data | insertsOrUpdates=0 | status=SUCCESS | time=16ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist new ad hoc Rules | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist issues | cacheSize=0 bytes | inserts=0 | updates=0 | merged=0 | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Delete issue changes | changes=0 | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist project links | status=SUCCESS | time=16ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist events | status=SUCCESS | time=0ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist sources | status=SUCCESS | time=78ms
2024.05.08 15:51:58 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Persist cross project duplications | status=SUCCESS | time=0ms
2024.05.08 15:51:59 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Enable analysis | status=SUCCESS | time=15ms
2024.05.08 15:51:59 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Update last usage date of quality profiles | status=SUCCESS | time=0ms
2024.05.08 15:51:59 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Purge db | status=SUCCESS | time=405ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Index analysis | status=SUCCESS | time=728ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Update need issue sync for branch | status=SUCCESS | time=5ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Compute total Project ncloc | status=SUCCESS | time=44ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Publishing taint vulnerabilities events | status=SUCCESS | time=3ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Send issue notifications | newIssuesNotifs=0 | newIssuesDeliveries=0 | myNewIssuesNotifs=0 | myNewIssuesDeliveries=0 | changesNotifs=0 | changesDeliveries=0 | status=SUCCESS | time=6ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Publish task results | status=SUCCESS | time=0ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.s.ComputationStepExecutor] Trigger refresh of Portfolios and Applications | status=SUCCESS | time=0ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Webhooks | globalWebhooks=0 | projectWebhooks=0 | status=SUCCESS | time=2ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Collect analysis results and insert them into MongoDB. | status=SUCCESS | time=109ms
2024.05.08 15:52:00 INFO  ce[AY9XMADfBtF7klwPbalW][o.s.c.t.CeWorkerImpl] Executed task | project=com.c:test-repo | type=REPORT | id=AY9XMADfBtF7klwPbalW | submitter=test | status=SUCCESS | time=4807ms

Hi,

It’s probably worth checking the other server logs for your missing log lines.

And could you remind me what you’re trying to accomplish? Going back to your initial post, I see

What do you want to do with the issues once you find them?

 
Ann

Hi,

I want to generate a report for developers on my own.

Over the past two days, testing has revealed that the method override might be incorrect. The method default void finished(ProjectAnalysis analysis) has been deprecated since version 8.0, and changing it to default void finished(Context context) allows me to see the Log.

I am very grateful for your assistance; otherwise, I would still be looking for logs in the wrong log file.

Poya

1 Like

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