Update Google Drive File - not found

Describe the problem/error/question

Hi All, I am using Google OAuth API. I can retrieve a file just by using the ID but as soon as I try and update the same file with new binary data (a PDF) I just get an empty error message (ERROR: UNKNOWN ERROR). I can update the name if I ignore ‘Change File Content’. So the file exists, I have permission to change the file, but as soon as I try and change the contents I get an error.

What is the error message (if any)?

ERROR: UNKNOWN ERROR

Time
24/11/2023, 13:28:29
HTTP Code
undefined
Cause
Data below may contain sensitive information. Proceed with caution when sharing.
{
}
Stack
NodeApiError: UNKNOWN ERROR - check the detailed error for more information
    at Object.googleApiRequest (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/Google/Drive/v2/transport/index.ts:62:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.execute (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/Google/Drive/v2/actions/file/update.operation.ts:181:4)
    at Object.router (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/Google/Drive/v2/actions/router.ts:30:26)
    at Workflow.runNode (/usr/lib/node_modules/n8n/node_modules/n8n-workflow/src/Workflow.ts:1307:8)
    at /usr/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:1045:29```

## Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)


## Share the output returned by the last node
<!-- If you need help with data transformations, please also share your expected output. -->

## Information on your n8n setup
- **n8n version:** 1.11.2
- **Database (default: SQLite):**
- **n8n EXECUTIONS_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** Commnity Edition, self hosted on Proxmox
- **Operating system:**

Hi @James_Giddings, welcome to the community! I am very sorry you’re having trouble.

I just tried running the below workflow on my own n8n instance running [email protected]:

This workflow completes as expected for a file owned by me:

Same result for a PDF file:

The file content is changed in Google Drive as expected. So I suspect this is not a problem specific to the file type.

I wonder if this could be related to permissions/ownership. Are you the owner of the file you are updating? In a first step, can you update to the latest available n8n version, then execute the example workflow above and confirm if you are still seeing the error?

Thanks MutedJam,

I was chasing down permissions thinking that was the issue, but using the same OAuth2 credentials, I can delete files from the same shared drive folder.

As another test, I was able to update an existing file in My Drive, which led me to believe that the original file being on the Shared Drive had something to do with it. Using postman, I was able to determine that I needed to set a query param for supportsAllDrives=true and then I got a 200 response rather than resource not found.

I am yet to update the file from n8n because I cannot set that query param from the built in Google Drive Update File node. Any suggestions?

1 Like

Yes, that makes sense! I was not aware you’re using a Shared Drive before this comment but was able to reproduce the problem now. I shall add this to our engineering backlog for a closer look and fix.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.