[GRADLE-2084] up to date checks and serializable Created: 06/Feb/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-7
Fix Version/s: None

Type: Bug
Reporter: Philip Crotwell Assignee: Unassigned
Resolution: Won't Fix Votes: 0

Attachments: Text File gradle-2084.patch    

 Description   

I was playing with up-to-date checks on non-file properties and generated this error. This happened after I first tried an object input where I had forgotten to implement equals/hashcode. I then added them to the class, but because I had not added a serialVersionUID field, the additional methods caused a InvalidClassException: local class incompatible: exception.

Given that this happened within the up-to-date check, it seems like this should be caught and the up-to-date simply fail, triggering a rebuild, instead of the whole build stopping, as an incompatible class is by definition different, and hence not up to date.

FAILURE: Build aborted because of an internal error.

  • What went wrong:
    Build aborted because of an unexpected internal error. Please file an issue at: http://www.gradle.org.
  • Try:
    Run with --debug option to get additional debug info.
  • Exception is:
    org.gradle.api.UncheckedIOException: Could not read entry ':gee:generateXmlConfig' from cache taskArtifacts.bin (/export/home/crotwell/dev/seis/.gradle/1.0-milestone-7/taskArtifacts/taskArtifacts.bin).
    at org.gradle.cache.internal.btree.BTreePersistentIndexedCache.get(BTreePersistentIndexedCache.java:127)
    at org.gradle.cache.internal.MultiProcessSafePersistentIndexedCache$1.create(MultiProcessSafePersistentIndexedCache.java:38)
    at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.readFromFile(DefaultFileLockManager.java:130)
    at org.gradle.cache.internal.DefaultCacheAccess$UnitOfWorkFileAccess.readFromFile(DefaultCacheAccess.java:281)
    at org.gradle.cache.internal.MultiProcessSafePersistentIndexedCache.get(MultiProcessSafePersistentIndexedCache.java:36)
    at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.gradle.listener.LazyCreationProxy$LazyInvocationHandler.invoke(LazyCreationProxy.java:49)
    at $Proxy18.get(Unknown Source)
    at org.gradle.api.internal.changedetection.CacheBackedTaskHistoryRepository.loadHistory(CacheBackedTaskHistoryRepository.java:89)
    at org.gradle.api.internal.changedetection.CacheBackedTaskHistoryRepository.getHistory(CacheBackedTaskHistoryRepository.java:43)
    at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository.getStateFor(DefaultTaskArtifactStateRepository.java:48)
    at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository.getStateFor(ShortCircuitTaskArtifactStateRepository.java:38)
    at org.gradle.api.internal.changedetection.FileCacheBroadcastTaskArtifactStateRepository.getStateFor(FileCacheBroadcastTaskArtifactStateRepository.java:31)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:243)
    at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
    at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
    at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
    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.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
    at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103)
    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:152)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:108)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:76)
    at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
    at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
    at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
    at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:238)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:222)
    at org.gradle.launcher.Main.doAction(Main.java:48)
    at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
    at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
    at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
    at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
    at org.gradle.launcher.Main.main(Main.java:39)
    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.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)
    at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
    Caused by: java.io.InvalidClassException: edu.sc.seis.launch4j.Launch4jPluginExtension; local class incompatible: stream classdesc serialVersionUID = -7204265802869386416, local class serialVersionUID = 2336965903607220777
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.ArrayList.readObject(ArrayList.java:593)
    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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at org.gradle.cache.DefaultSerializer.read(DefaultSerializer.java:43)
    at org.gradle.cache.internal.btree.BTreePersistentIndexedCache$DataBlock.getValue(BTreePersistentIndexedCache.java:654)
    at org.gradle.cache.internal.btree.BTreePersistentIndexedCache.get(BTreePersistentIndexedCache.java:119)
    ... 63 more

BUILD FAILED



 Comments   
Comment by Philip Crotwell [ 06/Feb/12 ]

I addition, when a serialization error happens during up-to-date checks, gradle should remove the offending serialized object from the cache.

I tried doing a clean task, but still get the same serialization error. I would think that a cleanXYZ would remove up-to-date information from the cache for task XYZ, but it doesn't seem to.

Comment by Philip Crotwell [ 06/Feb/12 ]

A work around in case anyone else stumbles into this same issue:

gradle -C rebuild clean
will zap all the up-to-date cached information allowing you to start over cleanly.

Comment by Philip Crotwell [ 06/Mar/12 ]

patch, catches exception, removes item from cache, returns null so up-to-date check fails

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