By user2181104


2013-06-10 12:58:02 8 Comments

I am getting this error when I configured a job to do stop and start of tomcat server:

Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information

When i googled it, i got a recommended solution as set BUILD_ID=dontKillMe
Is this the exact solution?
If yes, where do I need to set BUILD_ID? Inside ant/post build script?
Can anyone please clarify this?

5 comments

@MIM 2020-06-30 03:50:04

Tried different suggestions but none of the options worked for me. Finally I switched to previous version of jenkins and it worked. I switched from 2.3 to 1.581 and it worked.

@NdK 2017-08-24 10:27:27

By default, Jenkins will kill all the spawned process at the completion of build.

To override this, you need to create environment variable BUILD_ID.

Go to Jenkins -> Manage Jenkins -> Configure System.

Now under Global properties section, under Environment variables, click on ADD button to add new Environment variable. Give name=BUILD_ID and value=allow_to_run_as_daemon start_my_service
Click on save button. And you are done.

Now the spawn process will continue to execute even after the build got completed.

@Scar Coder 2019-09-02 20:34:30

Beautifully worked for a long-running Angular build

@Dhrumil Shah 2020-06-09 13:26:52

Thanks its works for me in windows and running long bat file

@lu_ko 2014-02-28 13:28:50

Yes, creating fake BUILD_ID for process tells Jenkins to ignore this process during detection spawned processes, so this process will be not killed after finishing job.

Usage: Enter BUILD_ID=dontKillMe before your command, for example into Execute shell build step:

 BUILD_ID=dontKillMe nohup ./yourStartScript.sh &

Note: See also nohup

@Vytalyi 2015-12-17 09:28:32

it doesn't work for me within a build step... I believe it should be environment variable

@tintin 2017-05-30 20:37:52

@Vytalyi I added export BUILD_ID=dontKillMe and it worked for me.

@Bilbo Baggins 2017-12-04 13:08:51

what should be written for windows? and where ?

@Zhivko.Kostadinov 2020-02-25 06:53:28

set BUILD_ID=dontKillMe nohup start yourFIle.bat just add that as one line

@Arx Cruz 2014-02-05 02:42:57

Add this line as a JAVA_ARGS argument when you start your jenkins server (I put mine on /etc/default/jenkins in my Ubuntu box)

-Dhudson.util.ProcessTree.disable=true

And you're done

@Oliver Gond┼ża 2016-05-16 12:05:37

The feature is in place to prevent accidental process leak from builds. Turning it off entirely because of one job is unnecessarily dangerous.

@Gonen 2013-06-10 19:52:51

You are calling a command from Jenkins that spawns another process -
the tomcat-start command ends, but its child-process is still running
(this is the actual tomcat web-server you attempted to start).

Jenkins sometimes identifies this situation as a possible problem,
but the page you have mentioned also explains how to solve it
(in short: Don't start tomcat from Jenkins unless you know how).

Related Questions

Sponsored Content

35 Answered Questions

[SOLVED] What is the difference between a process and a thread?

61 Answered Questions

[SOLVED] How do I include a JavaScript file in another JavaScript file?

39 Answered Questions

[SOLVED] How do I check whether a file exists without exceptions?

17 Answered Questions

[SOLVED] Writing files in Node.js

28 Answered Questions

[SOLVED] How to read a file line-by-line into a list?

16 Answered Questions

[SOLVED] How do I copy a file in Python?

31 Answered Questions

[SOLVED] Find (and kill) process locking port 3000 on Mac

  • 2010-10-04 12:19:16
  • oma
  • 1734488 View
  • 1852 Score
  • 31 Answer
  • Tags:   macos process

31 Answered Questions

[SOLVED] How to restart Jenkins manually?

  • 2011-11-09 22:32:22
  • Kerry Jones
  • 690642 View
  • 816 Score
  • 31 Answer
  • Tags:   jenkins

1 Answered Questions

[SOLVED] ISO CopyHere powershell Process leaked file descriptors. Jenkins

  • 2014-09-29 15:16:54
  • otmann
  • 343 View
  • 0 Score
  • 1 Answer
  • Tags:   jenkins

Sponsored Content