[GRADLE-2262] Improve error message when .gradle directory is deleted during build Created: 01/May/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-rc-3
Fix Version/s: None

Type: Bug
Reporter: Jens Bendisposto Assignee: Unassigned
Resolution: Won't Fix Votes: 0


 Description   

My build fails with an exception. The project can be retrieved from https://github.com/bendisposto/probparsers
I am not sure if I did something wrong. The setup is rather complex.

My workaround is to delete the file taskArtifacts/cache.properties.lock

  • What went wrong:
    Could not open task artifact state cache (/home/hudson/build/workspace/probparsers-snapshot/.gradle/1.0-rc-3/taskArtifacts).
    > java.io.FileNotFoundException: /home/hudson/build/workspace/probparsers-snapshot/.gradle/1.0-rc-3/taskArtifacts/cache.properties (No such file or directory)
  • 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 (/home/hudson/build/workspace/probparsers-snapshot/.gradle/1.0-rc-3/taskArtifacts).
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:53)
    at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.doOpenDir(DefaultCacheFactory.java:62)
    at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.open(DefaultCacheFactory.java:100)
    at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:182)
    at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:132)
    at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:119)
    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:155)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
    at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
    at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
    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.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31)
    at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20)
    at org.gradle.launcher.Main.doAction(Main.java:48)
    at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:39)
    at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
    Caused by: org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: /home/hudson/build/workspace/probparsers-snapshot/.gradle/1.0-rc-3/taskArtifacts/cache.properties (No such file or directory)
    at org.gradle.util.GUtil.loadProperties(GUtil.java:195)
    at org.gradle.cache.internal.DefaultPersistentDirectoryCache.determineIfCacheIsValid(DefaultPersistentDirectoryCache.java:99)
    at org.gradle.cache.internal.DefaultPersistentDirectoryCache.init(DefaultPersistentDirectoryCache.java:61)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:47)
    ... 31 more
    Caused by: java.io.FileNotFoundException: /home/hudson/build/workspace/probparsers-snapshot/.gradle/1.0-rc-3/taskArtifacts/cache.properties (No such file or directory)
    at org.gradle.util.GUtil.loadProperties(GUtil.java:188)
    ... 34 more


 Comments   
Comment by Adam Murdoch [ 06/May/12 ]

I notice that your build script configures the 'clean' task to deletes the .gradle directory. This is not supported: you should not delete the .gradle directory from within Gradle, as Gradle uses this directory to track various pieces of state during the build. The error is complaining that the .gradle directory has been removed from underneath Gradle (the error message could be a bit clearer, admittedly).

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:17:09 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.