[GRADLE-1543] Tooling API fails to connect to Gradle Daemon in execution environment that has network proxy Created: 13/May/11 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.0-milestone-3 |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Kris De Volder | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 3 |
Description |
My windows box is behind a proxy firewall. I was able to install STS and the Gradle extensions by setting up the proxies by doing the following: 1) Add to my STS.ini file right after -vmargs 2) In Eclipse preferences "General >> Network Connections" switch to "manual" and configure the same proxy settings here as well. After doing that I tried importing the simple "Java quickstart" sample project. Proxy settings seem to get to Gradle ok... at least the API was able to download milestone 3 zip. However, it seems to have trouble creating a connection to the Gradle Daemon running on localhost. I get the following exception: java.lang.reflect.InvocationTargetException at com.springsource.sts.gradle.core.util.GradleRunnable.run(GradleRunnable.java:80) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Caused by: org.eclipse.core.runtime.CoreException: Could not fetch model of type 'HierarchicalEclipseProject' using Gradle distribution 'http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip'. at com.springsource.sts.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:59) at com.springsource.sts.gradle.core.GradleModelProvider$PrefetchingModelProvider.requestModel(GradleModelProvider.java:93) at com.springsource.sts.gradle.core.GradleProject.getGradleModel(GradleProject.java:328) at com.springsource.sts.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:341) at com.springsource.sts.gradle.ui.wizards.GradleImportWizardPageOne$9.doit(GradleImportWizardPageOne.java:422) at com.springsource.sts.gradle.core.util.GradleRunnable.run(GradleRunnable.java:72) ... 1 more Caused by: org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'HierarchicalEclipseProject' using Gradle distribution 'http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip'. at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:46) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:73) at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.gradle.api.GradleException: Timeout waiting to connect to Gradle daemon. at org.gradle.launcher.DaemonConnector.connect(DaemonConnector.java:122) at org.gradle.launcher.DaemonClient.execute(DaemonClient.java:78) at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(DaemonGradleLauncherActionExecuter.java:34) at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(DaemonGradleLauncherActionExecuter.java:24) at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(LoggingBridgingGradleLauncherActionExecuter.java:56) at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(LoggingBridgingGradleLauncherActionExecuter.java:30) at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:78) at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:72) at org.gradle.tooling.internal.consumer.LazyConnection$3.run(LazyConnection.java:90) at org.gradle.tooling.internal.consumer.LazyConnection$3.run(LazyConnection.java:88) at org.gradle.tooling.internal.consumer.LazyConnection.withConnection(LazyConnection.java:98) at org.gradle.tooling.internal.consumer.LazyConnection.getModel(LazyConnection.java:88) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$2.run(ProgressLoggingConnection.java:61) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$2.run(ProgressLoggingConnection.java:59) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.run(ProgressLoggingConnection.java:74) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.getModel(ProgressLoggingConnection.java:59) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:53) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:51) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:71) ... 4 more Root exception: org.eclipse.core.runtime.CoreException: Could not fetch model of type 'HierarchicalEclipseProject' using Gradle distribution 'http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip'. at com.springsource.sts.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:59) at com.springsource.sts.gradle.core.GradleModelProvider$PrefetchingModelProvider.requestModel(GradleModelProvider.java:93) at com.springsource.sts.gradle.core.GradleProject.getGradleModel(GradleProject.java:328) at com.springsource.sts.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.java:341) at com.springsource.sts.gradle.ui.wizards.GradleImportWizardPageOne$9.doit(GradleImportWizardPageOne.java:422) at com.springsource.sts.gradle.core.util.GradleRunnable.run(GradleRunnable.java:72) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Caused by: org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'HierarchicalEclipseProject' using Gradle distribution 'http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip'. at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:46) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:73) at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.gradle.api.GradleException: Timeout waiting to connect to Gradle daemon. at org.gradle.launcher.DaemonConnector.connect(DaemonConnector.java:122) at org.gradle.launcher.DaemonClient.execute(DaemonClient.java:78) at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(DaemonGradleLauncherActionExecuter.java:34) at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(DaemonGradleLauncherActionExecuter.java:24) at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(LoggingBridgingGradleLauncherActionExecuter.java:56) at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(LoggingBridgingGradleLauncherActionExecuter.java:30) at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:78) at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:72) at org.gradle.tooling.internal.consumer.LazyConnection$3.run(LazyConnection.java:90) at org.gradle.tooling.internal.consumer.LazyConnection$3.run(LazyConnection.java:88) at org.gradle.tooling.internal.consumer.LazyConnection.withConnection(LazyConnection.java:98) at org.gradle.tooling.internal.consumer.LazyConnection.getModel(LazyConnection.java:88) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$2.run(ProgressLoggingConnection.java:61) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$2.run(ProgressLoggingConnection.java:59) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.run(ProgressLoggingConnection.java:74) at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.getModel(ProgressLoggingConnection.java:59) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:53) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:51) at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:71) ... 4 more |
Comments |
Comment by Adam Murdoch [ 15/May/11 ] |
Some things to check:
|
Comment by Kris De Volder [ 16/May/11 ] |
How do I check if the Daemon is running? I'll give the commandline stuff a try, report back later on. |
Comment by Kris De Volder [ 16/May/11 ] |
I've installed the Gradle commandline tools on the windows box (latest snapshot drop from artifactory): when I do "gradle --daemon" I get this: C:\Documents and Settings\kdvolder\Desktop\Dropbox\Dropbox\resources\projects\he lloWorldTask>gradle --daemon Note: the Gradle build daemon is an experimental feature. As such, you may experience unexpected build failures. You may need to occasiona lly stop the daemon. FAILURE: Build failed with an exception. * What went wrong: Timeout waiting to connect to Gradle daemon. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Also ran it with the suggested debug options: C:\Documents and Settings\kdvolder\Desktop\Dropbox\Dropbox\resources\projects\he lloWorldTask>gradle --daemon --stacktrace --debug 11:43:28.811 [WARN] [org.gradle.launcher.DaemonClient] Note: the Gradle build da emon is an experimental feature. 11:43:28.811 [WARN] [org.gradle.launcher.DaemonClient] As such, you may experien ce unexpected build failures. You may need to occasionally stop the daemon. 11:43:28.874 [INFO] [org.gradle.launcher.DaemonConnector] Starting Gradle daemon 11:43:59.030 [ERROR] [org.gradle.BuildExceptionReporter] 11:43:59.046 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed w ith an exception. 11:43:59.061 [ERROR] [org.gradle.BuildExceptionReporter] 11:43:59.061 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 11:43:59.061 [ERROR] [org.gradle.BuildExceptionReporter] Timeout waiting to conn ect to Gradle daemon. 11:43:59.077 [ERROR] [org.gradle.BuildExceptionReporter] 11:43:59.077 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 11:43:59.077 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace o ption to get the stack trace. Run with --info or --debug option to get more log output. |
Comment by Szczepan Faber [ 31/May/11 ] |
Hey, I'm having troubles reproducing the problem. 1. I tried various firewall/proxy configurations on my Windows 7 and mac with milestone-3 and the latest snapshot Can you share some more details about your environment that can help me reproduce it? |
Comment by Kris De Volder [ 31/May/11 ] |
It is a view on a Windows XP VM running behind a proxy firewall. It could be something in the setup of that machine. But to be honest I'm not sure what info to provide. It could very well be that the problem isn't Gradle but somehow the machine's proxy configuration isn't quite setup correctly. If you can't reproduce it, I wouldn't worry too much about it. Just close the bug as 'cannot reproduce'. |
Comment by Szczepan Faber [ 18/Jun/11 ] |
I cannot seem to reproduce this issue. |
Comment by Kris De Volder [ 22/Nov/11 ] |
One of our user just reported experiencing this kind of problem in STS using milestone 6 snapshot of Gradle. https://issuetracker.springsource.com/browse/STS-2287 Maybe this issue should be reopened. I've asked the user to try to provide more details here. |
Comment by Szczepan Faber [ 22/Nov/11 ] |
Please provide more info if possible. Thanks! |
Comment by Kris De Volder [ 23/Nov/11 ] |
All that I can provide, which may or may not be relevant... It seems that both cases where there was a problem involved a Windows 32 bit environment. |
Comment by Szczepan Faber [ 24/Nov/11 ] |
Thanks Kris! |
Comment by Osama Rashwan [ 10/Feb/12 ] |
Hi , potentialContext.getDaemonOpts()[-Xoptionsfile=C:\IBM\WebSphere\AppServer8\j desiredContext.getDaemonOpts()[-XX:MaxPermSize=256m, -Xmx1024m] is equal java home true , is equal DaemonOpts false |
Comment by Adam Murdoch [ 10/Feb/12 ] |
@Osama, I suspect you're running into a different problem with the same symptom: http://issues.gradle.org/browse/GRADLE-2089 |
Comment by Osama Rashwan [ 11/Feb/12 ] |
@Adam Thanks for your replay , yes the issue was because of IBM JDK. and it is fixed after switching to Oracle JDK |
Comment by Michael Brand [ 28/Feb/12 ] |
We're seeing a similar problem. We just added a new developer (we already have half a dozen or so), and he is unable to import to SpringSource's STS because of this issue. He's running Windows 7 64 bit and the latest Eclipse Indigo 64 bit. No one else has seen this issue. We've cached the gradle-1.0-milestone-7-bin.zip file to a local server so that we don't have to deal with firewall issues. We've tried using native, manual, and direct network settings. We've restarted everything. We are having no problem at the command line, but this consistently fails when trying to import from the SpringSource STS plugin to Eclipse. Here's a stack trace of the error: Still get the gradel error when I do it from home. It is the same timeout error: Timeout waiting to connect to Gradle daemon java.lang.reflect.InvocationTargetException |
Comment by James Anderson [ 08/Mar/12 ] |
I am also unable to connect to the Gradle daemon, either from the command line or from STS 2.8/2.9. I'm on WinXP 32bit, with Sun/Oracle JDK 1.6.0_31. C:\>gradle --daemon --stacktrace FAILURE: Build failed with an exception.
|
Comment by Adam Murdoch [ 08/Mar/12 ] |
@James, which version of Gradle are you using (you can run gradle -v to get the details)? Also, could you try with the recent 1.0-milestone-9 snapshot (see http://gradle.org/release-candidate)? There have been a bunch of fixes in this area. |
Comment by Szczepan Faber [ 11/Mar/12 ] |
Also, can you run with --debug ? |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |