Jenkins Pipeline fails when triggering a remote job with option “Block Build Until Complete” is enabled - jenkins

I created a pipeline which should trigger a job on a different Jenkinsserver.
I use the Remote Trigger Plug-in and I am able to trigger the Job with following statement (currently this is the only statement in my pipeline):
triggerRemoteJob enhancedLogging: true, job: 'myJob', maxConn: 1, remoteJenkinsName: 'MyJenkins'
But after the Job is triggered the pipeline tries to connect a job in a job running on localhost which obviously fails.
I tried to disable some options an found that it works if I disable blockBuildUntilComplete.
From the Log I got following with option enabled:
############################################################################## ##################################
Parameterized Remote Trigger Configuration:
- job: myJob
- remoteJenkinsName: myJenkins
- parameters:
- blockBuildUntilComplete: true
- connectionRetryLimit: 5
################################################################################################################
Triggering non-parameterized remote job 'http://x.x.x.x:8080/job/myJob'
Using globally defined 'Credentials Authentication' as user 'myUser' (Credentials ID 'myCredentials')
Triggering remote job now.
CSRF protection is disabled on the remote server.
Remote job queue number: 47
Remote build started!
Remote build URL: http://localhost:8080/job/myJob /8/
Remote build number: 8
Blocking local job until remote job completes.
calling remote without locking...
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #1 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #2 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #3 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #4 out of 5
Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: http://localhost:8080/job/myJob /8/api/json/, parameters:
Retry attempt #5 out of 5
Max number of connection retries have been exeeded.
I changed the names and the IP-Adress of my Jenkins-Server.
I must do some steps after my remote job finished which are depending from its results. So I must wait until the job is done.
Is there a way to do this without the block-option or what must I do to get the option working?

Related

Timeout issue in Netbeans while deploying JBoss Server - Not Resolved

At times, I get the following error while deploying the code through Netbeans.
Not sure why this is happening. Tried increasing time to 15000 in standalone.xml. Still facing this error.
Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'deploy' at address '[("deployment" => "server-1.0-SNAPSHOT.war")]'
Deploy of deployment "server-1.0-SNAPSHOT.war" was rolled back with the following failure message: "JBAS013487: Operation timed out awaiting service container stability"
ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS013413: Timeout after [5000] seconds waiting for service container stability while finalizing an operation.
Process must be restarted. Step that first updated the service container was 'deploy' at address '[("deployment" => "server-1.0-SNAPSHOT.war")]'

Jenkins: auto restart in case of Unexpected termination of the channel

Jenkins: 2.167, Java Oracle Jdk 8.
For some still unknown reason, my Jenkins jobs running on a remote server aborted with the following error messages:
FATAL: command execution failed
java.io.EOFException
Caused: java.io.IOException: Unexpected termination of the channel
Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on remote_hostname failed. The channel is closing down or has closed down
FATAL: Unable to delete script file /tmp/jenkins478092438024758922.sh
java.io.EOFException
Caused: java.io.IOException: Unexpected termination of the channel
Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on remote_hostname failed. The channel is closing down or has closed down
Build step 'Execute shell' marked build as failure
And the Post Build Action that detected above string could not execute:
Match found for :Caused: java.io.IOException: Unexpected termination of the channel : True
Logical operation result is TRUE
Exception when executing the batch command : no workspace from node hudson.slaves.DumbSlave[remote_hostname] which is computer hudson.slaves.SlaveComputer#157ceaec and has channel null
I'm not sure why the channel got closed, will look at a possible temporary network connectivity drop between client and server.
Since the connection to the remote host got lost, the workspace is not available to run the post build action script (just a bash script to do some cleanup).
But when something as above happens, is it at least possible to restart the same build job?
Or is it possible to send an email giving an alert, perhaps with a plugin?

Jenkins triggering TFS plug in force Error TF400367

I am triggering a build from Jenkins and the source code is in TFS2017 Update.3.1 using the TFS plugin to integrate.
When I trigger the build, it gives the error message below about the tfs connection.
Edit: This solution does not work for me.
The build is in the workspace C:\Program Files
(x86)\Jenkins\workspace\tfp 中 FATAL:
com.microsoft.tfs.core.exceptions.TECoreException: The server could
not process the request。 ---> TF400367: This request cannot be
executed because the host type does not match.Check all connection
information and verify that it is correct.The request is for
Deployment and Organization。
com.microsoft.tfs.core.ws.runtime.exceptions.SOAPFault: The server
could not process the request。 ---> TF400367: This request cannot
be executed because the host type does not match.Check all connection
information and verify that it is correct.The request is for
Deployment and Organization。 at
com.microsoft.tfs.core.ws.runtime.client.SOAP12Service.examineResponseDOMForFault(SOAP12Service.java:117)
at
com.microsoft.tfs.core.ws.runtime.client.SOAPService.examineBodyForFault(SOAPService.java:987)
at
com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:665)
at
com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:444)
at
ms.tfs.services.registration._03._RegistrationSoap12Service.getRegistrationEntries(_RegistrationSoap12Service.java:106)
at
com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:58)
Caused: com.microsoft.tfs.core.exceptions.TECoreException: The server
could not process the request。 ---> TF400367: This request cannot be
executed because the host type does not match.Check all connection
information and verify that it is correct.The request is for
Deployment and Organization。 at
com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:92)
at
com.microsoft.tfs.core.exceptions.mappers.RegistrationExceptionMapper.map(RegistrationExceptionMapper.java:18)
at
com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:61)
This is config screen capture:
Well, seems the connection information you set is incorrect. You need to provide the collection name in the Collection URL.
So, the Collection URL should be something like: http://192.168.101.188:8080/tfs/DefaultCollection

Pushing from Eclipse to Openshift: Read timeout after 30,000 ms

I've been working on an Openshift web application in Eclipse, and I'm having some trouble pushing my changes. There didn't used to be any issue. It used to be that I would hit "publish to Openshift" and the following would print to the console.
Preparing build for deployment
Deployment id is <redacted>
Activating deployment
Starting MySQL 5.5 cartridge
Starting jbossews cartridge
Found <redacted> listening port
-------------------------
Git Post-Receive Result: success
Activation status: success
Deployment completed with status: success
Now, the build hangs. Sometimes it'll hang after Preparing build for deployment, and when that happens, I can no longer access the webpage. Other times, it'll hang after Starting jbossews cartridge, and when that happens, I can access the webpage if I wait a few seconds.
When I check the error log, I get the following:
org.eclipse.jgit.errors.TransportException: <redacted>: Read timed out after 30,000 ms
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:217)
at org.eclipse.jgit.transport.BasePackPushConnection.push(BasePackPushConnection.java:152)
at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:165)
at org.eclipse.jgit.transport.Transport.push(Transport.java:1173)
at org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:197)
at org.jboss.tools.openshift.egit.core.EGitUtils.push(EGitUtils.java:539)
at org.jboss.tools.openshift.egit.core.EGitUtils.push(EGitUtils.java:515)
at org.jboss.tools.openshift.express.internal.core.server.OpenShiftServerPublishMethod.push(OpenShiftServerPublishMethod.java:263)
at org.jboss.tools.openshift.express.internal.core.server.OpenShiftServerPublishMethod.access$0(OpenShiftServerPublishMethod.java:257)
at org.jboss.tools.openshift.express.internal.core.server.OpenShiftServerPublishMethod$PublishJob.run(OpenShiftServerPublishMethod.java:365)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.io.InterruptedIOException: Read timed out after 30,000 ms
at org.eclipse.jgit.util.io.TimeoutInputStream.readTimedOut(TimeoutInputStream.java:141)
at org.eclipse.jgit.util.io.TimeoutInputStream.read(TimeoutInputStream.java:114)
at org.eclipse.jgit.util.IO.readFully(IO.java:246)
at org.eclipse.jgit.transport.PacketLineIn.readLength(PacketLineIn.java:186)
at org.eclipse.jgit.transport.SideBandInputStream.needDataPacket(SideBandInputStream.java:158)
at org.eclipse.jgit.transport.SideBandInputStream.read(SideBandInputStream.java:129)
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:207)
... 10 more
I've tried going into Eclipse Preferences to increase the Debug timeout beyond 30,000 ms, but that doesn't seem to have any impact. Any suggestions? Thanks in advance!
For those curious, I was able to fix this issue simply by increasing the timeout within Eclipse Preferences. Go to Preferences > Team > Git and increase your remote connection timeout. I upped mine from 30 seconds to 90 seconds and now everything works fine.

Hadoop Job via Open PBS

I am using OpenPBS to submit a Hadoop job on cluster. Everything works well when Hadoop job is completed successfully. I am using one master node and one slave node in configuration.
When i use qdel to delete Hadoop job the Java processes running on master exits normally, but the jobs on slave does not exit. The task tracker process keeps running on slave and polls for master node and gives below error message:
INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <masternode>/192.168.1.17:54311. Already tried 6 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
ERROR org.apache.hadoop.mapred.TaskTracker: Caught exception: java.net.ConnectException: Call to <masternode>/192.168.1.17:54311 failed on connection exception: java.net.ConnectException: Connection refused
The strange problem is I cannot even SSH into that particular node to kill the process manually because of the orphan job. I had to ask root user to purge the jobs.
How can I make sure that the slave process ends before ending the master process on using qdel to avoid the issue in future?

Resources