Bug with Google Drive Node (Upload Function)

Google Drive doesn’t seem to work nicely uploading files anymore (this used to work fine for ages), coming up with the following error. In this case, a file has been converted from Google Docs (via the Google Drive node), downloaded as a PDF and then a reupload is attempted. Replace # with valid file ID’s to test (same with Google Drive parent folder, but can leave this blank if you wish).

What is the error message (if any)?

"400 - “{\n "error": {\n "errors": [\n {\n "domain": "global",\n "reason": "invalidContentType",\n "message": "Invalid MIME type provided for the uploaded content.",\n "locationType": "other",\n "location": "media.mimeType"\n }\n ],\n "code": 400,\n "message": "Invalid MIME type provided for the uploaded content."\n }\n}\n”

Please share the workflow

Share the output returned by the last node

See Error

Information on your n8n setup

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

Hi @pb84, I am very sorry you’re having trouble with this.

I just gave this a go on my end and the workflow executed fine using [email protected] (after setting valid IDs of course):

Can you confirm how you have configured your n8n instance (especially which value you have set for the N8N_DEFAULT_BINARY_DATA_MODE environment variable if any)?

And does the upload work for you when manually overriding the mime type, for example like so:

1 Like

@MutedJam I’ve been facing this same problem. From what I understand, the Google Drive node is no longer converting to the indicated file type (or it’s just not changing the MIME Type, I’m not sure).

See an image of a workflow that ran on 12/12/2022. Notice that the target file type of google slides is “To PDF”, and in the node’s output we can see the correct MIME Type (application/pdf).

In this other image, from today’s run, exactly on the same node of the same flow (where I haven’t made any changes since the date mentioned above), we see that the destination file type of google slides is “To PDF”, but in the output from node we can see that the file extension has not changed and the MIME Type has not changed either. Looks like a bug to me.

2 Likes

Tried your nodes and didn’t work unfortunately; same error. However the variation with the change of mime file via the code node fixed it.

No values set for N8N_DEFAULT_BINARY_DATA_MODE

I agree that this seems like a bug as didn’t have this issue before

I can confirm I have the very same problem.
This definitely need a fix even though the code node is doing the trick for now.

2 Likes

@netroy could this by any chance be related to your recent changes around binary data handling in n8n?

1 Like

Yeah. looks like this broke due to these changes.
The fix is in review, and will most likely be included in the next release.

2 Likes

Got released with [email protected]

1 Like

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