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

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

Closed
mustafaberkaymutlu opened this issue Jun 27, 2021 · 6 comments

Comments

@mustafaberkaymutlu
Copy link

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!

@mustafaberkaymutlu mustafaberkaymutlu changed the title Task information is not available, as this task execution graph has not been populated. IllegalStateException: Task information is not available, as this task execution graph has not been populated. Jun 27, 2021
@mustafaberkaymutlu
Copy link
Author

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.

@cdsap
Copy link
Owner

cdsap commented Jun 27, 2021

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

@mustafaberkaymutlu
Copy link
Author

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.

@cdsap
Copy link
Owner

cdsap commented Jul 9, 2021

@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?

@mustafaberkaymutlu
Copy link
Author

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!

@cdsap
Copy link
Owner

cdsap commented Oct 3, 2021

thanks for the heads-up, closing the issue

@cdsap cdsap closed this as completed Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants