keybase / client

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

Lost access to private directories #2109

Open jgcrossman2 opened 8 years ago

jgcrossman2 commented 8 years ago

After logging out of one account and back into my personal account, I lost the ability to access my private files through both the keybase app and the terminal.

johncrossman$ cd /keybase/private/jgcrossman2/ Johns-MacBook-Pro:jgcrossman2 johncrossman$ ls ls: .: Permission denied

keybase status

Default user: jgcrossman2 Other users: blockchainhealth

my log id: 0e16b0e79edafc45aa889b1c

RyanSinger commented 8 years ago

John and I think these two are the same bug: https://github.com/keybase/client/issues/2108

strib commented 8 years ago

In the logs, the only time I see an error accessing /keybase/private/jgcrossman2/ is when the active user was blockchainhealth:

2016-02-23T14:02:40.626552 ▶ [DEBU kbfs keybase_daemon_rpc.go:458] 6ea new session with username blockchainhealth ...
...
2016-02-23T14:02:40.904050 ▶ [DEBU kbfs(FBO 4b00d80d) folder_branch_ops.go:5227] 6f1 Done: blockchainhealth does not have read access to directory jgcrossman2,ryan_singer
...
2016-02-23T15:43:42.682725 ▶ [DEBU kbfs keybase_daemon_rpc.go:458] 972 new session with username jgcrossman2...

Looks like you tried to access the private folder immediately after switching over to the blockchainhealth account, so maybe you were confused there about which user you were? Does it work now that you are logged in as the right user?

strib commented 8 years ago

Oops nevermind, I misread that, it's the wrong folder. Looking again.

strib commented 8 years ago

Ok, this looks like a bug in our client when switching between users (not well tested right now, sorry!). You switch to user jgcrossman2 at 15:43:42 as above, and then get "Unauthorized" errors from our server:

26381 2016-02-23T15:43:46.835035 ▶ [DEBU kbfs kbfs_ops.go:117] 9cc Done: Unauthorized [tags:FID=4HICcZRCVmLxFmUPLEjR8w]
26382 2016-02-23T15:43:46.835502 ▶ [DEBU kbfsfuse dir.go:634] 9cd Unauthorized [tags:FID=4HICcZRCVmLxFmUPLEjR8w]
26383 2016-02-23T15:43:46.835540 ▶ [DEBU FUSE serve.go:817] 9ce -> [ID=0x4] Open error=permission denied: Unauthorized

But according to our servers, you were still trying to access the folders using the blockchainhealth user ID. So I guess the client was still trying to use the old session token, when really that should be flushed when the user changes.

@aalness, can you look into this please?

@jgcrossman2: a simple workaround should be restarting keybase. Or maybe it will start working after enough time passes (maybe an hour?) and the old session token expires.

strib commented 8 years ago

Actually @aalness pointed out to me that we already have a fix in code review for this (as part of a larger issue of being able to view public data while logged out). It might be a few days until that's in, but I'll let you know. In the meantime, let me know if it fixes itself eventually.

jgcrossman2 commented 8 years ago

Yup, looks like you were right about the need for letting some time pass between session switches. After I got back from the gym (about 3 hours), it worked perfectly. I'll give it a try tomorrow to see if an hour is sufficient.

strib commented 8 years ago

Great. That's an epic workout!

jgcrossman2 commented 8 years ago

Thanks. Like the direction you all are going in with these private/public directories.