Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] config cache not supported #140

Closed
ber4444 opened this issue May 23, 2023 · 5 comments · Fixed by #142
Closed

[BUG] config cache not supported #140

ber4444 opened this issue May 23, 2023 · 5 comments · Fixed by #142
Labels
bug Something isn't working

Comments

@ber4444
Copy link

ber4444 commented May 23, 2023

Describe the bug
Task :nexusIQScan of type org.sonatype.gradle.plugins.scan.nexus.iq.scan.NexusIqScanTask: invocation of 'Task.project' at execution time is unsupported.
See https://docs.gradle.org/8.1.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

To Reproduce
./gradlew nexusIQScan

Expected behavior
Works

Screenshots

Desktop (please complete the following information):

  • OS: OS X 13.3.1
  • Gradle Version: 8.1.1
  • JVM Version and Flavor: Java 17, Open JDK
  • Nexus IQ Server Version: 153

Additional context
workaround is org.gradle.unsafe.configuration-cache=false

@ber4444 ber4444 added the bug Something isn't working label May 23, 2023
@github-actions
Copy link

Hi!

First of all, thank you for opening your first issue. Elementary, we appreciate all feedback that helps us continue improving this plugin.

As this is a community project we can't commit to official due dates for reviews and developing, but we're definitely committed to delivering services, integrations and plugins of top quality.

So please be patient, we will review your issue and get back to you as soon as we can!

Regards,
Sherlock Trunks 🐘

@guillermo-varela
Copy link
Contributor

Hi @ber4444

Would it be possible for you to please share with us a sample project so we can replicate the issue?

Thanks.

@ber4444
Copy link
Author

ber4444 commented May 30, 2023

Try with https://github.com/Morfly/MultiModuleMovies
use the latest Beta of the Android Gradle Plugin, and bump Gradle and other versions to latest

@guillermo-varela
Copy link
Contributor

Trying with https://github.com/Morfly/MultiModuleMovies as it apparently replicates the issue, although I see the application evaluation is done and the report is on the output.

The error "Invocation of 'Task.project' by task ':nexusIQScan' at execution time is unsupported." is show below the report:

Policy Action: None
Number of components affected: 113 critical, 0 severe, 0 moderate
Number of grandfathered policy violations: 215
Number of components: 209
The detailed report can be viewed online at http://localhost:8070/ui/links/application/movies-compose-multi-module/report/beb4ab9e18554f04a2e5aecd82b477ed


FAILURE: Build failed with an exception.

* What went wrong:
Configuration cache problems found in this build.

2 problems were found storing the configuration cache, 1 of which seems unique.
- Task `:nexusIQScan` of type `org.sonatype.gradle.plugins.scan.nexus.iq.scan.NexusIqScanTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

See the complete report at file:///folder/MultiModuleMovies/build/reports/configuration-cache/79i2xjc9862gsyhmov9lxncs8/cu8tk4l7hk0g2ef5h9cnoamsw/configuration-cache-report.html
> Invocation of 'Task.project' by task ':nexusIQScan' at execution time is unsupported.

Granted, even though the result is "Policy Action: None", the plugin exits with "FAILURE" due to this issue.

There are 2 stacktraces in the mentioned HTML file:

org.gradle.api.InvalidUserCodeException: Invocation of 'Task.project' by task ':nexusIQScan' at execution time is unsupported.
	at org.gradle.configurationcache.initialization.DefaultConfigurationCacheProblemsListener.onTaskExecutionAccessProblem(ConfigurationCacheProblemsListener.kt:74)
	at org.gradle.configurationcache.initialization.DefaultConfigurationCacheProblemsListener.onProjectAccess(ConfigurationCacheProblemsListener.kt:53)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:464)
	at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:446)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:434)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast.dispatch(DefaultListenerManager.java:221)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast.dispatch(DefaultListenerManager.java:192)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy91.onProjectAccess(Unknown Source)
	at org.gradle.api.internal.AbstractTask.notifyProjectAccess(AbstractTask.java:1053)
	at org.gradle.api.internal.AbstractTask.getProject(AbstractTask.java:237)
	at org.gradle.api.DefaultTask.getProject(DefaultTask.java:59)
	at org.sonatype.gradle.plugins.scan.nexus.iq.scan.NexusIqScanTask.buildUserAgent(NexusIqScanTask.java:213)
	at org.sonatype.gradle.plugins.scan.nexus.iq.scan.NexusIqScanTask.scan(NexusIqScanTask.java:96)
org.gradle.api.InvalidUserCodeException: Invocation of 'Task.project' by task ':nexusIQScan' at execution time is unsupported.
	at org.gradle.configurationcache.initialization.DefaultConfigurationCacheProblemsListener.onTaskExecutionAccessProblem(ConfigurationCacheProblemsListener.kt:74)
	at org.gradle.configurationcache.initialization.DefaultConfigurationCacheProblemsListener.onProjectAccess(ConfigurationCacheProblemsListener.kt:53)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:464)
	at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:446)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:434)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast.dispatch(DefaultListenerManager.java:221)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast.dispatch(DefaultListenerManager.java:192)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy91.onProjectAccess(Unknown Source)
	at org.gradle.api.internal.AbstractTask.notifyProjectAccess(AbstractTask.java:1053)
	at org.gradle.api.internal.AbstractTask.getProject(AbstractTask.java:237)
	at org.gradle.api.DefaultTask.getProject(DefaultTask.java:59)
	at org.sonatype.gradle.plugins.scan.nexus.iq.scan.NexusIqScanTask.scan(NexusIqScanTask.java:107)

@guillermo-varela
Copy link
Contributor

Hi @ber4444!

Version 2.6.1 of this plugin has been published and addresses the issue you reported:
https://github.com/sonatype-nexus-community/scan-gradle-plugin/releases/tag/2.6.1

Thank you for reporting the issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants