Triggering a build does not work from within an RTC service
I am writing a service (using the RTC server-api) that can be used via REST API to trigger builds using a previously created build definition and build engine. But always when I try to trigger such a build via the RTC service, the jazz build engine says
Abandoned orphaned build 'myBuild '. The build engine is about to process another build request and requires that all in-progress builds previously processed by this build engine be abandoned. Please see the build result's log for more information.
and the build log for the build definition says
This build has been automatically abandoned by the build engine 'myEngine'.
This can happen if the build engine stops while it is processing a build, or if it fails to communicate with the server (e.g. due to the server crashing, or a network break).
As a result, the build is left in the in-progress state.
Such builds are automatically abandoned for the following reasons:
1. When the build engine is restarted, new builds will be processed, however the old builds would otherwise remain in the in-progress state indefinitely.
2. As a result the build engine would appear as busy when it is not.
The used build engine is 'myEngine' is 'idle'. When I now do a 'Request Build...' or a 'Request Rebuild...' via my RTC Eclipse client, the build gets executed. I need the build to be executed directly via my RTC service, because I evaluate the build result I and only do further steps in my service if the build completed successfully, which is of course not the case if it is abandoned directly from the JBE.
Abandoned orphaned build 'myBuild '. The build engine is about to process another build request and requires that all in-progress builds previously processed by this build engine be abandoned. Please see the build result's log for more information.
and the build log for the build definition says
This build has been automatically abandoned by the build engine 'myEngine'.
This can happen if the build engine stops while it is processing a build, or if it fails to communicate with the server (e.g. due to the server crashing, or a network break).
As a result, the build is left in the in-progress state.
Such builds are automatically abandoned for the following reasons:
1. When the build engine is restarted, new builds will be processed, however the old builds would otherwise remain in the in-progress state indefinitely.
2. As a result the build engine would appear as busy when it is not.
The used build engine is 'myEngine' is 'idle'. When I now do a 'Request Build...' or a 'Request Rebuild...' via my RTC Eclipse client, the build gets executed. I need the build to be executed directly via my RTC service, because I evaluate the build result I and only do further steps in my service if the build completed successfully, which is of course not the case if it is abandoned directly from the JBE.
Accepted answer
Hi Thorsten, which method are you using to request the build? It should only request the build, not mark it as started or otherwise claim it, otherwise JBE will say "looks like there's a build that I was running but I'm not anymore, so I'll abandon it". If it's just requested / queued, then the JBE should pick it up, just like a manual request.
Should also double-check that you don't have two JBE instances using the same engine ID, which can produce the same effect. But if a manual build works OK, this suggests that's not the case.