[GRADLE-1154] Hudson build with UncheckedIOException on cache.bin Created: 20/Sep/10  Updated: 04/Jan/13  Resolved: 16/Oct/11

Status: Resolved
Project: Gradle
Affects Version/s: 0.9.1
Fix Version/s: 1.0-milestone-5

Type: Bug
Reporter: Spencer Allain Assignee: Adam Murdoch
Resolution: Fixed Votes: 0


 Description   

We have some WSDL generated java files, and recently when attempting to run parallel builds within Hudson, gradle-0.9-rc-1 failed with the below stack trace. Not sure if it's because of the parallel builds, or some other disk access race condition. I've not been able to replicate it again, but if I do, I'll be sure to update this JIRA.

FAILURE: Build aborted because of an internal error.

  • What went wrong:
    Build aborted because of an unexpected internal error. Please file an issue at: www.gradle.org.
  • Try:
    Run with -d option to get additional debug info.
  • Exception is:

org.gradle.api.UncheckedIOException: Could not read entry '<http://hudson:8080/hudson/job/FAKE_NAME/fake/path/to/dynamically/generated/java/files/XYZ.java'> from cache '/home/hudson/.gradle/caches/0.9-rc-1/outputFileStates/cache.bin'.
at org.gradle.cache.btree.BTreePersistentIndexedCache.get(BTreePersistentIndexedCache.java:125)
at org.gradle.api.internal.changedetection.OutputFilesSnapshotter.snapshot(OutputFilesSnapshotter.java:63)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.snapshot(DefaultTaskArtifactStateRepository.java:254)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.update(DefaultTaskArtifactStateRepository.java:350)
at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository$1.update(ShortCircuitTaskArtifactStateRepository.java:43)
at org.gradle.api.internal.project.taskfactory.ExecutionShortCircuitTaskExecuter.execute(ExecutionShortCircuitTaskExecuter.java:52)
at org.gradle.api.internal.tasks.SkipTaskExecuter.doExecute(SkipTaskExecuter.java:57)
at org.gradle.api.internal.tasks.SkipTaskExecuter.execute(SkipTaskExecuter.java:35)
at org.gradle.api.internal.tasks.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:32)
at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:231)
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:161)
at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:153)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:107)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:75)
at org.gradle.launcher.Main.execute(Main.java:93)
at org.gradle.launcher.Main.main(Main.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.launcher.GradleMain.main(GradleMain.java:49)
Caused by: java.lang.ClassCastException: null
at java.lang.Class.cast(Class.java:2990)
at org.gradle.cache.btree.CachingBlockStore.read(CachingBlockStore.java:80)
at org.gradle.cache.btree.FreeListBlockStore.read(FreeListBlockStore.java:78)
at org.gradle.cache.btree.StateCheckBlockStore.read(StateCheckBlockStore.java:61)
at org.gradle.cache.btree.BTreePersistentIndexedCache$IndexBlock.get(BTreePersistentIndexedCache.java:441)
at org.gradle.cache.btree.BTreePersistentIndexedCache.get(BTreePersistentIndexedCache.java:115)
... 24 common frames omitted



 Comments   
Comment by Spencer Allain [ 20/Sep/10 ]

Got it to happen again with a slightly different stack trace.

org.gradle.api.UncheckedIOException: Could not read entry '/home/hudson/deployed/jobs/FAKE_NAME2/workspace/fake/path/build/classes/more/fake/paths/ObjectFactory.class' from cache '/home/hudson/.gradle/caches/0.9-rc-1/fileHashes/cache.bin'.
at org.gradle.cache.btree.BTreePersistentIndexedCache.get(BTreePersistentIndexedCache.java:125)
at org.gradle.api.internal.changedetection.CachingHasher.hash(CachingHasher.java:35)
at org.gradle.api.internal.changedetection.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:44)
at org.gradle.api.internal.changedetection.OutputFilesSnapshotter.snapshot(OutputFilesSnapshotter.java:74)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.snapshot(DefaultTaskArtifactStateRepository.java:254)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.update(DefaultTaskArtifactStateRepository.java:350)
at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository$1.update(ShortCircuitTaskArtifactStateRepository.java:43)
at org.gradle.api.internal.project.taskfactory.ExecutionShortCircuitTaskExecuter.execute(ExecutionShortCircuitTaskExecuter.java:52)
at org.gradle.api.internal.tasks.SkipTaskExecuter.doExecute(SkipTaskExecuter.java:57)
at org.gradle.api.internal.tasks.SkipTaskExecuter.execute(SkipTaskExecuter.java:35)
at org.gradle.api.internal.tasks.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:32)
at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:231)
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:161)
at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:153)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:107)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:75)
at org.gradle.launcher.Main.execute(Main.java:93)
at org.gradle.launcher.Main.main(Main.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.launcher.GradleMain.main(GradleMain.java:49)
Caused by: org.gradle.cache.btree.CorruptedCacheException: Corrupted FreeListBlock 0 found in cache '/home/hudson/.gradle/caches/0.9-rc-1/fileHashes/cache.bin'.
at org.gradle.cache.btree.FileBackedBlockStore$BlockImpl.blockCorruptedException(FileBackedBlockStore.java:239)
at org.gradle.cache.btree.FileBackedBlockStore$BlockImpl.read(FileBackedBlockStore.java:215)
at org.gradle.cache.btree.FileBackedBlockStore.read(FileBackedBlockStore.java:91)
at org.gradle.cache.btree.FileBackedBlockStore.readFirst(FileBackedBlockStore.java:83)
at org.gradle.cache.btree.CachingBlockStore.readFirst(CachingBlockStore.java:70)
at org.gradle.cache.btree.FreeListBlockStore.open(FreeListBlockStore.java:55)
at org.gradle.cache.btree.StateCheckBlockStore.open(StateCheckBlockStore.java:29)
at org.gradle.cache.btree.BTreePersistentIndexedCache.doOpen(BTreePersistentIndexedCache.java:108)
at org.gradle.cache.btree.BTreePersistentIndexedCache.rebuild(BTreePersistentIndexedCache.java:201)
at org.gradle.cache.btree.BTreePersistentIndexedCache.get(BTreePersistentIndexedCache.java:121)
... 26 common frames omitted

Generated at Wed Jun 30 11:48:20 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.