Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes


Accepted answer

Permanent link
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.
Thorsten Ferres selected this answer as the correct answer

0 votes

Comments

I have been using the method

ITeamBuildRequestService.requestAndStartBuild()

to trigger and start the build, which allows to pass the builddefinition as well as the buildengine. Now I am trying to use the method

ITeamBuildRequestService.requestBuild()

which also returns IBuildRequest object but I have currently not found a way to set the buildengine that should be used. When I try to set it directly via IBuildRequest.setHandler(), I get a ImmutablePropertyException, but when I try to generate a IBuildRequest.getWorkingCopy(), I have found no way how to save this working copy again.

When I trying to use the method

ITeamBuildRequestService.requestBuild()

without trying to set the buildengine that should be used, the build request is not picked up by the JBE.

When you request the build manually, do you need to specify an engine at request time for it to work, i.e. does the definition have any supporting engines to begin with?


The handler property of a request is the engine that actually picks up the request, so shouldn't be set by the requestor. To direct the request to a specific engine, you should instead specify that when requesting the build. You'll need to use the requestBuild2(IBuildRequestParams), specifying the build definition using IBuildRequestParams.setBuildDefinition, and add the build engine handle to the list given by IBuildRequestParams.getPotentialHandlers().
com.ibm.team.build.common.BuildItemFactory.createBuildRequestParams() is the factory method for the params object.

Hello Nick!

Thank you very much!

Using the

  requestBuild2(IBuildRequestParams)

-method without setting IBuildRequestParams.setStartBuild(true) or trying to start the requested build via
ITeamBuildRequestService.startBuild(IBuildRequest request, String[] properties) the build request was picked up and executed by my JBE.

Good to hear.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,951
× 562
× 19

Question asked: Jan 08 '15, 11:29 a.m.

Question was seen: 4,985 times

Last updated: Jan 13 '15, 12:50 p.m.

Confirmation Cancel Confirm