How to change the temp direcory of sonarqube from /home directory

The SonarQube code analysis task in our build pipeline getting failed with below error.

Not sure from where the sonarqube is taking the location from . its taking the users home directory now. /home/vowne. We have enough space in other location and would need to change the sonarqube temp location to there.

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.8.0.2131:sonar on project: Unable to load component interface org.sonar.api.utils.TempFolder: Failed to create temporary folder in /home/vowne/.sonar: /home/vowne/.sonar/.sonartmp_xxxxxxx: No space left on device

Hi,

When configuring your analysis, assign the parameter sonar.path.temp to the path for your temporary files folder.


Monty

We are using azure DevOps pipeline task for sonarqube. So… this we should define in pom.xml file or pipeline task parameters?

In your pipeline’s Maven task, what is goals set to?

The default is ‘package’.
Try ‘clean package’.

1 Like

no… we are using "clean verify " only using already

  - task: SonarQubePrepare@4
    inputs:
      SonarQube: 'Sonarqube'
      ScannerMode: 'Other'
      extraProperties: |
          sonar.projectName=${{ parameters.myName }}
          sonar.coverage.jacoco.xmlReportPaths=$(System.DefaultWorkingDirectory)/coverage-report/target/site/jacoco-aggregate/jacoco.xml

What resources on the Azure side have you found helpful in your troubleshooting?

Logging commands are useful when you are troubleshooting a pipeline. For troubleshooting the SonarQube side, a good place to start is the logs. Add sonar.verbose=true to the extraProperties key in SonarQubePrepare task with Azure pipelines yaml to give you debug level information.

Sonar scanner on ADO automatically uses the Azure predefined Agent.TempDirectory value so manually assigning sonar.path.temp (as I was leading earlier) should not be necessary.

Please attach these logs on your next response.

1 Like

our agent is residing on /data mount only, there we have sufficient data. but not sure wht the sonarqube is taking this /homedirectory eventhough the ADO agent temp directory is in /data
if we set sonar.userHome or sonar.path.temp to the “extraproperties” section in above configuration will help?

- task: SonarQubePrepare@4
    inputs:
      SonarQube: 'Sonarqube'
      ScannerMode: 'Other'
      extraProperties: |
          sonar.projectName=${{ parameters.myName }}
          sonar.coverage.jacoco.xmlReportPaths=$(System.DefaultWorkingDirectory)/coverage-report/target/site/jacoco-aggregate/jacoco.xml
          **sonar.userHome=$(System.DefaultWorkingDirectory)**