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
buildImage fails with unknown protocol error #31
Comments
Correction: I'm using open jdk 1.8.0_31 |
I tried with Oracle jdk 1.7.0_79, and got the same error. |
thanks, I'll investigate |
I have problems to reproduce the issue in my local environment. On Travis (with Oracle JDK 1.7) sometimes the tests fail, too, but I've added some code to tackle such problems. Could you please try with the latest version (same version as with your https issue :-) )? |
@ageorge303 does the image build always fail on your system? If so, could you help me finding the cause with the following steps?
The test passes on my Ubuntu 14.04 with OracleJDK 1.7.0_09 and in a Docker container with OpenJDK 1.8.0_45 |
That was successful. No errors. Date: Sun, 26 Apr 2015 08:49:26 -0700 @ageorge303 does the image build always fail on your system? If so, could you help me finding the cause with the following steps? git clone https://github.com/gesellix-docker/docker-client.git The test passes on my Ubuntu 14.04 with OracleJDK 1.7.0_09 and in a Docker container with OpenJDK 1.8.0_45 — |
I was looking at the --debug information from the version that works for me, and the subsequent ones which don't. 09:36:51.513 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting dependency de.gesellix:docker-client:2015-04-25T07-42-12(runtime) -> com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4(dependency: com.kohlschutter.junixsocket#junixsocket-native-common;2.0.4 {runtime=[compile(), runtime(), master()]}) |
Another difference; Doesn't work: 09:36:57.858 [INFO] [de.gesellix.docker.client.DockerClientImpl] using docker at 'unix:///var/run/docker.sock' I tried hardcoding with localhost but it didn't change anything. |
thanks! I added some more logging output and a kind of retry mechanism. could you watch the logs for messages like |
@ageorge303 can you post a stacktrace (running the Gradle script via |
Tobias, I didn't see a 'retry failed' message. Attached is stack trace. Andy Date: Tue, 28 Apr 2015 00:29:38 -0700 thanks! I added some more logging output and a kind of retry mechanism. could you watch the logs for messages like could not use the 'unix' protocol and retry failed with the most recent plugin version? — :copyWARToBuildContext UP-TO-DATE BUILD FAILED Total time: 10.881 secs |
Tobias, I installed the gradle and groovy plugins for eclipse. I can run tasks but it's not stopping at my breakpoints. I know you can only set breakpoints in classes. How are you developing your plugin? Andy Date: Tue, 28 Apr 2015 09:11:43 -0700 @ageorge303 can you post a stacktrace (running the Gradle script via -s) please? — |
@ageorge303 you can clone the plugin git repository, then build it with Debugging from a build.gradle is quite hard, but you might want to debug through an integration test like that one: https://github.com/gesellix-docker/gradle-docker-plugin/blob/master/src/integrationTest/groovy/de/gesellix/gradle/docker/DockerPluginIntegrationTest.groovy I sometimes don't debug, but test changes locally (without publishing the plugin to the world) by using
|
I guess you didn't use the most recent version of the plugin, I would have expected the following code with its log messages to be executed in case of a failure: https://github.com/gesellix-docker/docker-client/blob/master/src/main/groovy/de/gesellix/docker/client/protocolhandler/DockerURLHandler.groovy#L67 Please note that the plugin heavily relies on the Hope that helps. I appreciate that you're also trying to debug the error, so thank you very much in advance! If you need further help, just ask. Tobias |
I don't understand why it's not pulling in your changes.I initially specified the dependency like this: @ageorge303 you can clone the plugin git repository, then build it with ./gradlew build. If you don't want to run the integration tests, use a command like ./gr. Debugging from a build.gradle is quite hard, but you might want to debug through an integration test like that one: https://github.com/gesellix-docker/gradle-docker-plugin/blob/master/src/integrationTest/groovy/de/gesellix/gradle/docker/DockerPluginIntegrationTest.groovy I sometimes don't debug, but test changes locally (without publishing the plugin to the world) by using ./gradlew build install publishToMavenLocal. The "installed" package version can be used in a normal build.gradle where you only need to make Gradle search the local Maven repository. See https://github.com/gesellix-docker/gradle-docker-plugin-example/blob/master/build.gradle#L13 for an example: buildscript { — |
I published a new release with even more debug output. Please try again with the latest version. I have no idea why the debug out didn't appear yet. Since the expected output is logged on warn or error level, I wouldn't suggest to add any options. The new debug output needs the Could you please (again) try to execute your tasks, now including the Sorry for the inconvenience! |
import de.gesellix.gradle.docker.tasks.DockerInfoTask // works with Gradle 2.1+, for the old configuration see http://plugins.gradle.org/plugin/de.gesellix.docker // deployToServer works with these versions, but buildImage breaks: // only to help IntelliJ recognize the imports for the Docker*Task classes repositories { ext { // Run docker daemon with http // Run docker daemon with https appName = "ppppp/qqqqqq" // fallback to ~/.dockercfg allprojects { docker { dependencies { task info(type: DockerInfoTask) { task version(type: DockerVersionTask) { task wrapper(type: Wrapper) { task buildAndPush(type: DockerPublishTask) { task rmImage(type: DockerRmiTask) { task copyWARToBuildContext(type: Copy) { task buildImage(type: DockerBuildTask) { dockerHost = localDockerHost buildContextDirectory = file("./docker/") task stopContainer(type: DockerStopTask) { task rmContainer(type: DockerRmTask) { task runContainer(type: DockerRunTask) { task pullImage(type: DockerPullTask) { imageName = 'ppppp/qqqqqq' /*
task deployToServer(type: DockerPullTask) { |
Trying to run the example with the latest build:
BUILD FAILED |
thanks for the example project, I now got it reproduced. ... stay tuned. =) |
@ageorge303 well, I guess I found it and I'm going to fix it tomorrow - I need to cleanup some code and add some tests. |
Cool beans. What was the problem? Date: Tue, 5 May 2015 14:13:35 -0700 @ageorge303 well, I guess I found it and I'm going to fix it tomorrow - I need to cleanup some code and add some tests. — |
Is issue 33 related? @ageorge303 well, I guess I found it and I'm going to fix it tomorrow - I need to cleanup some code and add some tests. — |
@ageorge303 this issue isn't #33 related, you might check that one if it works for you now. Regarding this issue, reason was creating the "unix" URL twice, but only once in a manner the URL class accepted. The "unix" protocol in the docker-client is a kind of a hack, so one has to handle it with care. ;-) |
@ageorge303 a new release is available now, please give it a try :) the new version is |
Awesome. Thanks. Will try in the morning. Date: Tue, 5 May 2015 22:48:45 -0700 @ageorge303 this issue isn't #33 related, you might check that one if it works for you now. Regarding this issue, reason was creating the "unix" URL twice, but only once in a manner the URL class accepted. The "unix" protocol in the docker-client is a kind of a hack, so one has to handle it with care. ;-) — |
Sorry for delay. |
ah, well, can you re-run it with the
|
I'm not seeing any of the debug you are expecting to see. I'm obviously running this incorrectly. with this plugin: |
this is my log:
|
there are some diffs between our logs:
so, it seems like the extraction into |
@ageorge303 I assume you're still using openjdk 1.8? could you run it again like this, please: I would expect to see a stacktrace after the |
@ageorge303 your sudo environment is also using openjdk 1.8? |
@ageorge303 just as a hint to make the logs or code snippets better readable, you can surround them with triple backticks like this:
|
@ageorge303 please try to change the
|
@ageorge303 did you have a chance to check my latest suggestions? thanks! |
Hi Tobias, Sorry, got side-tracked on a different project. Will try today. Thanks again. Andy @ageorge303 did you have a chance to check my latest suggestions? thanks! — |
@ageorge303 no problem! I added another repository to better discuss the failing build. Please give https://github.com/gesellix-docker/gesellix-docker-plugin-issues a try and try to make it fail. I added a quite generic Dockerfile and I guess your Dockerfile is a bit more complex. Reading your recent logs I would suggest to check its contents more exactly - just to be sure :-) |
It worked! Date: Sat, 16 May 2015 12:16:51 -0700 @ageorge303 did you have a chance to check my latest suggestions? thanks! — |
Thanks for all your hard work. Date: Sat, 16 May 2015 12:16:51 -0700 @ageorge303 did you have a chance to check my latest suggestions? thanks! — |
Tobias, The build is successful, and my jar file is created.
Date: Sat, 16 May 2015 12:16:51 -0700 @ageorge303 did you have a chance to check my latest suggestions? thanks! — |
@ageorge303 well, great that it works now 👍 :-) The stacktrace is a part of my increased debug log to find reasons for the build problem. I'll remove the stacktrace from the logs with the next release. As a side note: the current implementation has a fallback to manually load necessary classes to add unix socket support to the runtime. It's the underlying error shown by the stacktrace which triggers the fallback mechanism. So, have fun with Docker and if you still encounter any issues, just add another issue. |
I updated from version "2015-03-07T20-17-57" to "2015-04-11T22-32-01".
After doing so, the buildImage task now fails with this error:
"docker build
using docker at 'unix:///var/run/docker.sock'
:buildImage FAILED
:buildImage (Thread[main,5,main]) completed. Took 0.15 secs.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':buildImage'. > java.net.MalformedURLException: unknown protocol: unix"
Excerpt from the build.gradle file:
ext {
localDockerHost = "unix:///var/run/docker.sock"
remoteDockerHost = "http://machine.blah.net:2375"
...
}
task buildImage(type: DockerBuildTask) {
//dependsOn rmImage
dependsOn copyWARToBuildContext
dockerHost = localDockerHost
imageName = appName
buildContextDirectory = file("./docker/")
}
I'm using openjdk 1.7.0_71. I saw the comment about using Oracle JDK. If I switch back to the earlier version of the plug-in, buildImage works fine.
The text was updated successfully, but these errors were encountered: