TheDiscordian / ipfs-sync

A simple daemon which will watch files on your filesystem, mirror them to MFS, automatically update related pins, and update related IPNS keys.
BSD 3-Clause "New" or "Revised" License
95 stars 14 forks source link

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

Open TheDiscordian opened 2 years ago

TheDiscordian commented 2 years ago

This needs to be isolated and filed upstream.

TheDiscordian commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.

lidel commented 2 years ago

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

TheDiscordian commented 2 years ago

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