This message was deleted.
# community-support
s
This message was deleted.
v
Is that really the full stacktrace? It neither contains the
NullPointerException
, nor the "Cannot invoke" exception. Can you provide a build
--scan
?
j
yes its the full stracktrace arg no it seems there was a paste error
the failing task itself doesn't seem relevant
this one is full
v
Ah, it's unfortunate that you run Gradle with Java 17. Because now you have the null pointer exception without stacktrace as you got the same multiple times.
If you stop the daemon, will it still reproduce?
j
not locally
v
Because in a fresh daemon the NPE should have a stacktrace
Hm, maybe you can find the actual NPE stacktrace still in the daemon logs
j
but on CI I have the same error popping up with --no-daemon --no-configure-on-demand
v
<GRADLE_USER_HOME>/daemon/<version>/*.log
j
👀
I got one
Copy code
Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':account-settings-backend:runtimeClasspath'.
        at org.gradle.api.internal.artifacts.ResolveExceptionContextualizer.contextualize(ResolveExceptionContextualizer.java:55)
        at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveBuildDependencies(ErrorHandlingConfigurationResolver.java:65)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveGraphForBuildDependenciesIfRequired$5(DefaultConfiguration.java:912)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$CalculatedModelValueImpl.update(DefaultProjectStateRegistry.java:493)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphForBuildDependenciesIfRequired(DefaultConfiguration.java:909)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1800(DefaultConfiguration.java:173)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$VisitedArtifactsSetProvider.getTaskDependencyValue(DefaultConfiguration.java:1656)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$VisitedArtifactsSetProvider.getTaskDependencyValue(DefaultConfiguration.java:1651)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$SelectedArtifactsProvider.getTaskDependencyValue(DefaultConfiguration.java:1693)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$SelectedArtifactsProvider.getTaskDependencyValue(DefaultConfiguration.java:1667)
        at org.gradle.api.internal.artifacts.configurations.ResolutionBackedFileCollection.visitDependencies(ResolutionBackedFileCollection.java:56)
        at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:103)
        at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmptyEdges.getNodeValues(CachingDirectedGraphWalker.java:213)
        at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:121)
        at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:73)
        at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:66)
        ... 142 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.gradle.api.provider.Provider.get()" because the return value of "java.util.Map.get(Object)" is null
        at org.gradle.api.internal.attributes.DefaultMutableAttributeContainer.lambda$realizeAllLazyAttributes$4(DefaultMutableAttributeContainer.java:194)
        at org.gradle.api.internal.attributes.DefaultMutableAttributeContainer.realizeAllLazyAttributes(DefaultMutableAttributeContainer.java:194)
        at org.gradle.api.internal.attributes.DefaultMutableAttributeContainer.asImmutable(DefaultMutableAttributeContainer.java:139)
        at org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultProjectLocalComponentProvider.lambda$getComponent$0(DefaultProjectLocalComponentProvider.java:63)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:413)
        at org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultProjectLocalComponentProvider.getComponent(DefaultProjectLocalComponentProvider.java:63)
        at org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultLocalComponentRegistry$MetadataSupplier.calculateValue(DefaultLocalComponentRegistry.java:88)
        at org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultLocalComponentRegistry$MetadataSupplier.calculateValue(DefaultLocalComponentRegistry.java:79)
        at org.gradle.internal.model.CalculatedValueContainer$CalculationState.lambda$attachValue$0(CalculatedValueContainer.java:229)
        at org.gradle.internal.Try.ofFailable(Try.java:41)
        at org.gradle.internal.model.CalculatedValueContainer$CalculationState.attachValue(CalculatedValueContainer.java:224)
        at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:197)
        at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:188)
        at org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultLocalComponentRegistry.getComponent(DefaultLocalComponentRegistry.java:63)
        at org.gradle.api.internal.artifacts.DefaultComponentSelectorConverter.getSelector(DefaultComponentSelectorConverter.java:56)
        at org.gradle.api.internal.artifacts.DefaultComponentSelectorConverter.getModule(DefaultComponentSelectorConverter.java:44)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyState.getModuleIdentifier(DependencyState.java:85)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DefaultPendingDependenciesVisitor.maybeAddAsPendingDependency(DefaultPendingDependenciesVisitor.java:35)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.visitDependencies(NodeState.java:445)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.visitOutgoingDependencies(NodeState.java:292)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:172)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:148)
        at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:157)
        at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveBuildDependencies(DefaultConfigurationResolver.java:161)
        at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveBuildDependencies(ShortCircuitEmptyConfigurationResolver.java:77)
        at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveBuildDependencies(ErrorHandlingConfigurationResolver.java:63)
        ... 156 more
Copy code
Could not determine the dependencies of task ':account-settings-backend:bootJar'.
> Could not resolve all dependencies for configuration ':account-settings-backend:runtimeClasspath'.
   > Cannot invoke "org.gradle.api.provider.Provider.get()" because the return value of "java.util.Map.get(Object)" is null
v
Ah, yeah, so your initially posted two variants are actually the same, just one with the actual NPE with message and the other with the stripped NPE
I really wonder who thought that would be a helpful change
j
hmm isn't it linked to java 17 erasing the stack and error message for repeat exceptions
if gradle has the error message it displays it otherwise it displays the exception type ? (just guessing here)
v
Yes, but as I said, I really wonder how someone thought that might be a beneficial change
j
saving storage space on servers that log lots of errors 🙂 I'll find the setting to disable it for my gradle daemon
v
The new improved NPE messages like this one that exactly tell what in the line was
null
and what was tried to call are great. But those erased for repeated exceptions I always just had confusion caused by them.
👍 1
If logs get too big, fix the damn error, developer 😄
j
yeah I agree but I have seen companies with servers throwing GBs of stacktraces in normal operation, some opensource projects log warnings with full stacktrace upon startup in normal configuration.
v
Oh, well, great code, but it is in there since 7.5.0 already: https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/java/org/gradle/api/internal/attributes/DefaultMutableAttributeContainer.java#L191-L195 No wonder it fails sometimes. To prevent a concurrent modification exception, they get the keys of a map, then iterate over the keys and get the value from the map, calling
get()
on the result. Well, actually it is also not a thread-safe map, but a simple
LinkedHashMap
. I'd suppose it is used from different threads and even if it were a thread-safe map, it could be modified by another thread while iterating over the keys. I'd say you should definitely open a bug report. No idea why it behaves differently in 8.3, maybe the code that modifies the map was introduce there or something like that.
j
hmmm ok thank you
👌 1