简体   繁体   English

AWS LAMBDA,节点,ADM-ZIP:在系统调用参数错误的地址

[英]AWS Lambda, node, adm-zip: bad address in system call argument

Can create and read /tmp/temp.zip with AWS Lambda but this line causes an error: 可以使用AWS Lambda创建和读取/tmp/temp.zip,但此行会导致错误:

var zip = new AdmZip("/tmp/temp.zip"); // https://www.npmjs.com/package/adm-zip

What does the error mean? 错误是什么意思?

2018-08-08T13:23:41.074Z    2c1d866d-9b0e-11e8-8f32-8b0d6b822525    Error: EFAULT: bad address in system call argument, read
    at Object.fs.readSync (fs.js:675:18)
    at tryReadSync (fs.js:540:20)
    at Object.fs.readFileSync (fs.js:575:19)
    at new module.exports (/var/task/node_modules/adm-zip/zipFile.js:17:17)
    at new module.exports (/var/task/node_modules/adm-zip/adm-zip.js:20:11)
    at PassThrough.readStream.on (/var/task/index.js:28:19)
    at emitNone (events.js:111:20)
    at PassThrough.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
END RequestId: 2c1d866d-9b0e-11e8-8f32-8b0d6b822525
REPORT RequestId: 2c1d866d-9b0e-11e8-8f32-8b0d6b822525  Duration: 39773.72 ms   Billed Duration: 39800 ms   Memory Size: 128 MB Max Memory Used: 128 MB 
RequestId: 2c1d866d-9b0e-11e8-8f32-8b0d6b822525 Process exited before completing request

The clue: 线索:

Memory Size: 128 MB Max Memory Used: 128 MB

So the lambda was running out of memory. 因此,lambda的内存不足。 Giving it 1024 MB solved the problem. 提供1024 MB可解决此问题。

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

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