Summary
When debugging an intermittent error, it is difficult to to track it using the default logs only. For an intermittent error, you can put a debug log script inside a step and then keep record the errors in a separate unique log file.
Solution
Perhaps there is a problem talking to the server and you receive an empty response (or an HTTP error) from the server.
To track this down, you could do one of the following:
-
You can put the following into a step command to query the $ec object to see if there’s an error:
my $errMsg = $ec->getError(); print $errMsg . "\n";
-
Turn on debug logging on the ec object during initialization:
$ec = new ElectricCommander({debug => 1, logFile => 'waitForJob.$[ec:jobStepId].log'});
The reason for including jobStepId in the file name is that if this step is invoked multiple times in the job, each invocation’s debug output will go to a unique log file.
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.