cdsap / Talaiot

Simple and extensible plugin to track task times in your Gradle Project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IllegalStateException: Task information is not available, as this task execution graph has not been populated.

mustafaberkaymutlu opened this issue · comments

Hello,
I am having this issue when I try to sync my project:

FAILURE: Build failed with an exception.

* What went wrong:
Task information is not available, as this task execution graph has not been populated.

* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
java.lang.IllegalStateException: Task information is not available, as this task execution graph has not been populated.
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.ensurePopulated(DefaultTaskExecutionGraph.java:360)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.getAllTasks(DefaultTaskExecutionGraph.java:327)
	at io.github.cdsap.talaiot.TalaiotListener.initQueue(TalaiotListener.kt:117)
	at io.github.cdsap.talaiot.TalaiotListener.projectsEvaluated(TalaiotListener.kt:108)
	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$ListenerDispatch.dispatch(DefaultListenerManager.java:421)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy26.projectsEvaluated(Unknown Source)

It seems like this line

val executedTasks = gradle.taskGraph.allTasks.map { TaskName(name = it.name, path = it.path) }

is throwing an IllegalStateException https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/java/org/gradle/execution/taskgraph/DefaultTaskExecutionGraph.java#L360
because graph is empty at that time, can we handle this scenario in the library, or I also appreciate if you help me fix our setup.
Thanks in advance!

Issue might be related to my Gradle version: 7.1.
When I downgrade my Gradle version to 7.0.2 it seems to be working well.

hi @mustafaberkaymutlu thanks for the report and the detailed description.
I was not able to reproduce the problem, I triggered a regression with 7.1 and was ok. I updated anyways the project with Gradle 7.1(#300) and deployed a new snapshot version. In case you have time you can test it please, more details here: https://github.com/cdsap/Talaiot#snapshots--

Trying to understand better the problem I checked if there are some relevant changes in the DefaultTaskExecutionGraph for 7.1 but I didn't see anything. Are you using Gradle Configuration Cache or another specific configuration?

Thanks again, and let me know

Hello,
Thanks for checking this so quickly!

We don't use configuration cache, however we do have build cache enabled.

I don't have a sample project to reproduce this issue at the moment, I will try again to find the root cause and then let you know. I'll also try with the snapshot version to see if there is a difference.
but there could be something else in our setup that is causing this, because we have other gradle plugins as well.

Best,
Mustafa.

@mustafaberkaymutlu I was able to reproduce locally the issue. It's only happening in the IDE, command line works well. We just published a new version:

plugins {
  id "io.github.cdsap.talaiot" version "1.5.1"
}

Can you verify please?

I just tried this,
When I use Talaiot 1.5.0 with Gradle 7.2 I can reproduce this issue,
and when I bump Talaiot to 1.5.1 then this issue doesn't happen, I think we can say your fix works!
Thanks for your help!

thanks for the heads-up, closing the issue