Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?" #72

Open
smurugesh1686 opened this issue Apr 5, 2019 · 7 comments

Comments

@smurugesh1686
Copy link

We are using sonarscanner 2.8.1
In analysis properties:
sonar.analysis.mode=preview
sonar.sources=modules.
But in Console:
INFO: ANALYSIS SUCCESSFUL
INFO: Executing post-job GitHub Pull Request Issue Publisher
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:22.184s
INFO: Final Memory: 238M/11718M
INFO: ------------------------------------------------------------------------
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?

How to resolve this issue.

@smurugesh1686 smurugesh1686 changed the title How to resolve "WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?" "WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?" Apr 5, 2019
@mahernoz-d
Copy link

sonar.analysis.mode=publish

@Spaum145
Copy link

Spaum145 commented Jan 31, 2020

Which version of SonarQube Server do you have? I heard that sonar.analysis.mode property had become deprecated since 6.6 version

@lianfulei
Copy link

i have solve the problem,jenkins Prepare SonarQube Scanner environment must be true

@cwansart
Copy link

cwansart commented Oct 5, 2021

What does

jenkins Prepare SonarQube Scanner environment must be true

mean? Where did you set it?

@abekenov93
Copy link

Jenkins -Configure - will be 'Tick' upon the sonarqube configuration

but that didn't solve my problem

@IvanKostyuk
Copy link

I'm getting the same problem. I have following setup.

Job - BestPracticeScan

Repository structure
Vendor1/
Vendor2/
Vendor3/

Under Vendor2/
Project/
Project/sonar-project.properties
Project/src

My file sonar-project.properties contains

sonar.projectName=My Nice Project
sonar.projectVersion=main
sonar.sources=src/
sonar.java.binaries=src/
sonar.java.source=1.8

In Jenkins job configuration I set
Path to project properties Vendor2/Project/sonar-project.properties

Build fails with
ERROR: The folder 'src/' does not exist for 'my.only.project' (base directory = /var/jenkins_home/workspace/BestPracticeScan)

I'm surprised, why base directory is not where the file sonar-project.properties is located.

Then I update the job configuration adding Additional arguments
projectBaseDir=Vendor2/Project
Now it fails and without -X no clue what is happening.

ERROR: Error during SonarScanner execution
ERROR: Tasks support was removed in SonarQube 7.6.
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: SonarQube scanner exited with non-zero code: 2

-X was added into Additional arguments.
And now I'm getting

19:09:33.968 ERROR: Error during SonarScanner execution
Tasks support was removed in SonarQube 7.6.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
ERROR: SonarQube scanner exited with non-zero code: 2
Finished: FAILURE

Then I was desperate and populated into Analysis properties everything from the file sonar-project.properties with the path from project home

sonar.projectKey=my.only.project
sonar.projectName=My Nice Project
sonar.projectVersion=main
sonar.sources=Vendor2/Project/src/
sonar.java.binaries=Vendor2/Project/src/
sonar.java.source=1.8

It started to work. Even I remove everything. The problem was, that SonarQube Scanner could not create the file
/var/jenkins_home/workspace/BestPracticeScan/Vendor2/Project/.scannerwork/report-task.txt

Deleted the file and reverted everything back to initial problem.
Then, just moved projectBaseDir=Vendor2/Project from Additional arguments to Analysis properties as sonar.projectBaseDir=Vendor2/Project everything started to work from the first run with message

19:11:42.482 DEBUG: Report metadata written to /var/jenkins_home/workspace/BestPracticeScan/Vendor2/Project/.scannerwork/report-task.txt

There is a problem, but if do everything right (in not documented way, though) it will work.

@lianfulei
Copy link

lianfulei commented Apr 29, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants