MicrosoftOneDrive node, upload file, "ERROR: Bad request - please check your parameters"

Good afternoon, everyone. In the MicrosoftOneDrive node, upload file, there is a periodic error. What can it be related to?

Thank you.
Regards, Aleksandr.

Describe the issue/error/question

What is the error message (if any)?

{“message”:“400 - “{\“error\”:{\“code\”:\“invalidRequest\”,\“message\”:\“ObjectHandle is Invalid\”,\“innerError\”:{\“code\”:\“invalidResourceId\”,\“date\”:\“2022-06-28T11:46:06\”,\“request-id\”:\“1e210178-a31f-4842-b2e4-944b97923927\”,\“client-request-id\”:\“1e210178-a31f-4842-b2e4-944b97923927\”}}}””,“name”:“Error”,“stack”:“Error: Request failed with status code 400\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:539:35)\n at IncomingMessage.emit (node:domain:475:12)\n at endReadableNT (node:internal/streams/readable:1345:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”}

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

NodeApiError: Bad request - please check your parameters
    at Object.microsoftApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/OneDrive/GenericFunctions.js:29:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js:156:44)
    at async Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:594:28)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:537:49

Information on your n8n setup

  • n8n version: 0.183.0
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hey @asuhan,

It is hard to say. It could be the data in your workflow or something on the Onedrive side. Do you have the workflow you are using that you can share and the execution data for a failed run?

Good afternoon, Jon. Please take a look at it.

Do you have the execution history for when it failed last as well? Being able to see the data that was passed into the node would be very helpful.

This is what’s on the way out of the node before Microsoft One Drive

As JSON:
[

{

“headers”: {

“server”: “nginx”,

“date”: “Tue, 28 Jun 2022 11:46:05 GMT”,

“content-type”: “application/vnd.openxmlformats-officedocument.wordprocessingml.document”,

“content-length”: “31813”,

“connection”: “close”,

“accept-ranges”: “bytes”,

“content-disposition”: "attachment; filename*=UTF-8’’%D0%9C%D0%B0%D1%82%D0%B5%D1%80%D0%B8%D0%B0%D0%BB%D1%8B_5_%D0%9B%D0%B5%D0%B2%D0%B8%D0%BD%D0%B0%20%D0%A2.%20%D0%92.%20%28%D0%9D%D0%B0%D1%81%D1%82%D1%8F%20%D0%94%20%D0%9A%D0%BB%D0%B0%D0%B1%29_179%20978%2C40_28_06_2022.docx; creation-date=“Tue, 28 Jun 22 11:44:14 +0000"”,

“etag”: "“bc8d0419b97a93dc3dbf2206203d7032"”,

“expires”: “2022-06-28T12:46:04Z”,

“last-modified”: “Tue, 28 Jun 2022 11:44:15 GMT”,

“vary”: “Origin, Access-Control-Request-Headers, Access-Control-Request-Method”,

“x-amz-request-id”: “2d2c56cf788794a2”,

“x-amz-version-id”: “null”

},

“statusCode”: 200,

“statusMessage”: “OK”

}

]

Is that one file always failing?

That’s the thing, not always. Sometimes it loads, sometimes it doesn’t. I can’t figure out what “doesn’t like” OneDrive…

I guess the trick is going to be keep sending it and when it fails compare to see if there is anything different. If you can get a file or a data set that always fails it will make things a lot easier.

Thanks a lot for your help, Jon. There was an error, but not in this module. You helped me to take a closer look.
I’ll keep an eye on the flow.
Have a nice day!

1 Like

Perfect that is what I like to hear :smile: