Hi Folks, I am facing the problem with configurati...
# configuration-cache
z
Hi Folks, I am facing the problem with configuration cache. I will truly appreciate some help. I noticed that our configuration cache isn’t running as expected on bitrise CI. Cache was being store but was never reused. On further Investigated, I figured out that there is missing
GRADLE_ENCRYPTION_KEY
on CI. Now that I have added the
GRADLE_ENCRYPTION_KEY
the cache was uploaded successfully but on next build when it tries to reuse it then it fails with following error.
Copy code
Here are the highlights of this release:
 - Configurable encryption key for configuration cache
 - Build init improvements
 - Build authoring improvements
For more details see <https://docs.gradle.org/8.6/release-notes.html>
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
Could not load the value of field `parameters` of `org.gradle.api.internal.provider.DefaultValueSourceProviderFactory$DefaultObtainedValue` bean found in field `obtainedValue` of `org.gradle.configurationcache.fingerprint.ConfigurationCacheFingerprint$ValueSource` bean found in Gradle runtime.
> Failed to instrument class org/jetbrains/kotlin/gradle/plugin/internal/CustomPropertiesFileValueSource$Parameters in ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:gradlePlugins]:buildSrc[:gradlePlugins]:root-project[:gradlePlugins]:project-dexGuardNoOpPlugin(export)}
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
BUILD FAILED in 7s
I am unable to understand how to resolve this. Can someone explain what’s going on here and how I might be able to resolve this?
plus1 1
Further details about the error, I ran the build with --debug and this is log that I notice.
Copy code
I have ran the build again with --debug I see the following logs
2024-03-12T17:46:16.978+0000 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache resourceHashesCache.bin (/root/.gradle/caches/8.6/fileHashes/resourceHashesCache.bin)
2024-03-12T17:46:20.790+0000 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for Configuration Cache (/bitrise/src/.gradle/configuration-cache)
2024-03-12T17:46:20.790+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on Configuration Cache (/bitrise/src/.gradle/configuration-cache).
2024-03-12T17:46:20.790+0000 [DEBUG] [org.gradle.cache.internal.DefaultPersistentDirectoryStore] Configuration Cache (/bitrise/src/.gradle/configuration-cache) has last been fully cleaned up 25 hours ago
2024-03-12T17:46:20.791+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Clean up Configuration Cache (/bitrise/src/.gradle/configuration-cache)' started
2024-03-12T17:46:20.792+0000 [INFO] [org.gradle.cache.internal.LeastRecentlyUsedCacheCleanup] Configuration Cache (/bitrise/src/.gradle/configuration-cache) removing files not accessed on or after Tue Mar 05 17:46:20 UTC 2024.
2024-03-12T17:46:20.795+0000 [INFO] [org.gradle.cache.internal.AbstractCacheCleanup] Configuration Cache (/bitrise/src/.gradle/configuration-cache) cleanup deleted 0 files/directories.
2024-03-12T17:46:20.795+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Clean up Configuration Cache (/bitrise/src/.gradle/configuration-cache)'
2024-03-12T17:46:20.795+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Clean up Configuration Cache (/bitrise/src/.gradle/configuration-cache)' completed
2024-03-12T17:46:20.797+0000 [INFO] [org.gradle.cache.internal.DefaultPersistentDirectoryStore] Configuration Cache (/bitrise/src/.gradle/configuration-cache) cleaned up in 0.004 secs.
2024-03-12T17:46:20.799+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Run build'
2024-03-12T17:46:20.799+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Run build' completed
2024-03-12T17:46:20.801+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker: released lock on worker lease
2024-03-12T17:46:20.803+0000 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopping 0 deployment handles
2024-03-12T17:46:20.803+0000 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopped deployment handles
2024-03-12T17:46:20.804+0000 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for file hash cache (/bitrise/src/.gradle/8.6/fileHashes)
2024-03-12T17:46:20.805+0000 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileHashes.bin (/bitrise/src/.gradle/8.6/fileHashes/fileHashes.bin)
2024-03-12T17:46:20.805+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on file hash cache (/bitrise/src/.gradle/8.6/fileHashes).
2024-03-12T17:46:20.805+0000 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for checksums cache (/bitrise/src/.gradle/8.6/checksums)
2024-03-12T17:46:20.806+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on checksums cache (/bitrise/src/.gradle/8.6/checksums).
2024-03-12T17:46:20.814+0000 [DEBUG] [org.gradle.cache.internal.VersionSpecificCacheCleanupAction] Processed version-specific caches at /bitrise/src/.gradle for cleanup in 0.007 secs
2024-03-12T17:46:20.827+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
2024-03-12T17:46:20.827+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2024-03-12T17:46:20.827+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
2024-03-12T17:46:20.827+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2024-03-12T17:46:20.827+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not load the value of field `parameters` of `org.gradle.api.internal.provider.DefaultValueSourceProviderFactory$DefaultObtainedValue` bean found in field `obtainedValue` of `org.gradle.configurationcache.fingerprint.ConfigurationCacheFingerprint$ValueSource` bean found in Gradle runtime.
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to instrument class org/jetbrains/kotlin/gradle/plugin/internal/CustomPropertiesFileValueSource$Parameters in ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:gradlePlugins]:buildSrc[:gradlePlugins]:root-project[:gradlePlugins]:project-dexGuardNoOpPlugin(export)}
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --stacktrace option to get the stack trace.
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --scan to get full insights.
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Get more help at <https://help.gradle.org>.
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
2024-03-12T17:46:20.828+0000 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 7s
m
You're probably missing one of the Gradle cache directories in your CI cache snapshot, most likely
$GRADLE_USER_HOME/caches/transforms-<some-number>
or
$GRADLE_USER_HOME/caches/jars-9
s
Our cache has the second folder but not the first one. Does configuration cache depend on transforms? Is it possible to prove that with logs?
m
Since 8.6 CC uses transforms to process build script classpath instead of the ad hoc processing that outputs to the
jars
cache. Besides, AFAIR, some transforms may run at configuration time with CC on, as part of the dependency resolution, and the restored task graph needs their output to be present to work properly. The
jars
cache is still used for some steps in the pipeline, so it must be cached on CI too.
👍 1
s
I am testing now
j
If you have a gradle convention plugin you may need those related directories as well. There is another thread recently in this channel where that was discussed
s
Unfortunately I didn't have success today because I had to do something else.but i will do test. If that is case, we can communicate with bitrise to include those folders
I add convention build's build folder and transforms. Now I don't get the same crash. But cc is not usable. Some tasks say there is no cc, some say some fields have changed. We might need to cache more.