keybase / keybase/client

Keybase eats permissions errors when ~/.local/share/keybase/started.txt is not writable

Open
#5,820 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

I ran the app (run_keybase) as root the first time accidentally; I had opened a root shell via sudo bash to install all your goodies.

Nevertheless the file init there made things wrong perms when I de-escalated to run as is proper. I fixed the files in ~/.cache/keybase, but it appears ~/.local/share/keybase/started.txt not being writable caused the app to die with no notification to the user aside from logs in ~/.cache/keybase.

Also, interestingly enough, the initial running as root failed to bring up the app, but nevertheless kept a keybase process active, preventing the application from running when privs were de-escalated. This failure was similarly not reported by the app, I had to figure it out by myself by reading the log:

: raw prop works only when window.DOMParser exists.
Only one instance of keybase GUI allowed, bailing!

In any case, it appears that one original accident in running as root prevented a config file from initializing:

2017-02-10T20:53:15.048230 ▶ [DEBU keybase json.go:50] 001 + loading config file: /home/doge/.config/keybase/config.json
2017-02-10T20:53:15.048295 ▶ [DEBU keybase json.go:58] 002 No config file found; tried /home/doge/.config/keybase/config.json
...
2017-02-10T20:53:15.059115 ▶ [DEBU keybase login_provisioned_device.go:106] 035 error getting user config: .current_user: no such key: current_user (*jsonw.Error)
2017-02-10T20:53:15.059152 ▶ [DEBU keybase engine.go:66] 036 - RunEngine(loginProvisionedDevice) -> ERROR: No user config available
2017-02-10T20:53:15.059185 ▶ [DEBU keybase main.go:744] 037 error running LoginProvisionedDevice on service startup: No user config available

It appeared as though the .config/keybase/config.json file did not exist. So I decided to initialize like so based on it complaining about no current_user:

echo '{"current_user":"teodesian"}' > /home/doge/.config/keybase/config.json

And apparently it wants a UID. I tried to be clever and figure out my UID from inspecting your DOM & global JS vars, but nothing jumped out at me. So, here's a bug. Hope it helps :)

my log id: 02b2671f1d4276d2b33b9d1c

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the app through run_keybase with ~/.local/share/keybase/started.txt unwritable and review the referenced logs. Read json.go, login_provisioned_device.go, engine.go, and main.go to trace the startup failures; done means permission and single-instance/configuration errors are reported to the user instead of only appearing in logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.