Failed to create parent directory (createCacheAccess())

Code (Gradle 2.3):

$ gradle --daemon tasks



FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type TaskArtifactStateCacheAccess using TaskExecutionServices.createCacheAccess().
> Failed to create parent directory '/path/project/subproject' when creating directory '/path/project/subproject/.gradle/2.3/taskArtifacts'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Total time: 0.809 secs

Permissions on the files:

$ ls -ld . build.gradle 
drwxrwxrwx 8 user1 group1  309 May 11 10:21 .
-rw-rw-r-- 1 user2  group1 4061 May 11 10:23 build.gradle

Something is fishy wrt to the permissions gradle requires. I am able to create files, etc. but gradle isn’t.

However, it works with Gradle 2.4. Can someone explain what was wrong or what was fixed please?

Thank you.

1 Like

Are you running the build as user1 or user2?

I run the build as user2.



or to some valid folder location where you have valid WRITE access (basically read/write/execute would be helpful for the user which is running gradle process) will resolve this issue.

All gradle is trying is to create a .gradle folder in a location where it doesn’t have valid rwx access.

If I use Gradle 2.4 or 2.5, there are no issues and I have nothing to change to what I do. Since I now use Gradle 2.5, this is no longer an issue for me.