I’m creating a forge app using Custom UI and the forge bridge.
One of the invokers of the bridge keeps throwing an error:
Error: GraphQL error: The underlying service call failed. The underlying service xen_invocation_service status code is : 400
Google provides no answers and I can’t see anything in the atlassian documentation for this specific error.
It is happening on a specific invoker. The code for the invoker is known to be working. This error was sparodic last week and consistent this week. All the invoker is doing is sending a payload to an azure function and receiving a response. The URL for the function is specified in the manifest so this shouldn’t be a permissions issue from that side of things (not that the code even reaches that far).
The call for the invoke as it currently stands. It is hitting catch block of this particular invoke every time with the above error
if (Object.keys(issueData).length > 0) {
const key = issueData?.fields?.project?.key;
console.log('ISSUEKEY<<<<', { key });
helpers.issueData = issueData;
invoke('getWorkTypes', { key }).then(workTypes => {
console.log({ workTypes });
setTypeOfWorkOptions([{ value: '', label: 'Please choose' }, ...JSON.parse(workTypes.body.value)]);
}).catch(err => {
console.error('getWorkTypes::Error', { err });
setAlert(`${err.toString()}::${JSON.stringify(err)}`, { key });
});
}
The invoker itself. When I am using the forge tunnel, I can see its not even trying to run any of this code. The first console log is not even being run:
app.define('getWorkTypes', async (req) => {
console.log('getWorkTypes::req', req);
try {
const { key } = req.payload;
console.log('getWorkTypes::key', { key });
const data = JSON.parse(await getData());
const secrets = JSON.parse(await getSecrets());
// console.log('getWorkTypes::data/secrets', { data, secrets });
const oauth = getAuth(data, secrets, data.deployment);
const bcUrl = buildUrl(data, 'GetWorkTypes');
// console.log('getWorkTypes::oauth/url', { oauth, bcUrl });
const bcResponse = await getWorkTypes(bcUrl, oauth, data.companyName, key);
console.log('getWorkTypes::bcResponse', { bcResponse });
return bcResponse;
} catch (error) {
console.log('getWorkTypes::Error', { error });
return { error };
}
});
Every other invoke function in this app is behaving as it should. As I said, last week this was a sparodic issue. On friday it was happening on about 60% of the time trying to run the app. Now its 100% of the time.
As far as I can tell, my code is fine, which leads me to think this issue is environmental within Jira, but without any more information on the error, its difficult to tell.
Any ideas would be helpful. At this point there are no such things as bad ideas