Gateway.timeout 504

Hi,

I am using Node.js purecloud-platform-client-v2 SDK, at version ^153.0.0

I am doing development using Genesys Cloud (ie) Tenant

Every now and then i get error 504 gateway.timeout , especially in some specific API calls such as: postWidgetsDeployments();

example code:

const gcApi = require('purecloud-platform-client-v2');
const gcApiClient = gcApi.ApiClient.instance;
gcApiClient.setEnvironment("https://api.mypurecloud.ie");
gcApiClient.setPersistSettings(true, "CCR");

const gcWidgetsApi = new gcApi.WidgetsApi();

this.createWidget = async function(creds, data){
	const result = await gcApiClient.loginClientCredentialsGrant(creds.gcApiClientId, 
	
	creds.gcApiClientSecret).then(()=> {
		return gcWidgetsApi.postWidgetsDeployments(data);
	})
	.catch((e) => {
		console.log("Exception happened while contacting genesys cloud", e);
		return undefined;
	});

	if(!(!!result) || !(!!result?.id)){
		return undefined;
	}

	return result;
}

Is there any way to increase timeout ??, i checked documentation, i even checked the code of the library, i couldn't find a way to increase the waiting timeout.

This is sensitive, we can either solve this timeout wait-time from your backend or from the library,

I am building an automated code for automating setup for AppFoundry App, in the app, each API call relies on its previous, so if one of the steps fails, the whole procedure fails, catching the error and trying again would take too much time to handle, increasing timeout would make more sense.

PS: by the way, in the above given example when i run the code, i get the 504 error:
{
"message": "The request timed out.",
"code": "gateway.timeout",
"status": 504,
"contextId": "a851e9ff-1a40-4b37-8a1a-0e3b3babd6fa",
"details": [],
"errors": []
}

however, the widget is being created!, which doesn't make sense :frowning:

and i am sure you already know that there is a limit for the number of widgets in each genesys cloud tenant (25), so that means i must go back manually to delete that widget from the admin interface,

which was created by error and couldn't get its id programatically inorder to delete it automatically when error happens.

Please advice,
Thank you.
Tarik.

5xx errors cannot be investigated via the forum. Please open a case with Genesys Cloud Care to troubleshoot further.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.