keybase / client

Keybase Go Library, Client, Service, OS X, iOS, Android, Electron
BSD 3-Clause "New" or "Revised" License
8.83k stars 1.22k forks source link

kbfsfuse keeps crashing on my Linux machine #8937

Open fabiob opened 6 years ago

fabiob commented 6 years ago

Hi! I just started using Keybase. Today, my laptop was running real slow. I checked iotop, and noticed that kbfsfuse was performing a lot of IO. So I killed it, using the same procedure that the run_keybase script does:

fusermount -uz /keybase
killall kbfsfuse

Now I'm trying to use Keybase to transfer some information among two of my laptops, but kbfsfuse just won't start.

Hope you guys can find what's wrong from my log id: ba34c3bb1a6f6ed29acc681c

I've found some errors on keybase.kbfs.log, related to a "merge conflict" or something? It ends with:

2017-10-09T18:58:59.519607-03:00 ▶ [DEBU kbfs(CR a6b56b0e) conflict_resolver.go:3172] 2b3 Recreate ops: [] [tags:CRID=CiULk7kBqREqE71X19r-Yg]
2017-10-09T18:58:59.520826-03:00 ▶ [DEBU kbfs(CR a6b56b0e) asm_amd64.s:509] 2b4 Finished conflict resolution: <nil> [tags:CRID=CiULk7kBqREqE71X19r-Yg]
panic: runtime error: index out of range

goroutine 367 [running]:
github.com/keybase/kbfs/libkbfs.path.tailName(...)
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/path.go:122
github.com/keybase/kbfs/libkbfs.(*setAttrOp).checkConflict(0xc420ae2200, 0x1e6ea60, 0xc422aa2e00, 0x1e63ce0, 0xc420044590, 0x1e7b140, 0xc42466ae00, 0x0, 0x0, 0x0, ...)
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/ops.go:1135 +0x98d
github.com/keybase/kbfs/libkbfs.(*crChain).getActionsToMerge(0xc4204316c0, 0x1e6ea60, 0xc422aa2e00, 0x1e63ce0, 0xc420044590, 0x82ae8d540e6bb5a6, 0x160d37b5d485aeb4, 0x0, 0x0, 0xc423cdde00, ...)
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/cr_chains.go:203 +0x16b
github.com/keybase/kbfs/libkbfs.(*ConflictResolver).getActionsToMerge(0xc4202357a0, 0x1e6ea60, 0xc422aa2e00, 0xc422aab2c0, 0xc422aaa3c0, 0xc4220d7d10, 0x20, 0xc4220dc2d0, 0x46)
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/conflict_resolver.go:1938 +0x342
github.com/keybase/kbfs/libkbfs.(*ConflictResolver).computeActions(0xc4202357a0, 0x1e6ea60, 0xc422aa2e00, 0xc422aab2c0, 0xc422aaa3c0, 0xc4206c2200, 0x9, 0x9, 0xc4220d7d10, 0x0, ...)
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/conflict_resolver.go:2093 +0x2b2
github.com/keybase/kbfs/libkbfs.(*ConflictResolver).doResolve(0xc4202357a0, 0x1e6ea60, 0xc422aa2e00, 0x8, 0x0)
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/conflict_resolver.go:3189 +0x11fc
github.com/keybase/kbfs/libkbfs.(*ConflictResolver).processInput.func3(0xc4202357a0, 0xc420b14180, 0xc4220c6c00, 0x8, 0x0, 0xc420aadb60)
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/conflict_resolver.go:217 +0x229
created by github.com/keybase/kbfs/libkbfs.(*ConflictResolver).processInput
    /root/build/gopaths/amd64/src/github.com/keybase/kbfs/libkbfs/conflict_resolver.go:205 +0x278
strib commented 6 years ago

Thanks for the report! Already looking through your logs, will update when I figure it out or have a workaround. Sorry for the bad experience!

fabiob commented 6 years ago

Thanks :) BTW, for now, everything I have in my private folder is a copy... So I won't mind if one of the workarounds is to reset the folder entirely.

strib commented 6 years ago

@fabiob: I think the workaround is to stop Keybase on this machine, and blow away the local commits that haven't made it to the server yet:

rm -rf /home/$USER/.local/share/keybase/kbfs_journal/v1/01208b089f86dfff40f1adfbaedcf1b2056f-a6b56b0e548dae82

Then restart Keybase, and copy the files back into the shared folder.

If I'm reading the logs right, it looks like you wrote a bunch of files from two different devices at the same time, and managed to get this device into a weird, broken state. Nothing wrong with that, it should work, but you managed to trip an edge case. I'll work on fixing it. But for now, let me know if the workaround fixes things.

fabiob commented 6 years ago

It worked! Thanks for your help, @strib!

What actually happened is that I've sent a bunch of files to my private folder yesterday from my "Computer A", then shut it down.

Today I tried to send some more from "Computer B". When I opened my private folder on "Computer B", I noticed that some of the files were missing, so I just sent those again.

When I was done, I opened "Computer A" again, and the bug kicked in.

strib commented 6 years ago

Ah got it, that makes sense. Thanks for the explanation. I'll work on finding the bug to prevent this from happening again in the future.