Hey, I managed to make my workflow run correctly for some weeks.
Here is what I did in the last steps.
import { axios } from “@pipedream/platform”;
import fs from “fs”;
import path from “path”;
export default defineComponent({
props: {
gtmetrix: {
type: “app”,
app: “gtmetrix”,
},
/*
google: {
type: “app”,
app: “google”,
},
*/
},
async run({ steps, $ }) {
// Define the GTMetrix report URL
const reportUrl = steps.get_performance_report.$return_value.links.report_pdf;
// Download the GTMetrix report
const reportResponse = await axios($, {
url: reportUrl,
method: "GET",
responseType: "arraybuffer",
auth: {
username: `${this.gtmetrix.$auth.api_key}`,
password: ``,
},
});
// Save the report to a temporary file
const tempFilePath = path.join("/tmp", "gtmetrix_report.pdf");
fs.writeFileSync(tempFilePath, reportResponse, "binary");
},
});
And I add an Action of Google Drive to upload the temp file with this configuration:
But now I’ve got an error that I couldn’t figure out what is the problem. My workflow runs correctly and generate the report but is failing in these final steps to save the PDF.
AxiosError - Request failed with status code 503
{“type”:“Buffer”,“data”:[123,34,101,114,114,111,114,115,34,58,91,123,34,116,105,116,108,101,34,58,34,80,68,70,32,83,101,114,118,105,99,101,32,117,110,97,118,97,105,108,97,98,108,101,34,44,34,99,111,100,101,34,58,34,69,52,53,48,51,48,51,34,44,34,115,116,97,116,117,115,34,58,34,53,48,51,34,44,34,100,101,116,97,105,108,34,58,34,80,68,70,32,83,101,114,118,105,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,46,34,125,93,125,10]}
Details
at null.settle (/pipedream/dist/code/2090592c85afb4c34cc16c9080bd8bc724c73a261b65c9aba0742d9ec93abefc/node_modules/.pnpm/axios@1.7.2/node_modules/axios/dist/node/axios.cjs:1983:12)
at IncomingMessage.handleStreamEnd (/pipedream/dist/code/2090592c85afb4c34cc16c9080bd8bc724c73a261b65c9aba0742d9ec93abefc/node_modules/.pnpm/axios@1.7.2/node_modules/axios/dist/node/axios.cjs:3085:11)
at IncomingMessage.emit (node:events:531:35)
at null.endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at null.callAxios (/pipedream/dist/code/2090592c85afb4c34cc16c9080bd8bc724c73a261b65c9aba0742d9ec93abefc/node_modules/.pnpm/@pipedream+platform@3.0.0/node_modules/@pipedream/platform/dist/axios.js:110:26)
at Object.run (file:///pipedream/dist/code/2090592c85afb4c34cc16c9080bd8bc724c73a261b65c9aba0742d9ec93abefc/component.mjs:23:28)
at null.executeComponent (/var/task/launch_worker.js:292:22)
at MessagePort.messageHandler (/var/task/launch_worker.js:792:28)
I appreciate any idea to review what could be this error.
Thank you.