Why is the Invoice Parsing Workflow Resulting in an AxiosError with Status Code 400 in the Pipedream Module?

This topic was automatically generated from Slack. You can find the original thread here.

Hi Everyone, Hi ,
I’m running into an error with a regular workflow that parses invoices for me. The issue is with the module “Download to temp: from pipedream, here’s the error message, idk what’s happening, can you help?
AxiosError - Request failed with status code 400

Details

    at null.settle (/pipedream/dist/code/e38bd2df29adfed576cb77c48231cb351f59bae0185630d3a1c08073242d3688/node_modules/.pnpm/axios@1.7.9/node_modules/axios/dist/node/axios.cjs:2026:12)
    at IncomingMessage.handleStreamEnd (/pipedream/dist/code/e38bd2df29adfed576cb77c48231cb351f59bae0185630d3a1c08073242d3688/node_modules/.pnpm/axios@1.7.9/node_modules/axios/dist/node/axios.cjs:3142: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/e38bd2df29adfed576cb77c48231cb351f59bae0185630d3a1c08073242d3688/node_modules/.pnpm/@pipedream+platform@3.0.3/node_modules/@pipedream/platform/dist/axios.js:110:26)
    at Object.run (file:///pipedream/dist/code/e38bd2df29adfed576cb77c48231cb351f59bae0185630d3a1c08073242d3688/code/actions/download-file-to-tmp/download-file-to-tmp.mjs:29:18)
    at null.executeComponent (/var/task/launch_worker.js:316:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:816:28)

It seems like you’re encountering an AxiosError with a status code 400, which typically indicates a “Bad Request”. This error often occurs when the request sent to the server is malformed or contains invalid parameters. Here are a few steps you can take to troubleshoot and resolve this issue: 1. Check the API Request URL and Parameters: Ensure that the URL and any query parameters are correctly formatted. A common mistake is using incorrect parameter names or values. 2. Inspect the API Key: If your request requires an API key, make sure it’s correctly included in the request. For example, if you’re using the HERE API, the API key should be passed as a query parameter like apiKey=${this.here.$auth.apikey}. 3. Review the API Documentation: Double-check the API documentation to ensure that you’re using the correct endpoint and request format. Sometimes APIs have specific requirements for headers or body content. 4. Examine the Error Message: The error message you provided includes a buffer of data. This might contain more details about the error. You can try decoding it to see if it provides additional context. 5. Test the Request Independently: Use a tool like Postman or curl to manually test the request. This can help isolate whether the issue is with the request itself or something specific to your Pipedream workflow. 6. Review Workflow Configuration: Ensure that the Pipedream component making the request is configured correctly, especially if it involves dynamic data from previous steps. If these steps don’t resolve the issue, you might want to reach out to Pipedream support for further assistance. You can visit Support - Pipedream for more support options. If you have any specific questions about the code or need further assistance, feel free to ask!

But this works for all invoices, I send them to a webhook and then download them to tmp folder in the next step, why would this not work in this particular case while it’s working the rest of the time?