Google Drive: can't delete safely - has multiple parents

What is the problem you are having with rclone?

can't delete safely - has multiple parents.

I'm at a loss as to why it's giving that error as the folder in question isn't a duplicate, nor are any of the folders in the path, the only duplicate is the file in the folder.

What is your rclone version (output from rclone version)

> rclone v1.52.2
> - os/arch: linux/amd64
> - go version: go1.14.4

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Debian 10 64 bit

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

/usr/bin/rclone dedupe skip GD:/Seedbox --checkers 2 --checksum --drive-pacer-min-sleep 100ms --fast-list --log-level DEBUG --low-level-retries 1000 --rc --rc-addr "192.168.0.5:5583" --rc-no-auth --rc-user=localadmin --rc-pass=XXXX --rc-web-gui --retries 1000 --retries-sleep 2s --tpslimit 2 --tpslimit-burst 2 --transfers 2 --user-agent 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'

The rclone config contents with secrets removed.

[GD]
type = drive
client_id = XXXX.apps.googleusercontent.com
client_secret = XXXX
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"2020-06-26T09:33:04.071825729+01:00"}
root_folder_id = XXXX

A log from the command with the -vv flag

2020/06/26 07:10:22 DEBUG : rclone: Version "v1.52.2" starting with parameters ["/usr/bin/rclone" "dedupe" "skip" "GD:/Seedbox" "--checkers" "2" "--checksum" "--drive-pacer-min-sleep" "100ms" "--fast-list" "--log-level" "DEBUG" "--low-level-retries" "1000" "--rc" "--rc-addr" "192.168.0.5:5583" "--rc-no-auth" "--rc-user=localadmin" "--rc-pass=passw0rd1" "--rc-web-gui" "--retries" "1000" "--retries-sleep" "2s" "--tpslimit" "2" "--tpslimit-burst" "2" "--transfers" "2" "--user-agent" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36"]
2020/06/26 07:10:22 NOTICE: Web GUI exists. Update skipped.
2020/06/26 07:10:22 INFO  : Cannot run Web GUI without authentication, using default auth
2020/06/26 07:10:22 NOTICE: Serving Web GUI
2020/06/26 07:10:22 INFO  : Using --user localadmin --pass XXXX as authenticated user
2020/06/26 07:10:22 NOTICE: Serving remote control on http://192.168.0.5:5583/
2020/06/26 07:10:22 DEBUG : login_token "XXXX"
2020/06/26 07:10:22 DEBUG : Using config file from "/root/.rclone.conf"
2020/06/26 07:10:22 INFO  : Starting HTTP transaction limiter: max 2 transactions/s with burst 2
2020/06/26 07:10:24 DEBUG : fs cache: renaming cache item "GD:/Seedbox" to be canonical "GD:Seedbox"
2020/06/26 07:10:24 INFO  : Google drive root 'Seedbox': Looking for duplicates using skip mode.
2020/06/26 07:47:54 NOTICE: data/seeds/mame.sh: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/aristmk6.zip: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/aristmk6.zip: Deleting 1/2 identical duplicates (MD5 "318661978bf040c2769e3430e4d2f146")
2020/06/26 07:47:54 ERROR : data/seeds/MAME 0.209 ROMs (bios-devices)/aristmk6.zip: Couldn't delete: can't delete safely - has multiple parents
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/dio98603a.zip: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/dio98603a.zip: Deleting 1/2 identical duplicates (MD5 "8d33ca7b417cda49b57c930a98e85c38")
2020/06/26 07:47:54 ERROR : data/seeds/MAME 0.209 ROMs (bios-devices)/dio98603a.zip: Couldn't delete: can't delete safely - has multiple parents
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/dio98543.zip: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/dio98543.zip: Deleting 1/2 identical duplicates (MD5 "c019f03f30c3100d66e56de96132ebeb")
2020/06/26 07:47:54 ERROR : data/seeds/MAME 0.209 ROMs (bios-devices)/dio98543.zip: Couldn't delete: can't delete safely - has multiple parents
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/dectalk_isa.zip: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/dectalk_isa.zip: Deleting 1/2 identical duplicates (MD5 "2a150c7de8ecdf9d9c3515e825815bf7")
2020/06/26 07:47:54 ERROR : data/seeds/MAME 0.209 ROMs (bios-devices)/dectalk_isa.zip: Couldn't delete: can't delete safely - has multiple parents
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/db411223.zip: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/db411223.zip: Deleting 1/2 identical duplicates (MD5 "30a989bab03afd6a23b93ce17f2c0188")
2020/06/26 07:47:54 ERROR : data/seeds/MAME 0.209 ROMs (bios-devices)/db411223.zip: Couldn't delete: can't delete safely - has multiple parents
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/clgd542x.zip: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/clgd542x.zip: Deleting 1/2 identical duplicates (MD5 "d96004cd1149a84c66572721c611f4b2")
2020/06/26 07:47:54 ERROR : data/seeds/MAME 0.209 ROMs (bios-devices)/clgd542x.zip: Couldn't delete: can't delete safely - has multiple parents
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/decocass.zip: Found 2 duplicates - deleting identical copies
2020/06/26 07:47:54 NOTICE: data/seeds/MAME 0.209 ROMs (bios-devices)/decocass.zip: Deleting 1/2 identical duplicates (MD5 "b7e1189b341bf6a8e270017c096d21b0")
2020/06/26 07:47:54 ERROR : data/seeds/MAME 0.209 ROMs (bios-devices)/decocass.zip: Couldn't delete: can't delete safely - has multiple parents
2020/06/26 07:47:54 DEBUG : 7 go routines active
2020/06/26 07:47:54 Failed to dedupe with 7 errors: last error was: can't delete safely - has multiple parents

A file with multiple parents is in two (or more) directories at once.

If you delete the file it will go from both directories which is a good way to lose data - that is why rclone doesn't allow it.

I note also that google are phasing this feature out quite soon in favour of shortcuts.

If you do

rclone lsf "GD:/Seedbox/data/seeds/MAME 0.209 ROMs (bios-devices)" -vv --dump bodies

You'll see in there the directory listing from google drive. I'd cut out the JSON blob response and pass it through jq . to tidy it up (you don't have to do this but it makes the next step easier). Then find the name of one of the files and find the IDs of the parents.

Once you have the ID of the parents you can figure out where the files are multiply linked - you can paste directory IDs into the drive web interface https://drive.google.com/drive/folders/DIRECTORYID.

The other thing you could do is delete the duplicates manually in the drive web interface - I'm not 100% sure what the drive web interface does with multiply linked files but hopefully it is clever enough not to delete the file and just remove one of the parents (rclone should do this but I decided not to implement it since the whole feature is disappearing soon).
So assuming that

Thanks for the reply, I did that command, but it listed the 4 directories that were in the command itself, and not any new ones.

Seedbox
data
seeds
MAME 0.209 ROMs (bios-devices)

I ended up just manually removing the duplicates by going to the MAME folder and deleting them in the web ui.

As for the shortcuts I did notice some odd shortcut behaviour a while ago, did wonder what was going on.

If you know the filenames, all you have to do is search for them using google drive web interface, and it will show all the results, where they are, etc, and you can delete it from there too

That is probably the most sensible solution :slight_smile:

Here is the article on shortcuts vs multiple parents and how the latter are being removed in favour of the former

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