Jesus is Lord
Jesus is Lord

Reputation: 15399

AWS CLI S3 sync and cp are both error-ing with "Error: spawnSync /bin/sh ENOBUFS"

I've tried the following commands:

aws s3 cp ./api s3://[my-bucket-name] --recursive

And

aws s3 sync ./api s3://[my-bucket-name]

They both error out.

Here's the message:

Error: spawnSync /bin/sh ENOBUFS
  at Object.spawnSync (internal/child_process.js:1041:20)
  at spawnSync (child_process.js:616:24)
  at execSync (child_process.js:661:15)
  ... {
errno: 'ENOBUFS',
code: 'ENOBUFS',
syscall: 'spawnSync /bin/sh',
path: '/bin/sh',
spawnargs: [ '-c', 'aws s3 cp ./api s3://bible-api --recursive' ],
error: [Circular],
status: null,
signal: 'SIGTERM',
output: [
  null,
  <Buffer 43 6f 6d 70 6c 65 74 65 64 20 31 35 33 20 42 79 74 65 73 2f 7e 34 38 2e 38 20 4b 69 42 20 28 35 32 33 20 42 79 74 65 73 2f 73 29 20 77 69 74 68 20 7e ... 1048704 more bytes>,
  <Buffer >
],
pid: 86961,
stdout: <Buffer 43 6f 6d 70 6c 65 74 65 64 20 31 35 33 20 42 79 74 65 73 2f 7e 34 38 2e 38 20 4b 69 42 20 28 35 32 33 20 42 79 74 65 73 2f 73 29 20 77 69 74 68 20 7e ... 1048704 more bytes>,
stderr: <Buffer >
}

I have a lot of files I'm trying to sync. ~32k files in 122 MB.

Upvotes: 0

Views: 373

Answers (1)

Jesus is Lord
Jesus is Lord

Reputation: 15399

This doesn't answer the question directly. As a workaround, I'm syncing each part:

const u = require('wlj-utilities');

const books = require('...list.json');
books.forEach(book => {
    const p = `/prefix/${book}`;
    const command = `aws s3 sync ./api${p} s3://[my-bucket-name]${p}`;
    const output = u.executeCommand(command);
    console.log(output);
});

Upvotes: 1

Related Questions