2

I have a Jenkins instance running that should build an Android project. When I start the task, I receive the following exception:

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory()

Failed to create parent directory '/home/espresso/jenkins_workspace/workspace/myproject/.gradle' when creating directory '/home/espresso/jenkins_workspace/workspace/myproject/.gradle/4.1/fileHashes'

Jenkins runs as root, ls -la for myproject folder is:

drwxr-xr-x 11 root root 4096 Nov 16 15:07 myproject

The environment variable GRADLE_USER_HOME is set to /home/espresso/.gradle, ls -la for that folder gives:

drwxrwxrwx   6 root     root       4096 Nov 16 11:30 .gradle

Why can't Jenkins create that folder? The whole directory structure under jenkins_workspace was created by Jenkins, so the permissions should be okay?

fweigl
  • 384

1 Answers1

2

Everything runs fine after checking the box

Force GRADLE_USER_HOME to use workspace

on the Jenkins Gradle Plugin.

Why this makes it work, I don't know. The environment variable $GRADLE_USER_HOME for the job was set to /home/espresso/.gradle and the job, as root, had all permissions for that folder. Also, I don't understand why missing permissions in one gradle folder would lead to the job not being able to create files in another gradle folder.

fweigl
  • 384