List and Move Files in Folders in Google Drive

Hey!

I just tried to move files to Google Drive, but somehow I get an error message. I checked everything and it appears to be correct, yet it doesn’t work. It seems that it is trying to add a parent instead of replacing the existing one or am I missing something?

As for listing files in Drive, the documentation says to enable the query string and enter the parent folder ID in the “Parent” field, but when you select and list files, the „parent" field never appears. Perhaps something has been forgotten here. You can only filter by entering the query string "PARENT_ID“ in parents.

Hope someone can help :slight_smile:

This is the Error:
{

“message”: “403 - {“error”:{“errors”:[{“domain”:“global”,“reason”:“teamDrivesParentLimit”,“message”:“A shared drive item must have exactly one parent.”}],“code”:403,“message”:“A shared drive item must have exactly one parent.”}}”,

“name”: “Error”,

“stack”: “Error: Request failed with status code 403 at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)”

}

1 Like

Hi @denobeno, this error message sounds like we might not be removing the old parent when setting the new one. Most likely because we’re using the addParents parameter here rather than setting the parents[] parameter. Perhaps @Jon can take a look at the Google Drive node when he has a bit of time?

1 Like

Just a note to say I’m encountering this issue too. A fix would be great.

Hey @James_Haptivate,

It is on my list but I have not had a chance to take a proper look at it yet. Are you also seeing it on a shared drive?

1 Like

Hey @Jon - Thanks for the quick reply. Yes it’s in a shared drive.

Hey there, has anybody found a solution to this? Running into the same issue on shared drive.

There is currently no workaround or solution, it’s a bug that needs to be fixed by the team.

i am currently unable to list to content of a drive folder, be handy if the node was working to allow us to do that

Hi @Jon, there have been a few updates to the Google Drive node, but it’s still not possible to Move Files between Folders on a shared drive. It’s been 3 months now, and I would be very grateful if you could fix the issue as soon as possible because it’s really necessary.

Not sure if they removed the option to choose a parent folder. If you want to list files in a specific folder now the only option i see is to enable the option “Use Query String” and define the parent folder:

ReplaceWithYourParentFolderID” in parents and trashed=false

You find the parent folder ID in the URL:
…google.com/drive/folders/JduEen8ds3_2kas2ndDbe8836BHed

Result:
“JduEen8ds3_2kas2ndDbe8836BHed” in parents and trashed=false

The trashed=false query excludes files that have been deleted/moved to trash, otherwise they will be listed as well.

I slightly disagree. That is actually the nice thing about a project of which the source code is available. Literally, anybody can not just extend it, they can also fix bugs. Doing that is also generally the fastest way to get an issue resolved. It also gives a good indication of how urgent something really is. If it is important to people, they tend to fix them themselves very fast (or get somebody external to do it for them). If not, then they stay unresolved for a long time.

We for sure try and do our best to get all issues resolved, but there is always a lot to be done and we also have limited resources. So for that reason can sadly not every issue always be resolved as fast as we would love to do it.

2 Likes

@jan I was just looking to see if the problem was solved, but it still exists after 6 months.

I understand your point, and of course, I understand that there are priorities.
But as you started monetizing the product, which is perfectly fine, you may start thinking differently. The bug also appears in n8n’s cloud solution, or am I wrong?

And we’re talking about Google (Workspace), not a small company and a fairly unused service.

I don’t know exactly what your target audience is, but as I see it, platforms like Zapier and Make (formerly Integromat) are among your competitors. So many of your potential users/customers are probably not developers who can solve this problem themselves.

I also used other platforms and have recommended n8n wherever I could. But if the product lacks basic features, like moving files from A to B in Google’s cloud business solution, it will be difficult to convince users to switch from a competitor to n8n. This is also the reason I build projects for customers on Make and cannot recommend n8n (cloud) to them, although I would like to.

Ultimately, of course, it is up to you how you deal with it. I just wanted to leave a few thoughts.

Hey @denobeno,

We have an internal dev ticket opened which is being tracked as NODE-128 for an overhaul of the node which this change will likely be part of.

The issue does also exist on Cloud as it is the same code base but our prioritisation process will still be the same, We look at how popular the node is, how many users have the issue, how much time is involved in fixing it and some other data points.

No process is perfect and 6 months to fix this does bug me and we will get to it but we have also been busy working on overhauling other nodes and adding new features, If you are handy with Typescript you can of course always pop in a PR to resolve it. My only thing with this one would be do we just block multiple parents which can be valid or do we have some kind of toggle option to mark it as being shared.

Hey @denobeno,

I was curious about this so over a cup of coffee I took a quick look at the Google API and oddly enough they don’t actually provide a way to just set the parent, They have an Add Parent and a Remove Parent which requires all of the parent IDs to remove so I guess there is another bit of complexity to this one.

1 Like

Hi @Jon,

Thanks for taking the time to look into this again. I completely understand that your resources are limited, and if I could have solved it myself, I would have. To be honest, for me there was no need, as I still use Make for these tasks. Still I would like to migrate all automations to n8n so I can focus this platform for all of my projects.

I think this is the documentation you are referring to: Migrate your app to the single-parent model  |  Google Drive  |  Google Developers

And yeah, as I understand it, the old parent has to be removed with removeParents to add the new one with addParents and enforceSingleParent set to true.

Currently, it looks like he’s trying to add a new parent without removing the old one.

1 Like