Using Buildforge 7x to RTC 3x build definition get API: Access denied
Having finally got our RTC project connected to our Build Forge server, I get this while trying to run a build through the RTC build definition:
com.ibm.team.build.common.TeamBuildException: Error sending request "Create build for project af530bd50c621000ca2dd3c675547554" to Build Forge server at "172.172.172.172:3966" for build engine id "BF": API: Access denied.
Here's something interesting that may provide a clue: when I first set up the Environment on Build Forge to use the Jazz source code adapter, I had the wrong repository set. So when I ran it, I got an error that said:
2013-07-10 16:09:48 [Jazz build engine] Searching for buildResultUUID=_woYl4Om1EeKyK_0LrHLRhA
So this one is easy enough to understand. The point is that this was reported as an error for that particular step. The first error message (the one I'm having trouble with, above), is reported under the RTC build engine log as a ServerRunTimeError - yet, I don't get any step-related logs. It seems that once I advance to the point of connecting to RTC from the build agent, something happens that causes the server enough anxiety to completely abort and to throw an exception rather than report a step-related error.
Any ideas??
- Andy
|
Accepted answer
The APIAccessDenied is an authentication problem. Check that the user who is connecting to Build Forge has the right username/password. Then check that the user isn't locked in Build Forge.
The JBE wrong repository shouldn't have a bearing on this since it is strictly RTC and RTC authentication. The JBE execution only happens after the build is started in BF, and the first error indicates that we have the API auth failure before we can connect to BF and start the build via the services layer.
~Spencer Andy Jewell selected this answer as the correct answer
Comments
Andy Jewell
commented Jul 11 '13, 11:48 a.m.
Thanks, Spencer! I included the information about the repository information because it's actually somehow opposite as one would expect. The build does start and on the build agent it creates an appropriate folder under the build root directory. The BF Agent log provides some information that looks like it's authenticating with something (I'm not sure what).
If I run a straight JBE build, it works. On the other hand, if I run a non-RTC BF job, it works. Can you think of any test case I could set up that would narrow the issue?
Andy Jewell
commented Jul 11 '13, 1:40 p.m.
Hmm, I take that back. I tried to replicate the error I got before the APIAccessDenied serverruntime error and was unable to so maybe something else is going on. 1
So as far as the second error, the engineUUID SHOULD be valid since BF sets that value before the build. So look at the build log in Build Forge and verify that the engineUUID environment variable exists and is set to something that looks like a UUID. I'm going to assume that the user O386600 has access to the Build Forge engine on RTC.
~Spencer
1
Kevin Ramer
commented Jul 30 '13, 10:01 p.m.
Two of our freshly upgraded to 4.0.3 RTC repositories are reporting this on a frequent basis. Funny thing is that on one repository two of the now failing builds SUCCEEDED once before failures started. I've been so involved with RTC of late I've forgotten almost all the Build Forge I knew. In addition to an exception with strong similarity to OP, there is a complaint about missing metadata 1
You might try creating a new BF user and setting the RTC BF engine creds to that brand new user. That way you can ensure that no one else is doing anything with that user and make sure that there isn't some kind of mix up with different creds trying to connect to BF from RTC.
~Spencer
@Spencer: regarding a new BF user. I'm not sure if I can (within the logistics of our support group) but I'll try. Here's something else I noticed about this problem: I recreated it but setting up a brand new build definition, new BF project, new workspace, etc. It worked the first time (as far as connecting to BF, getting logs, etc) but again get the API Denied error on subsequent attempts - exactly like my original problem. The BF admin asked if I was using lscm because he was not seeing a logout so I wonder if somehow the adapter doesn't break the RTC connection so it works once - an only once.
Andy Jewell
commented Jul 31 '13, 11:57 a.m.
@Spencer: regarding the engineUUID - I only get that on the very first attempt. The subsequent attempts where I'm getting the APIDenied error, there are no BF logs whatsoever.
Kevin Ramer
commented Aug 01 '13, 11:18 a.m.
@Spencer
Andy Jewell
commented Oct 08 '13, 2:37 p.m.
Ultimately, the problem was that the build definition was locking the Build Forge account. Our communication between the users (us) and the Build Forge administrators is not that fluid so it took a while to figure that out. Still a mystery why it would always work that first time but fail subsequently. Also discovered at this time, as well, that any BF connection will somehow do a "keep alive" ping since this account was being locked regardless of whether any builds were being requested.
Kevin Ramer
commented Dec 11 '13, 2:29 p.m.
My observation(s) of late: We have several RTC projects (different repos) trying to use our build forge server. MANY builds are getting this API: Access denied even though the Build Engine Test works fine. Observing the BF_USERS table only 1 ID is changing with respect to the BF_FAILCOUNT -- root. But no build engines are using root ID (might have used to force an update on the Build Engine). RTC server A is reporting API: Access denied frequently, while RTC server B IS ALSO IMPACTED.
Kevin Ramer
commented Dec 11 '13, 3:00 p.m.
The BF_FAILCOUNT increases when rtc server logs a message also containing "API: Access denied" Blocking ALL API access based on one failing ID, apparently.
showing 5 of 11
show 6 more comments
|
3 other answers
Hi All,
After a long test runs I ultimately got success in the issue. Actually I had more then one build engine each with different build userid. After Access Denied lets say I did expire the password for user, reset via RBF web console and again triggered the build as soon as I am using the same build engine it worked fine. The moment I trigger the different build engine the first one start getting the API access denied. Simple resolution is to have only one user for all the build engine. Also if you have less user license then make the user used for build as priority user. That allow the build user to access the buld forge even all licenses occupied. Also if build user logged in , it will not be logged out by someone else. - Make user as priority - Use only one user for all build engine. |
Hello ,
I am getting the issue in RTC4.0.3 with all users. my build forge is 7.1.3.3. And I all working till day before. Suddenly the issue appears. I used some builduser account got issue. Then I used my account I got success in first time and thats it it fails from next onward. I check my login and manual trigger as well. Its working fine. Not I used root users but same happening with root user as well. If there is access issue why the root user also getting the issue. |
From Investigate "API: Access Denied" error in Build Forge builds (302262):
We discovered that BF can return APIAccessDenied instead of APILoginFailed if the request fails due to an expired session. The session timeout can be changed, or disabled, in the BF system settings. It's unclear why the session was timing out though.
There's a fix in 5.0.1 in item 317575. |
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.