keybase / keybase/keybase-issues

Stale keybase decrypt process causes command line decrypt to fail cryptically

Open
#1,589 0 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

Somehow I unknowingly acquired a stale decrypt process on my machine.
Subsequent decrypts failed with a cryptic message, for example:

``` bash
db:~ dbrown$ keybase encrypt dbro -m "Hello, Dave. " >hello.txt.asc
db:~ dbrown$ cat hello.txt.asc | keybase decrypt
events.js:85
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1129:14)
at listen (net.js:1155:10)
at net.js:1253:9
at dns.js:85:18
at process._tickCallback (node.js:355:11)
db:~ dbrown$
```

Finding and killing the process made it work.

``` bash
db:~ dbrown$ ps -a |grep keybase
71119 ttys001 0:01.03 node /usr/local/bin/keybase decrypt
71436 ttys001 0:00.00 grep keybase
db:~ dbrown$ kill -9 71119
db:~ dbrown$ [1]+ Killed: 9 keybase decrypt (wd: ~/Downloads)
(wd now: ~)
db:~ dbrown$ ps -a |grep keybase
71443 ttys001 0:00.00 grep keybase
db:~ dbrown$ cat hello.txt.asc | keybase decrypt

You need a passphrase to unlock the secret key for
user: "keybase.io/dbro "
4096-bit RSA key, ID 11F05E36DA978A5B, created 2015-05-26
(subkey on main key ID 1F9E34CB748F58AC)

Hello, Dave. db:~ dbrown$
```

I am not sure how I got the stale process in the first place. I know at some point I tried a `keybase decrypt` with no options, pasted the pgp text, and then ctrl-c'd because I missed the passphrase popup elsewhere on my display and thought it was locked up. If I can reproduce that situation I'll post it as a separate issue, this one is more about the cryptic message caused by the stale process.

Platform details:

``` bash
db:~ dbrown$ uname -a
Darwin db.brown.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
db:~ dbrown$ gpg --version
gpg (GnuPG/MacGPG2) 2.0.27
libgcrypt 1.6.3
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA, RSA, ELG, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the stale-process scenario through the `keybase decrypt` command, including cancelling an interactive decrypt, and inspect the resulting error path. Done means a stale decrypt process no longer makes a subsequent command fail with only the Node.js `EADDRINUSE` stack trace, while the normal decrypt flow remains usable.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.