I have a junit test that have to start a docker container.
This is the code i use
#ClassRule
public static ContainerDslRule mysql = new ContainerDslRule(TestConfigConstants.DOCKER_IMAGE)
.withPortBinding(TestConfigConstants.PORT)
.withEnvironment("MYSQL_ROOT_PASSWORD", TestConfigConstants.PASSWORD,
"MYSQL_DATABASE", TestConfigConstants.DB,
"MYSQL_USER", TestConfigConstants.USERNAME,
"MYSQL_PASSWORD", TestConfigConstants.PASSWORD);
When i start the test on a windows 7 pc with docker toolbox installed it's all ok. But when i start it on a windows 10 pc i have the follwing exception
java.lang.ExceptionInInitializerError
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
at java.lang.reflect.Field.get(Unknown Source)
at org.junit.runners.model.FrameworkField.get(FrameworkField.java:73)
at org.junit.runners.model.TestClass.getAnnotatedFieldValues(TestClass.java:230)
at org.junit.runners.ParentRunner.classRules(ParentRunner.java:255)
at org.junit.runners.ParentRunner.withClassRules(ParentRunner.java:244)
at org.junit.runners.ParentRunner.classBlock(ParentRunner.java:194)
at org.junit.runners.ParentRunner.run(ParentRunner.java:362)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.arquillian.spacelift.execution.ExecutionException: Execution of a task failed. Execution of a task failed. Unable to execute task SpawnProcessTask
at org.arquillian.spacelift.execution.ExecutionException.prependMessage(ExecutionException.java:70)
at org.arquillian.spacelift.execution.impl.FutureBasedExecution.unwrapException(FutureBasedExecution.java:173)
at org.arquillian.spacelift.execution.impl.FutureBasedExecution.await(FutureBasedExecution.java:101)
at org.arquillian.spacelift.task.os.ProcessBasedExecution.await(ProcessBasedExecution.java:149)
at org.arquillian.cube.docker.impl.util.CommandLineExecutor.execCommandAsArray(CommandLineExecutor.java:21)
at org.arquillian.cube.docker.impl.util.CommandLineExecutor.execCommand(CommandLineExecutor.java:13)
at org.arquillian.cube.docker.impl.util.AbstractCliInternetAddressResolver.getIp(AbstractCliInternetAddressResolver.java:29)
at org.arquillian.cube.docker.impl.util.AbstractCliInternetAddressResolver.ip(AbstractCliInternetAddressResolver.java:23)
at org.arquillian.cube.docker.impl.client.CubeDockerConfigurationResolver.resolveBoot2Docker(CubeDockerConfigurationResolver.java:317)
at org.arquillian.cube.docker.impl.client.CubeDockerConfigurationResolver.resolveServerIp(CubeDockerConfigurationResolver.java:209)
at org.arquillian.cube.docker.impl.client.CubeDockerConfigurationResolver.resolve(CubeDockerConfigurationResolver.java:66)
at org.arquillian.cube.docker.junit.rule.ContainerDslRule.initializeDockerClient(ContainerDslRule.java:74)
at org.arquillian.cube.docker.junit.rule.ContainerDslRule.<init>(ContainerDslRule.java:50)
at org.arquillian.cube.docker.junit.rule.ContainerDslRule.<init>(ContainerDslRule.java:44)
at it.advansys.gestionalebdf.server.controller.contact.customer.CustomerContactControllerTest.<clinit>(CustomerContactControllerTest.java:66)
... 19 more
Caused by: java.io.IOException: Cannot run program "boot2docker": CreateProcess error=2, Impossibile trovare il file specificato
at java.lang.ProcessBuilder.start(Unknown Source)
at org.arquillian.spacelift.task.os.SpawnProcessTask.process(SpawnProcessTask.java:107)
at org.arquillian.spacelift.task.os.SpawnProcessTask.process(SpawnProcessTask.java:34)
at org.arquillian.spacelift.task.Task.run(Task.java:98)
at org.arquillian.spacelift.task.Task$1.call(Task.java:70)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=2, Impossibile trovare il file specificato
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 9 more
Any idea?
I think there are something related with docker machine but not sure exactly the problem now, how many docker machines do you have installed in that machine? If it is only one, can you try to start it manually (i.e docker-machine start dev)
If it works then there is a bug when docker-machine is not started yet.
Related
I am getting following error while installing Jenkins Slave as service
I downloaded slave-agent.jnlp and running with javaws.exe
Jenkins Master is installed on ubuntu
Jenkins Slave would be on windows Machine
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: KeyUsage does not allow digital signatures
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
I am able to run manually like below but on every restart i have to run it manually
java -jar agent.jar -jnlpUrl https://my-jenkins:8443/computer/my-build1/slave-agent.jnlp -secret <key> -noCertificateCheck
How we can provide "noCertificateCheck" in jnlp file so slave launch to install it has service
I am new to jenkins and I recently installed jenkins on my local system. When the installation was complete and the Jenkins Dashboard had to load, I got the error as in the snapshot attached.
The system is connected to VPN as its office system.
Kindly let me know what changes I should make to get jenkins up and running.
I checked the log file of jenkins and found that jenkins service abruptly ending because of jetty issue as below:
SEVERE: Container startup failed
java.io.IOException: Failed to start Jetty
at winstone.Launcher.<init>(Launcher.java:156)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Main._main(Main.java:294)
at Main.main(Main.java:132)
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:431)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at winstone.Launcher.<init>(Launcher.java:154)
Thanks in advance.
I am using Jenkins to deploy web application on Tomcat7.
Tomcat installed as windows service and it has SWebServer name(installation path: C:\Program Files (x86)\SWebServer).
Jenkins also installed as windows service. Application war file location is:C:\Program Files (x86)\Jenkins\jobs\test4\workspace\target\prj.war
This is my configuration:
But I am getting the following exception
Deploying C:\Program Files (x86)\Jenkins\jobs\test4\workspace\target\prj.war to container Tomcat 7.x Remote
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Program Files (x86)\Jenkins\jobs\test4\workspace\target\prj.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:193)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:989)
at hudson.FilePath.act(FilePath.java:967)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1743)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
... 16 more
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:989)
at hudson.FilePath.act(FilePath.java:967)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1743)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
What is the problem ?
change the follow;
In the conf/tomcat-user add :
<user username="test" password="passTest" roles="manager-script"/>
In Jenkins,
EAR/WAR file: **/*.war
context path: prj
Tomcat URL : http://localhost:8080
So couple of things that you need to understand.
EAR/WAR: Mention the location of the file --> you can use *.war if the WAR is in the parent folder or use **/*.war if its in a sub folder
ContextPath: Where you want the war to be deployed in tomcat --> / will work
prefectly fine
Tomcat URL : port of deploying tomcat, couple of issues you might get like port already in use, change the port in server.xml to the one you like :)
<user username="uname" password="pwd" roles="manager-script,manager-gui"/>
Then above line can be specified in tomcat-users.xml --> your just giving access permission to jenkins with the user who has the following privileges
manager-gui — Access to the HTML interface
manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page.
P.S. Start tomcat before deploying that's one of the reasons you get connections refused :P
I have Jenkins installed on a unix server.
I am trying to install a slave on a windows machine.
I tried first on Windows 2008 server, and failed and then I tried on my machine which is Widows 7 and failed.
The URL of the Jenkins server is http://unixserver:9997
I opened port 9997 on my machine through the firewall with no success.
I go to the server, and under the logs, there is a directory with my slave name; inside there is a log file called slave.log
I tried to launch the slave from the web launcher or from the command line:
java -jar slave.jar -jnlpUrl http://unixserver:9997/computer/slave1/slave-agent.jnlp -secret xxxxxxxxxxxxxxxxxxxxx
The error given there is:
java.io.IOException: Remote call on ghas1 failed
at hudson.remoting.Channel.call(Channel.java:723)
at org.jenkinsci.modules.slave_installer.impl.ComputerListenerImpl.onOnline(ComputerListenerImpl.java:32)
at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:505)
at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:347)
at jenkins.slaves.JnlpSlaveAgentProtocol$Handler.jnlpConnect(JnlpSlaveAgentProtocol.java:122)
at jenkins.slaves.JnlpSlaveAgentProtocol2$Handler2.run(JnlpSlaveAgentProtocol2.java:100)
at jenkins.slaves.JnlpSlaveAgentProtocol2.handle(JnlpSlaveAgentProtocol2.java:44)
at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:154)
Caused by: java.lang.NoClassDefFoundError: org/jvnet/localizer/Localizable
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethod(Unknown Source)
at java.io.ObjectStreamClass.getPrivateMethod(Unknown Source)
at java.io.ObjectStreamClass.access$1700(Unknown Source)
at java.io.ObjectStreamClass$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(Unknown Source)
at java.io.ObjectStreamClass.lookup(Unknown Source)
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at hudson.remoting.UserRequest.deserialize(UserRequest.java:182)
at hudson.remoting.UserRequest.perform(UserRequest.java:98)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Unknown Source)
I had the same exact problem - the slave would connect but then immediately fail; the error in the server log was the same. The slave was behind a firewall so I was starting the slave manually, but I got the same error when starting the slave on the same machine as the Jenkins master process using either ssh or jnlp.
The problem went away when we restarted the Jenkins process on the server.
I am setting up Jenkins on a Windows 64 bit machine. It's configured to run as a windows service.
Jenkins 1.482
I have another issue with using svn with jenkins and in trying to solve that issue i am trying to upgrade jenkins.
The upgrade fails with:
Checking internet connectivity Checking update center connectivity
java.net.SocketException: Permission denied: connect at
java.net.DualStackPlainSocketImpl.connect0(Native Method) at
java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at
java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at
java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at
java.net.AbstractPlainSocketImpl.connect(Unknown Source) at
java.net.PlainSocketImpl.connect(Unknown Source) at
java.net.SocksSocketImpl.connect(Unknown Source) at
java.net.Socket.connect(Unknown Source) at
and
hudson.util.IOException2: Failed to download from
http://updates.jenkins-ci.org/download/war/1.484/jenkins.war at
hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:716)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1052)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1031)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source) at java.util.concurrent.FutureTask.run(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
I am not sure what is wrong.
This fails when running as a service and when running as an exe in my user space.
Can anyone explain how to fix this issue so i can upgrade jenkins and then fix the svn plugin?