ipfs-sync icon indicating copy to clipboard operation
ipfs-sync copied to clipboard

It's possible for a directory to be created, which can't be removed. Removing block manually results in go-ipfs locking up

Open TheDiscordian opened this issue 4 years ago • 6 comments

This needs to be isolated and filed upstream.

TheDiscordian avatar Oct 14 '21 17:10 TheDiscordian

So I've completely broken my MFS I guess, but I have no idea how to repair it. Running ipfs-sync normally until I got the typical FileStore issue where it's complaining that a file doesn't exist. I'd put the file there, removed it, removed it from MFS, removed the blocks, tried everything. Now I have a directory where if I perform ipfs files ls on it, I can't perform anything else afterwards because go-ipfs is totally locked up.

TheDiscordian avatar Oct 14 '21 17:10 TheDiscordian

Anyone following this repo note, this bug shouldn't be present in 0.7.0. This bug should only be in master. I suspect it has something to do with #38.

TheDiscordian avatar Oct 14 '21 17:10 TheDiscordian

Steps:

  1. Directory created with 2 small files in it
  2. Directory moved several times
  3. Breakage ("no such file/directory", can't do anything)

Attempted fix:

  1. Remove all blocks belonging to files referenced as missing (done by ipfs-sync automatically)
  2. Remove the bad CID from blockstore with ipfs block rm <cid> (this is what caused the locking up issues, before this, I just got the "no such file/dir" error)
  3. Remove all blocks which fail filestore verify
  4. Garbage collection

After all these steps, I've had no improvement, I'm unsure how to debug further.

TheDiscordian avatar Oct 14 '21 17:10 TheDiscordian

Note: I can't even stat the bad directory. The entry still exists in MFS, but interacting with it in any way causes go-ipfs to lock up.

TheDiscordian avatar Oct 14 '21 18:10 TheDiscordian

What happens when you try to remove it via ipfs files rm -f /path/to/thing ? (note -f)

lidel avatar Oct 16 '21 13:10 lidel

@lidel thanks for the response, sorry for my slow one! Like everything else I try on it, it just hangs indefinitely.

TheDiscordian avatar Oct 20 '21 20:10 TheDiscordian