16 May 2024 06:23 PM
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;
}
01 Jul 2024 12:18 PM
Did you find the solution to this?
01 Jul 2024 01:24 PM
Hannah, I have not found a solution.