keybase / keybase/keybase-issues

SlowBuffer RangeError when piping tar to KeyBase

Open
#1,050 3 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

keybase fails when attempting to create a large (1.5GB) tar archive and piping it to keybase encrypt.

Stack trace below:

```
╰─➤ tar -cf - large_directory | keybase encrypt nolan > large_directory.tar.asc

buffer.js:194
this.parent = new SlowBuffer(this.length);
^
RangeError: length > kMaxLength
at new Buffer (buffer.js:194:21)
at Function.Buffer.concat (buffer.js:495:16)
at BufferOutStream.exports.BufferOutStream.BufferOutStream.data (/usr/local/lib/node_modules/keybase/node_modules/iced-spawn/lib/stream.js:102:21)
at /usr/local/lib/node_modules/keybase/node_modules/iced-spawn/lib/cmd.js:484:32
at Deferrals.exports.Deferrals.Deferrals._call (/usr/local/lib/node_modules/keybase/node_modules/iced-runtime/lib/runtime.js:86:16)
at /usr/local/lib/node_modules/keybase/node_modules/iced-runtime/lib/runtime.js:98:26
at exports.trampoline.trampoline (/usr/local/lib/node_modules/keybase/node_modules/iced-runtime/lib/runtime.js:64:14)
at Deferrals.exports.Deferrals.Deferrals._fulfill (/usr/local/lib/node_modules/keybase/node_modules/iced-runtime/lib/runtime.js:96:16)
at ret (/usr/local/lib/node_modules/keybase/node_modules/iced-runtime/lib/runtime.js:29:18)
at SpawnEngine.BaseEngine._maybe_call_callback (/usr/local/lib/node_modules/keybase/node_modules/iced-spawn/lib/cmd.js:57:16)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with node_modules/keybase/node_modules/iced-spawn/lib/stream.js at BufferOutStream.data and the Buffer.concat call shown in the stack trace. Reproduce the tar-to-keybase command with a large archive, then determine a change that avoids the RangeError and verify that large streamed input can be encrypted successfully.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.