copy drivefile not working

143 views
Skip to first unread message

Ian Crew

unread,
Jul 11, 2023, 7:31:37 PM7/11/23
to GAM for G Suite
Hi all:

I’m having some trouble getting “gam copy drivefile” to work. I’m trying to copy a file (a Sheet) from a folder on a shared drive to a different folder on the same shared drive.

Here’s what I get when I try:
 
$ gam user f...@example.edu copy drivefile id '1jzFuK9j_GEaKhZezlF3v6FVKGViDnc82_C6-l5-oerM' newfilename "forwards 2023-07-10" parentid 1yackmwZ6RmSoal_ndWaMUae1HJBtHPm4
User: f...@example.edu, Copy 1 Drive File/Folder
  User: f...@example.edu, Shared Drive ID: 0ANuN4K8o4cxfUk9PVA, Copy Failed: Does not exist

I’ve verified that the file I’m copying exists, and the f...@example.edu user has access to it:

$ gam user f...@example.edu show fileinfo id '1jzFuK9j_GEaKhZezlF3v6FVKGViDnc82_C6-l5-oerM' 
User: f...@example.edu, Show 1 Drive File/Folder
  Drive File: 2023-07-10 Filter forwards (1jzFuK9j_GEaKhZezlF3v6FVKGViDnc82_C6-l5-oerM)
    capabilities:
      canAddChildren: False

[lots of info shown, but not relevant here, I don’t think. The point is that this command works fine]

And also that the destination folder exists, and f...@example.edu user has access to it:

$ gam user f...@example.edu show fileinfo id 1yakcmwZ6RmSoal_ndWzMUae1HJBtHPm4 
User: f...@example.edu, Show 1 Drive File/Folder
  Drive Folder: Automated reporting (1yackmwZ6RmSoal_ndWzMUae1HJBtHPm4)
    capabilities:
      canAddChildren: True

[lots of info shown, but not relevant here, I don’t think. The point is that this command works fine]

But as you can see, the copy fails with a “Does not exist”.

Any ideas?

Thanks!

Ian

Ross Scroggs

unread,
Jul 11, 2023, 7:46:17 PM7/11/23
to google-ap...@googlegroups.com
Ian,

What does this show?
gam user f...@example.edu show fileinfo  id 0ANuN4K8o4cxfUk9PVA

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/9B194054-F3BC-4417-8BE5-D1646941EC89%40berkeley.edu.


--

Ian Crew

unread,
Jul 11, 2023, 8:39:56 PM7/11/23
to GAM for G Suite
Thanks Ross:

I get:

$ gam user f...@example.edu show fileinfo id 0ANuN4K8o4cxfUk9PVA
User: f...@example.edu, Show 1 Drive File/Folder
  User: f...@example.edu, Drive File/Folder ID: 0ANuN4K8o4cxfUk9PVA, Show Failed: Does not exist

What I don’t understand is where 0ANuN4K8o4cxfUk9PVA is coming from, as I didn’t list it in my original command….

Cheers,

Ian

Ross Scroggs

unread,
Jul 11, 2023, 9:03:47 PM7/11/23
to google-ap...@googlegroups.com
Gam is trying to get information about the Shared Drive itself, but it would appear that foo is not a member of the drive.
To copy to a shared drive you have to be an organizer/manager and as a non-member gam fails trying to get the info to verify the users' role.

Ross



--

Ian Crew

unread,
Jul 11, 2023, 9:10:30 PM7/11/23
to GAM for G Suite
Aha! That works. Thanks Ross!

Ian

Reply all
Reply to author
Forward
0 new messages