Task failed with exit code minus 1

Article ID:213477757
1 minute readKnowledge base

Issue

Performing a long-running build with a detached step will return a "Task failed with exit code -1" while running shell commands such as sleep on a FreeBSD builder agent.

Building remotely on freebsd83 in workspace /tmp/workspace/long-running-freebsd
[long-running-freebsd] Running shell script
Notifying upstream projects of job completion
Finished: SUCCESS
+ which sleep
/bin/sleep
+ date
Mon Nov 2 07:20:48 PST 2015
+ sleep 60
Task failed with exit code -1

Environment

  • CloudBees Jenkins Enterprise

  • CloudBees Jenkins Operations Center

Resolution

During the installation of a JDK. The FreeBSD package system tells you to add these lines to the system `/etc/fstab file:

fdesc   /dev/fd     fdescfs     rw  0   0
proc    /proc       procfs      rw  0   0

This above step was more than likely skipped during initial JDK installation. To fix the problem, add the above lines to the fstab and then mount them with:

mount -a -v

Rerun a build to confirm that the problem is solved.

This problem is not noticed on other operating systems because there is no need to mimic /proc and /dev/fd on systems that run on a linux based kernel.