Error on upload when configuring a new project for analysis

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): * Enterprise Edition Version 8.9 (build 43852)
  • what are you trying to achieve: configure new project for analysis from DevOps pipeline
  • what have you tried so far to achieve this: deleted project and tried to configure it again. Other projects are working just fine.

Hi,

I am trying to configure for sonarqube analysis a new Android project (based on gradle). This analysis it is performed on a test branch (not project’s default one). On initial analysis phase I am getting following error:

INFO  ce[AXqLswqImEi3qhfb5XC-][o.s.c.t.s.ComputationStepExecutor] Extract report | status=FAILED | time=16ms
ERROR ce[AXqLswqImEi3qhfb5XC-][o.s.c.t.s.ComputationStepExecutor] Execution of listener failed
java.lang.IllegalStateException: Directory has not been set yet
	at org.sonar.ce.task.projectanalysis.batch.BatchReportDirectoryHolderImpl.getDirectory(BatchReportDirectoryHolderImpl.java:37)
	at org.sonar.ce.task.projectanalysis.batch.BatchReportReaderImpl.ensureInitialized(BatchReportReaderImpl.java:51)
	at org.sonar.ce.task.projectanalysis.batch.BatchReportReaderImpl.readContextProperties(BatchReportReaderImpl.java:198)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.createProjectAnalysis(PostProjectAnalysisTasksExecutor.java:173)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:107)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:212)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:194)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:160)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:135)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:87)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
ERROR ce[AXqLswqImEi3qhfb5XC-][o.s.c.t.CeWorkerImpl] Failed to execute task AXqLswqImEi3qhfb5XC-
java.lang.IllegalStateException: Fail to extract report AXqLswqImEi3qhfb5XC- from database
	at org.sonar.ce.task.projectanalysis.step.ExtractReportStep.execute(ExtractReportStep.java:72)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:212)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:194)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:160)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:135)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:87)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.FileNotFoundException: D:\Program Files\sonarqube\sonarqube-8.9.0.43852\temp\ce\4215970588613312684\6899272640915020399\activerules.pb (Access is denied)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
	at org.sonar.api.utils.ZipUtils.copy(ZipUtils.java:167)
	at org.sonar.api.utils.ZipUtils.unzipEntry(ZipUtils.java:110)
	at org.sonar.api.utils.ZipUtils.unzip(ZipUtils.java:94)
	at org.sonar.api.utils.ZipUtils.unzip(ZipUtils.java:63)
	at org.sonar.ce.task.projectanalysis.step.ExtractReportStep.execute(ExtractReportStep.java:70)
	... 19 common frames omitted

Thanks,
Emil

Hi Emil,

I think this is your problem:

It looks like you need to recursively grant permissions on $SONARQUBE-HOME to the user running SonarQube.

 
Ann

Hi Ann,

Thanks for pointing me in this direction.
I am running SonarQube as a Windows service - initially as a Local System account.
I’ve changed this to a local user (administrator), to which granted full permissions recursively and changed this local user to be $SONARQUBE-HOME file system owner, but still get the same “(Access is denied)” error.
I tried to see if I can get more info from logs and activated TRACE log level before a processing, nothing more was collected by logs.

It is something else that I can try/look for, to identify the cause for this problem?

Thanks,
Emil

Hi Emil,

I can only go by what I’m seeing in the logs.

 
:woman_shrugging:
Ann

Hi Ann,

It is working now just fine - problem was an security agent/antivirus that flagged SonarQube temp folder as having possible malware content and interfered with access rights.

Thanks for your help,
Emil

Ah yes. Windows’ “helpful” processes.

I’m glad you got this figured out.

 
:smiley:
Ann