简体   繁体   English

AWS CLI S3 同步和 cp 都出现“错误:spawnSync /bin/sh ENOBUFS”

[英]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. 122 MB 中的约 32k 个文件。

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);
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM