Jenkins: How to disable DockerContainerWatchdog from running - jenkins

I've installed Docker plugin and was able to setup a test job to run on a slave container.
The test job is a basic loop with echo that runs for 15 minutes.
My problem is that the job never finishes. It runs for a few minutes and then the connection to the slave docker is lost and job gets stuck and fails.
After reading about this issue, I tried several suggested solutions, but it didn't help.
One of the things that can affect my issue is disabling DockerContainerWatchdog from running.
My problem is that I can't figure out how to disable DockerContainerWatchdog from running.
Any help will be greatly appreciated.
Thanks,
Boris.

Got it!
Run the following code in Jenkins' Script Console:
System.setProperty("com.nirima.jenkins.plugins.docker.DockerContainerWatchdog.enabled", "false")
Please note: This will be active only until Jenkins' next restart.

Related

Jenkins build can't finish

For my build via Groovy script (without using Docker or maven or k8s, just call another sh file), when triggered by timer, sometimes, it cannot finish with issue:
process apparently never started in jenkinsWs/myjob#tmp/durable-d6c09021
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
Cannot contact Slave29: java.io.FileNotFoundException: File 'jenkinsWs/myjob#tmp/durable-d6c09021/output.txt' does not exist
But it always works when I run it manually. I've used monitor tools for my slave machine to track what happened, but nothing strange.
I've tried all solution from this but nohope.
Thanks in advance for any idea.

how to reboot Jenkins slave in pipeline without job failed

Here is the thing, I have got a program that may get stuck sometimes, and when it happens I need to reboot my machine.
So, I want to reboot my Jenkins slave when the program gets stuck then continue to execute the rest of my program without marking the whole job as failed.
Can Anyone tell me how to do that?
Actually I wanted to add this as a comment but I don't have enough reputation.
You may want to use Restart from stage feature as documented here

JENKINS: After jenkins version updation, job is not starting

I am using docker to run my Jenkins instance.
The version which we are using was 2.121. Since last Saturday after the container restart, all my pipeline got vanished. After several hit and trial, when I updgraded to version 1.121.1. All my job got visible again. But when I tried to run any jobs. It is not getting started, after clicking on the build button nothing is happening.
What should I do? any suggestion would be helpful. Thanks

Jenkins job is not stopping after completion of execution

I am running Jenkins using maven and once the job is completed it is not terminating until we terminate it manually.In console output able to see the results but not showing build success and showing the processing symbol/loading symbol. can any one tell me how to stop the job after job execution.
Do we need to terminate manually or
do we have need to add anything in post build to stop after successful execution?
do we have to set something in configuration to terminate automatically
please can anyone help me out?
A few things could be going on here:
Does the Maven build execute any other goals after running tests ? If so those could be hanging.
Does your build run on a slave ? If so, Jenkins copies log files and other artifacts back to the master after completing the build steps but before marking the build as complete. You may have a network or I/O bottleneck here.
If you can't figure out the root cause and just want to have the build terminate without intervention, you can use the build timeout plugin.
If you have jobs running in parallell then some plugins have to wait for the older jobs to finish until the current one can. Not sure if this is your situation.
After using webdriver.quit() in our selenium project, it's working fine.Job got completed and the reports were generated.

jenkins job stuck Loading node environment variables

Some of the jenkins jobs are stuck with the following message
"[EnvInject] - Loading node environment variables".
I tried restarting the slave and that fixed the problem and every thing was working fine for few builds but then it stopped working again.
Any help would be appreciated.
Try renaming the project.
I don't know why this works - I just read that this had worked for someone else, and it worked for me!
In my case helped to restart Jenkins agent on which the previous "normal" build has executed (probably Jenkins controller assigned builds to the same agent, but the agent had some problems).

Resources