Gradle Sonarqube Failure: Execution failed for task ':compileJava' Unable to delete file

Hi,

I’m using Sonarqube 9.3, using plugin 3.3, using Gradle 5.4.1.

I finally got sonarqube to run with Gradle, but I have a new error…

$ gradle sonarqube

[36](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L36)Welcome to Gradle 5.4.1!

[37](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L37)Here are the highlights of this release:

[38](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L38) - Run builds with JDK12

[39](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L39) - New API for Incremental Tasks

[40](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L40) - Updates to native projects, including Swift 5 support

[41](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L41)For more details see https://docs.gradle.org/5.4.1/release-notes.html

[42](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L42)Starting a Gradle Daemon (subsequent builds will be faster)

[43](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L43)> Task :compileJava FAILED

[44](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L44)FAILURE: Build failed with an exception.

[45](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L45)* What went wrong:

[46](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L46)Execution failed for task ':compileJava'.

[47](https://cl-gitlab.cl.net/OX/ss/si/-/jobs/8024#L47)> java.io.IOException: Unable to delete file: /<long path>/Syslog.class

Any thoughts on what account needs permission to do this? Would that be sonarqube or some other account? Do I need to create some account on the runners that would give this process permissions that it needs?

Hi,

Since analysis won’t be deleting any .class files, I have to believe this error is coming from a step that happens before analysis; presumably a ‘clean’ step.

You should make sure that the use running the job has all rights, recursive, to the directory the job runs in.

 
HTH,
Ann

use? Did you mean service?

Hi,

Sorry, I meant “user”.

 
Ann

Ok, thanks. I sent a ticket to GitLab to see what they have to say.

1 Like