Upload file to google drive

Hello, I’m having an issue with uploading a file to google drive in a workflow. The workflow was copied from here : Backup n8n workflows to Google Drive | n8n workflow template

The error I get is only with the last node (upload to drive). I get a buffer error and perhaps a credentials error… Here is the error code (403)

{“message”:“403 - {"type":"Buffer","data":[123,10,32,34,101,114,114,111,114,34,58,32,123,10,32,32,34,101,114,114,111,114,115,34,58,32,91,10,32,32,32,123,10,32,32,32,32,34,100,111,109,97,105,110,34,58,32,34,117,115,97,103,101,76,105,109,105,116,115,34,44,10,32,32,32,32,34,114,101,97,115,111,110,34,58,32,34,97,99,99,101,115,115,78,111,116,67,111,110,102,105,103,117,114,101,100,34,44,10,32,32,32,32,34,109,101,115,115,97,103,101,34,58,32,34,65,99,99,101,115,115,32,78,111,116,32,67,111,110,102,105,103,117,114,101,100,46,32,68,114,105,118,101,32,65,80,73,32,104,97,115,32,110,111,116,32,98,101,101,110,32,117,115,101,100,32,105,110,32,112,114,111,106,101,99,116,32,51,54,57,57,50,51,48,52,48,51,57,57,32,98,101,102,111,114,101,32,111,114,32,105,116,32,105,115,32,100,105,115,97,98,108,101,100,46,32,69,110,97,98,108,101,32,105,116,32,98,121,32,118,105,115,105,116,105,110,103,32,104,116,116,112,115,58,47,47,99,111,110,115,111,108,101,46,100,101,118,101,108,111,112,101,114,115,46,103,111,111,103,108,101,46,99,111,109,47,97,112,105,115,47,97,112,105,47,100,114,105,118,101,46,103,111,111,103,108,101,97,112,105,115,46,99,111,109,47,111,118,101,114,118,105,101,119,63,112,114,111,106,101,99,116,61,51,54,57,57,50,51,48,52,48,51,57,57,32,116,104,101,110,32,114,101,116,114,121,46,32,73,102,32,121,111,117,32,101,110,97,98,108,101,100,32,116,104,105,115,32,65,80,73,32,114,101,99,101,110,116,108,121,44,32,119,97,105,116,32,97,32,102,101,119,32,109,105,110,117,116,101,115,32,102,111,114,32,116,104,101,32,97,99,116,105,111,110,32,116,111,32,112,114,111,112,97,103,97,116,101,32,116,111,32,111,117,114,32,115,121,115,116,101,109,115,32,97,110,100,32,114,101,116,114,121,46,34,44,10,32,32,32,32,34,101,120,116,101,110,100,101,100,72,101,108,112,34,58,32,34,104,116,116,112,115,58,47,47,99,111,110,115,111,108,101,46,100,101,118,101,108,111,112,101,114,115,46,103,111,111,103,108,101,46,99,111,109,47,97,112,105,115,47,97,112,105,47,100,114,105,118,101,46,103,111,111,103,108,101,97,112,105,115,46,99,111,109,47,111,118,101,114,118,105,101,119,63,112,114,111,106,101,99,116,61,51,54,57,57,50,51,48,52,48,51,57,57,34,10,32,32,32,125,10,32,32,93,44,10,32,32,34,99,111,100,101,34,58,32,52,48,51,44,10,32,32,34,109,101,115,115,97,103,101,34,58,32,34,65,99,99,101,115,115,32,78,111,116,32,67,111,110,102,105,103,117,114,101,100,46,32,68,114,105,118,101,32,65,80,73,32,104,97,115,32,110,111,116,32,98,101,101,110,32,117,115,101,100,32,105,110,32,112,114,111,106,101,99,116,32,51,54,57,57,50,51,48,52,48,51,57,57,32,98,101,102,111,114,101,32,111,114,32,105,116,32,105,115,32,100,105,115,97,98,108,101,100,46,32,69,110,97,98,108,101,32,105,116,32,98,121,32,118,105,115,105,116,105,110,103,32,104,116,116,112,115,58,47,47,99,111,110,115,111,108,101,46,100,101,118,101,108,111,112,101,114,115,46,103,111,111,103,108,101,46,99,111,109,47,97,112,105,115,47,97,112,105,47,100,114,105,118,101,46,103,111,111,103,108,101,97,112,105,115,46,99,111,109,47,111,118,101,114,118,105,101,119,63,112,114,111,106,101,99,116,61,51,54,57,57,50,51,48,52,48,51,57,57,32,116,104,101,110,32,114,101,116,114,121,46,32,73,102,32,121,111,117,32,101,110,97,98,108,101,100,32,116,104,105,115,32,65,80,73,32,114,101,99,101,110,116,108,121,44,32,119,97,105,116,32,97,32,102,101,119,32,109,105,110,117,116,101,115,32,102,111,114,32,116,104,101,32,97,99,116,105,111,110,32,116,111,32,112,114,111,112,97,103,97,116,101,32,116,111,32,111,117,114,32,115,121,115,116,101,109,115,32,97,110,100,32,114,101,116,114,121,46,34,10,32,125,10,125,10]}”,“name”:“Error”,“stack”:“Error: Request failed with status code 403\n at createError (/home/pi/.nodejs_global/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/home/pi/.nodejs_global/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/home/pi/.nodejs_global/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (events.js:412:35)\n at endReadableNT (internal/streams/readable.js:1334:12)\n at processTicksAndRejections (internal/process/task_queues.js:82:21)”}

Anyone have any ideas? Credentials with OAuth2 worked in setup and are working with gmail on another workflow…

When I set up this same exact flow a week ago I ran into a similar error. and it was just as simple and enabled Google Drive to be accessed via n8n.

I just tested my flow and it works fine:

Can you share the JSON file of the flow you are running?
As you can see mine is pretty much 1to1 the original flow you copied. Backup n8n workflows to Google Drive | n8n workflow template

Thanks for your help. The flow is a direct copy/paste of the above link. I changed nothing other than to add the credentials on the nodes…

I also recreated the drive credential just in case, it connects, but each time I try to run the flow I get the buffer error…

Hi @rgv, are you by any chancing using a version of n8n older than 0.156.0? Since this version n8n would print the full error body received from external APIs which I think could be helpful in this case.

Without any further information I think @David_Go could be spot on here as Google would throw 403 errors if the respective API is not enabled for your account. The required steps are described here:

Yup that was exactly it. I hadn’t activated Drive as an approved api service for that access act. Activated it and everything works like a charm.

Thanks a lot :+1:!!

I am happy to hear you got it up and running :slight_smile:

same error and i tried everything. Some weeks ago it was working