Submitting build definition of Jenkins Jobs
Hi,
In RTC 4.0.2 and Jenkins 1.5.0.4 as Build engine, when requesting a build, the job is actually launched in Jenkins (we can check it in Jenkins console), but I get an error in RTC in less than a second. The error displayed is as follows:
Error starting Hudson/Jenkins build for job "IBM aaw20_gtspee_RTC":
java.io.IOException: Error submitting build to Hudson/Jenkins. Expected code 200 OK but received code 403 with message: Forbidden
at com.ibm.rational.hudson.team.internal.service.HudsonBuildLoopRunnable.startHudsonBuild(HudsonBuildLoopRunnable.java:283)
at com.ibm.rational.hudson.team.internal.service.HudsonBuildLoopRunnable.processRequest(HudsonBuildLoopRunnable.java:141)
at com.ibm.rational.hudson.team.internal.service.HudsonBuildLoopRunnable.run(HudsonBuildLoopRunnable.java:107)
at com.ibm.rational.hudson.team.internal.service.HudsonBuildLoopScheduledTask.runTask(HudsonBuildLoopScheduledTask.java:43)
at com.ibm.team.repository.service.async.AbstractAutoScheduledTask.executeTask(AbstractAutoScheduledTask.java:88)
at sun.reflect.GeneratedMethodAccessor527.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
at $Proxy2156.executeTask(Unknown Source)
at com.ibm.team.repository.service.internal.scheduler.AsynchronousTaskRunner.runTask(AsynchronousTaskRunner.java:153)
at com.ibm.team.repository.service.internal.scheduler.AsynchronousTaskRunner.run(AsynchronousTaskRunner.java:116)
at java.lang.Thread.run(Thread.java:662)
The build engine authentication is the same user as the repository workspace owner (same ID). The RTC user has full build permissions.
Just to add that none RTC operation is performed (scm accept, load...)
Thanks very much in advance
Accepted answer
I think the original problem is due to Attempt to start Hudson build fails when unauthenticated users do not have permission to view jobs (242485), which was also fixed for 4.0.3 RC1, but you'd also likely hit the queue timeout issue that Spencer mentioned if there's a quiet period configured for the job. For the first issue, one workaround is to grant read access of the job (not necessarily the builds) to all users. This may be prohibitive for security reasons though. The problem was due to it following the redirect to the job page after submitting the request, but without the credentials being carried along. The fix was to not follow redirects.
Regarding:
> The build definition functionality "Components to exclude" and "Accept options" is not working.
how are you currently running the SCM phase of the build? Are you using the older plugin for RTC (which based on the SCM CLI), or using the Ant tasks and/or calling out to JBE from the Jenkins job? I recommend moving to the new plugin if possible:
https://github.com/jenkinsci/teamconcert-plugin
which does support the advanced load options.
8 other answers
The new time out problem could be caused by:
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/227294
The current logic (pre-4.0.3) does not allow for quiet time or queued builds in Hudson. We attempt to link the build immediately after submission and if we cannot confirm a build we throw that error. So if you have a quiet time or any sort of queuing structure in Hudson you will see that error. Defect 227294 is resolved as of 4.0.3.
~Spencer
The build engine authentication should be the Hudson user/password not the RTC one. The 403 means that the permission is denied for the given user. So either the user/password is wrong or doesn't have sufficient permissions. It might be a firewall issue too, if the something else is returning the 403 before it reaches the Hudson server.
I would start by verifying that the user/password on the engine is a good Hudson user with the right permissions.
~Spencer
~Spencer
Sorry for the misunderstanding, the build engine user/password is a Hudson/Jenkins user. Indeed the Test connection is OK. Maybe there is a firewall issue, or Hudson permissions. I will take your advise.
Don't you think that the Forbidden issue is in the Hudson side, and not RTC side?
Thanks!
The Jenkins SystemOut.log gives the following message:
13/05/13 14:13:00:068 MEST] 00000030 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Se ha creado una excepci\363n no dete
ctada en uno de los m\351todos de servicio del servlet Stapler en la aplicaci\363n EJenkins. Excepci\363n creada: hudson.security.AccessDeniedException2: anonymous no tiene el permiso Read
at hudson.security.ACL.checkPermission(ACL.java:54)
at hudson.model.Node.checkPermission(Node.java:394)
Basically, says that the user anonymous does not have Read permissions. I remind you that the build engine has authorization required, actually with "Test connection SUCCESSFUL!".The build is submitted in Jenkins as the build user.
Somewhere in the connection between RTC and Jenkins the credentials are missing...
Just if I add anonymous to the project security, and remove "Authorization required" from the build engine, the error dissapears. At this point, after 10 seconds I get the following error:
Error starting Hudson/Jenkins build for job "IBM vacio":
java.io.IOException: Hudson/Jenkins build request timed out
Is there any time out properties in RTC regarding Builds?
Thanks in advance
Other issue about configuration. The build definition functionality "Components to exclude" and "Accept options" is not working. Do I have to configure somewhere in RTC or Jenkins the build properties "team.scm.loadComponents" and "team.scm.acceptBeforeFetch"? I didn't start build engine through "jbe.sh ...", do I have to do it?
The components to exclude is easy to cover through the repository workspace flow target configuration, by just flowing only to some components. On the other hand, the lscm accept and load could be done through the Jenkins-RTC plugin, but I miss the snapshot done during the "accept last changes" option.
Comments
One more time, sorry for the misunderstanding, I was using old "Jenkins RTC Plugin 0.3" instead of the new one "Team Concert Plugin 1.0.5", where all the functionality desired is found, such as Accept options, Components to exclude...
Just if someone is interested in, see https://wiki.jenkins-ci.org/display/JENKINS/Team+Concert+Plugin for further details