cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Browser synthetic in workflow returns - An error occurred: Action results and produced logs together are too large.

kimberly_mirkes
Participant

When I run a browser synthetic from a workflow, I get this error:

An error occurred: Action results and produced logs together are too large. They can't exceed 1MB each. Try changing the task inputs to return a smaller result.

Can anyone tell me how to just return whether the execution step returns success or failure?

This error comes from requesting short results:

import { syntheticOnDemandMonitorExecutionsClient, _SyntheticOnDemandExecutionResultTransformation, isClientRequestError } from '@dynatrace-sdk/client-classic-environment-v2';
import { executionsClient, actionExecutionsClient } from '@dynatrace-sdk/client-automation';
import { eventsClient } from '@dynatrace-sdk/client-classic-environment-v2';
import { metricsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ execution_id, action_execution_id }) {
let awaitExecution = await actionExecutionsClient.getActionExecution({ id: action_execution_id });
const loopItem = awaitExecution.loopItem;
const execId = loopItem;

const maxRetryCount = 10;
const retryIntervalSec = 5;

let done = false;
//let responseStatusCode;

for (let i = 1; i < maxRetryCount; i++) {
while (!done) {
try {
executionResult = await syntheticOnDemandMonitorExecutionsClient.getExecution({ executionId: execId });

//console.log("executionResultShort")
//console.dir(executionResultShort)

done = true;

} catch (e) {
console.error(e);
if (isClientRequestError(e) && e.response.status === 541) {
console.log("Error: " + e.response.status)
}
continue;
}
if (!done) {
//Delay for data_retrieved results
console.log("[return_short_result] retry " + i + " of " + maxRetryCount + " in " + retryIntervalSec + " seconds");
const timer = ms => new Promise(res => setTimeout(res, ms));
await timer(retryIntervalSec * 1000);
}

}
}

if (!done) {
throw new Error(`[return_short_result] for ${execId} failed after ${maxRetryCount} retries`);
}
// console.log("[return_short_results_other] executionResultShort: ")
// console.dir(executionResultShort)

//return executionResultShort;
}

0 REPLIES 0

Featured Posts