I am exploring docker to deploy my dockerized java sample project on windows7 using boot2Docker. When I am building the dockerized java app using command ./gradlew build buildDocker. I am getting an issue as follows:
Execution failed for task ':buildDocker'.
> javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
My build.gradle file had docker settings as follows:
docker {
useApi true
hostUrl 'https://192.168.59.103:2376'
}
I searched for some probable solution for the same and got this link. I tried both the workarounds but none working for me. For the first approach i.e. changing profile and tried building again the project also failed with above error.
In the second workaround, I tried to install and run
$(docker run sequenceiq/socat)
the command downloaded the package and runned as well. But when I tried to check the running images using command docker ps, Nothing came in result set.
After that I tried pinging using curl http://192.168.59.103:2375/_ping returned error as curl: (7) Failed to connect to 192.168.59.103 port 2375: Connection refused
Anyway I changed my docker configuration in build.gradle file as follows:
docker {
useApi true
hostUrl 'http://192.168.59.103:2375'
}
And run the build command i.e. ./gradlew build buildDocker again to get below error:
Execution failed for task ':buildDocker'.
> org.apache.http.conn.HttpHostConnectException: Connection to http://192.168.59
.103:2375 refused.
So it seems both the workaround is not working for me. Any one faced the same and have any clue about what I am missing here.
Related
When i want run react-native run-android command i see
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'reactNativeCliTest'.
Could not resolve all dependencies for configuration ':classpath'.
Could not download gradle-core.jar (com.android.tools.build:gradle-core:2.2.3)
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.2.3/gradle-core-2.2.3.jar'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/2.2.3/gradle-core-2.2.3.jar'.
Connect to jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] failed: Connection timed out:
connect
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 26.854 secs Could not install the app on the device, read
the error above for details. Make sure you have an Android emulator
running or a device connected and have set up your Android development
environment:
https://facebook.github.io/react-native/docs/getting-started.html
I use genymotion .
thank you ...
RN is trying to download a new version of gradle and get error code 443. This error is related to misconfigured system files in your windows operating system. It's not related to react native and you can search about fix this error in your system.
as an experience, you have to use hotspot shield or strong vpn to download from jcenter in iran!
this link may help you: http://www.wiki-errors.com/err.php?wiki=443
I tried to follow the instructions in https://github.com/cloudfoundry/uaa, namely cloning the github repository and then executing the gradlew run command. I am running this on a Windows 10 system that has Java 1.8 installed. However, I run into the following error at around 97% of the execution of gradlew run.
org.codehaus.cargo.container.ContainerException: Deployable [http://localhost:8080/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The Deployable state is thus unknown.
:cargoRunLocal FAILED
:cargoRunLocal took 164921ms
FAILURE: Build failed with an exception.
I am new to the Java ecosystem and I am not sure what the issue is. I tried looking up for increasing the timeout as seems to be the initial observation from the issue. I am not sure where to do this. I do not know if the issue is from a completely different reason.
Any suggestions would help
Looks like process is getting timed out before it deploys the application, try increasing the timeout period in build.gradle file.
Open build.gradle in the root of the uaa
Search for below content:
cargo {
containerId = tomcatContainerId
port = 8080
...
Increase the timeout by adding timeout = 180000
cargo {
containerId = tomcatContainerId
port = 8080
timeout = 180000
...
I saw an answer to the same issue in Algorithm negotiation fail SSH in Jenkins
I am facing the same problem, but updating ss_config did not help and I still get the same error. I also have another problem, which maybe related to this. In Jenkins general configuration I added my build slave as a remote host and gave it hostname, port, username, and keyfile path, but it still says "Can't connect to server". I wonder why, because if I login to Jenkins machine I can easily connect to my remote host in the command line using the same keyfile.
Update:
This is the line I added to ssh_config:
KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
This is the console output in Jenkins:
[SSH] Exception:Algorithm negotiation fail
com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)
at com.jcraft.jsch.Session.connect(Session.java:286)
at com.jcraft.jsch.Session.connect(Session.java:150)
at org.jvnet.hudson.plugins.SSHSite.createSession(SSHSite.java:141)
at org.jvnet.hudson.plugins.SSHSite.executeCommand(SSHSite.java:151)
at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:60)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Build step 'Execute shell script on remote host using ssh' marked build as failure
[SSH] executing post build script:
I figured it out, I am using Ubuntu 15.04 as remote host which uses ssh version 6.7 and this version disabled most of the encryption algorithm by default. And I needed to add this line:
KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
NOT to the ssh_config, BUT to sshd_config.
I want to build my projects on a Windows machine, so I created a slave there. First we tried the standard java application runner, but our build sets up its own environment and it always ended up deleting the existing Java installation, not giving any proper error messages, but failing. Then I switched to using Cygwin sshd and have Jenkins log in via ssh. This works for the connection (just as the standard method worked), but when I ran the build then it failed again to install the jdk. I ended up running the following command by hand:
C:\jenkins\tools\hudson.model.JDK\Latest\jdk.exe ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=C:\jenkins\tools\hudson.model.JDK\Latest /L
This is the same as Jenkins would run, but without the /s (silent) option. Now when I run the build, I get the following error:
Building remotely on jenkins-slave-win64 (Johnny5) (windows) in workspace C:\jenkins\workspace\continuous.xill
java.io.IOException: remote file operation failed: C:\jenkins\tools\hudson.model.JDK\Latest at hudson.remoting.Channel#200354fa:jenkins-slave-win64 (Johnny5): java.nio.file.AccessDeniedException: C:\jenkins\tools\hudson.model.JDK\Latest\bin\java.exe
at hudson.FilePath.act(FilePath.java:987)
at hudson.FilePath.act(FilePath.java:969)
at hudson.FilePath.deleteRecursive(FilePath.java:1171)
at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:130)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.model.JDK.forNode(JDK.java:132)
at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:360)
at hudson.model.Run.getEnvironment(Run.java:2234)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:935)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1036)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Caused by: java.nio.file.AccessDeniedException: C:\jenkins\tools\hudson.model.JDK\Latest\bin\java.exe
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at hudson.Util.deleteFile(Util.java:247)
Of course I tried everything:
Run sshd as a different (Administrator) user
Checked every error mentioned here:
https://wiki.jenkins-ci.org/display/JENKINS/SSH+slaves+and+Cygwin
here
https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+Jenkins
and here
http://www.noah.org/ssh/cygwin-sshd.html
And nothing works. Do you have a hint where to look?
UPDATE:
Meanwhile I managed to get a bit further in the build process by deactivating the option to "Automatically install jdk" in the Jenkins settings, git clone works and gradle starts up. However, now the JAVA_HOME environment variable somehow is not accessible to the slave (although we even tried setting it in .bashrc, just to be sure). So the build fails with this message":
FAILURE: Build failed with an exception.
* Where:
Script 'http://dl.bintray.com/content/shemnon/javafx-gradle/8.1.1/javafx.plugin' line: 60
* What went wrong:
A problem occurred evaluating script.
> Could not find JavaFX Packager Tools, please set one of [jfxrtDir in Gradle Properties, JFXRT_HOME in System Environment, JAVA_HOME in System Environment, java.home in JVM properties]
For your build error after "UPDATE" I think you have to add a JDK under Manage Jenkins > Configure System > JDK or in newer versions under Manage Jenkins > Global Tool Configuration > JDK
I have a setup up a master and slave on the same machine.
The master monitors External Jobs the slave runs a batch script and notifies the master about the same.
I followed the Windows instructions from:
https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs
and setup a buld step on the slave as follows:
set JENKINS_HOME=http://localhost:8080/jenkins/
java -jar C:\apache-tomcat-7.0.56\webapps\jenkins\WEB-INF\lib\jenkins-core-1.624.jar "POC_Main_Ext_Job" jenkins_poc_test_1
On building the slave job, I get the following error message in the console output:
Building remotely on MySlave in workspace D:\Temp\Jenkins\workspace\Slave_FreeStyle_1
[Slave_FreeStyle_1] $ cmd /c call C:\Users\ROHIT~1.BIS\AppData\Local\Temp\hudson853358493293228093.bat
D:\Temp\Jenkins\workspace\Slave_FreeStyle_1>set JENKINS_HOME=http://localhost:8080/jenkins/
D:\Temp\Jenkins\workspace\Slave_FreeStyle_1>java -jar C:\apache-tomcat-7.0.56\webapps\jenkins\WEB-INF\lib\jenkins-core-1.624.jar "POC_Main_Ext_Job" jenkins_poc_test_1
http://localhost:8080/jenkins/job/POC_Main_Ext_Job/ is not a valid external job (404 Not Found)
D:\Temp\Jenkins\workspace\Slave_FreeStyle_1>exit -1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
However, the above url does work in Jenkins and takes to the corresponding job. Any Idea what I'm doing wrong?
As you can see I had missed out the user credentials while setting JENKINS_HOME.
After adding them it works smoothly.