keybase / keybase/keybase-issues

Keybase update breaks if not root

Open
#779 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
899
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Ok so I know I should run `keybase update` as **root**. However, today, I forgot to do that and ran it as my own user. Keybase broke itself in this process.
cedwardsmedia@Thunderbird:~ 03:45 PM > keybase update

``` bash
info: Attempting software upgrade.....
info: Made temporary directory: /var/folders/wk/fvft4cnj099cn083w2tydsdr0000gx/T/keybase_install_IhDBWl5MVnD5Khflc9zucQ
info: Using keyset version v1
info: Fetching URL https://dist.keybase.io/sig/files/1/index.asc
info: Fetching URL https://dist.keybase.io/pkg/stable
info: Fetching URL https://dist.keybase.io/sig/files/1/keybase-0.4.7.tgz.asc
info: verified signature of keybase-0.4.7.tgz against keybase-0.4.7.tgz.asc
info: Running npm install keybase-0.4.7.tgz: this may take a minute, please be patient
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/keybase'
npm ERR! error rolling back keybase@0.4.7 { [Error: EACCES, unlink '/usr/local/lib/node_modules/keybase']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/keybase' }
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/keybase'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/keybase']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/keybase' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "/var/folders/wk/fvft4cnj099cn083w2tydsdr0000gx/T/keybase_install_IhDBWl5MVnD5Khflc9zucQ/keybase-0.4.7.tgz"
npm ERR! cwd /Users/cedwardsmedia
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /usr/local/lib/node_modules/keybase
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/keybase'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/cedwardsmedia/npm-debug.log
npm ERR! not ok code 0
info: cleaning up tmpdir /var/folders/wk/fvft4cnj099cn083w2tydsdr0000gx/T/keybase_install_IhDBWl5MVnD5Khflc9zucQ
error: exit code 3
error: exit code 254
cedwardsmedia@Thunderbird:~ 03:45 PM > sudo keybase update
Password:
sudo: keybase: command not found
cedwardsmedia@Thunderbird:~ 03:46 PM > whereis keybase
cedwardsmedia@Thunderbird:~ 03:46 PM > keybase update
-bash: /usr/local/bin/keybase: No such file or directory
```

I ultimately had to run keybase from the full path `/usr/local/lib/node_modules/keybase/bin/main.js`. Once I did this, it updated and recreated the symlink(s). While this is a minor bug, it's one that would likely deter most folks from using Keybase on a large scale.
##### Note

I have little experience with Node.js and `npm` so this may be an issue caused by npm rather than Keybase. Either way, I think Keybase devs should be aware of this issue.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failed `keybase update` as a non-root user using the reported npm and Node.js environment, then inspect the update entry point reached through `/usr/local/lib/node_modules/keybase/bin/main.js`. Compare the broken `/usr/local/bin/keybase` state with the successful full-path update and verify that the command remains available after an unprivileged attempt.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.