[GRADLE-2714] CacheOpenException when building on NFS mount Created: 20/Mar/13  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.3, 1.4, 1.5-rc-2
Fix Version/s: None

Type: Bug
Reporter: Marco Vermeulen Assignee: Unassigned
Resolution: Won't Fix Votes: 0


 Description   

When using Gradle to build a project on an NFS mount inside a Vagrant VM, I seem to be getting an issue where Gradle can't access the task artifacts state cache.

This seems to be true for any build run on an NFS mount. When I run the exact same build in the home folder of the VM, I have no issues.

I get the following stacktrace:

org.gradle.cache.CacheOpenException: Could not open task artifact state cache (/vagrant/gvm/.gradle/1.5-rc-2/taskArtifacts).
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:55)
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:27)
	at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.doOpenDir(DefaultCacheFactory.java:72)
	at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.open(DefaultCacheFactory.java:111)
	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:184)
	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:134)

Using:
Gradle 1.5-rc-2
OpenJDK 1.7.0_09
FreeBSD 9.1-RELEASE



 Comments   
Comment by Adam Murdoch [ 27/Mar/13 ]

Do you have the rest of the stacktrace for the failure?

Comment by Marco Vermeulen [ 28/Mar/13 ]

No probs. Here it is:

* What went wrong:
Could not open task artifact state cache (/vagrant/gvm/.gradle/1.5/taskArtifacts).
> java.io.IOException: Operation not supported

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

* Exception is:
org.gradle.cache.CacheOpenException: Could not open task artifact state cache (/vagrant/gvm/.gradle/1.5/taskArtifacts).
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:55)
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:27)
	at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.doOpenDir(DefaultCacheFactory.java:72)
	at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.open(DefaultCacheFactory.java:111)
	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:184)
	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:134)
	at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:121)
	at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.getCache(DefaultTaskArtifactStateCacheAccess.java:41)
	at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
	at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
	at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
	at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
	at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
	at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
	at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
	at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
	at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
	at org.gradle.launcher.Main.doAction(Main.java:48)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at org.gradle.launcher.Main.main(Main.java:39)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: org.gradle.internal.UncheckedException: java.io.IOException: Operation not supported
	at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
	at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:76)
	at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:61)
	at org.gradle.cache.internal.DefaultCacheAccess.open(DefaultCacheAccess.java:79)
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:45)
	... 35 more
Caused by: java.io.IOException: Operation not supported
	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockRegion(DefaultFileLockManager.java:322)
	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockStateRegion(DefaultFileLockManager.java:313)
	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lock(DefaultFileLockManager.java:233)
	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.<init>(DefaultFileLockManager.java:109)
	at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:73)
	... 38 more
Comment by Adam Murdoch [ 02/Apr/13 ]

Thanks for that.

As a workaround, you can run with the `--project-cache-dir` command-line option to point Gradle at some other location to write its caches to.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:29:29 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.