I run a pipeline using Jenkins scripts written using DSL commands. The problem arise when suddenly one of the stages fail unpredictably with the following error:
Failed to parse D:\newjenkins\jobs\JOB_NAME\builds\166\changelog1.xml
The script I use is as follows:
pipeline{
agent none
parameters{
...
}
stages('Execution Started'){
stage('Checkout'){
parallel{
stage('Checkout machine1'){
agent{
label "machine1"
}
when{
beforeAgent true
expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout'}
}
steps{
echo "machine1"
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout_1', remote: 'url_checkout_1'], [credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout', remote: 'url_checkout']], quietOperation: false, workspaceUpdater: [$class: 'CheckoutUpdater']])
}
}
stage('Checkout machine2'){
agent{
label "machine2"
}
when{
beforeAgent true
expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout'}
}
steps{
echo "machine2"
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout_1', remote: 'url_checkout_1'], [credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout', remote: 'url_checkout']], quietOperation: false, workspaceUpdater: [$class: 'CheckoutUpdater']])
}
}
stage('Checkout machine3'){
agent{
label "machine3"
}
when{
beforeAgent true
expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout'}
}
steps{
echo "machine3"
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout_1', remote: 'url_checkout_1'], [credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout', remote: 'url_checkout']], quietOperation: false, workspaceUpdater: [$class: 'CheckoutUpdater']])
}
}
}
}
}
stage('Build'){
parallel{
stage('Build at machine1'){
agent{
label "machine1"
}
when{
beforeAgent true
expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout' || params.MODULE == 'Build'}
}
steps{
echo "machine1"
bat 'cd location_machine && ant main '
}
}
stage('Build at machine2'){
agent{
label "machine2"
}
when{
beforeAgent true
expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout' || params.MODULE == 'Build'}
}
steps{
echo "machine2"
bat 'cd location_machine && ant main '
}
}
stage('Build at machine3'){
agent{
label "machine3"
}
when{
beforeAgent true
expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout' || params.MODULE == 'Build'}
}
steps{
echo "machine3"
bat 'cd location_machine && ant main '
}
}
}
}
}
This is a sample script I use. This tends to throw the error highlighted above.
I mostly set the mode of checking out scripts to "svn update as much as possible " but it does not solve anything. Why does this fail? What are the possible ways to avoid this issue?