aws-lambda-image
aws-lambda-image copied to clipboard
EPIPE write errors
Keep getting an EPIPE error, my files are pretty large, approx 2-3MB:
2016-05-14T05:17:33.860Z 23ca5c10-1993-11e6-96f0-4980e923c2ed Error: write EPIPE at Object.exports._errnoException (util.js:870:11) at exports._exceptionWithHostPort (util.js:893:20) at WriteWrap.afterWrite (net.js:763:14)
I have run into this problem, it looks like caused by passing image data to pngout command line for processing. I created my own project: https://github.com/slimfancy/slim-lambda, and it works well with large image file.
I had problem on dependency library, and updated to 0.8.0.
Please update package or re-install this, try it.
@slimfancy thank you for posting your project! I was having issues with larger files and yours works great!
i get this error now: 2016-07-20T10:22:09.871Z cb95592b-4e63-11e6-be1d-41b508d59600 Error: read ECONNRESET at exports._errnoException (util.js:870:11) at Pipe.onread (net.js:544:26)
@slimfancy could you look at this error?
@DerkBusser sorry, I'm not use this package any more. I wrote a new one based on this package. https://github.com/slimfancy/image-lambda.
@DerkBusser did you find a solution? I'm hitting the same error...
@guyellis i am using the new package https://github.com/slimfancy/image-lambda now, works like a charm
I got it working by updating to the newest version of this library, but only for jpg though. If I try to resize PNG & GIF, i get this error:
START RequestId: 5cdd24b6-849c-11e6-8bd9-eff650449893 Version: $LATEST
2016-09-27T10:24:16.888Z 5cdd24b6-849c-11e6-8bd9-eff650449893 Error: read ECONNRESET
at exports._errnoException (util.js:870:11)
at Pipe.onread (net.js:544:26)
END RequestId: 5cdd24b6-849c-11e6-8bd9-eff650449893
REPORT RequestId: 5cdd24b6-849c-11e6-8bd9-eff650449893 Duration: 8566.56 ms Billed Duration: 8600 ms Memory Size: 1536 MB Max Memory Used: 423 MB
Process exited before completing request
Config:
{
"bucket": "something",
"region": "eu-west-1",
"topic_arn": "hdfajlhgdahgl", # Config for custom index.js stuff
"resizes": [
{
"size": 414,
"directory": "resized/normal_detail_mobile",
"format": "jpg",
"background": "white"
},
{
"size": 828,
"directory": "resized/retina_detail_mobile",
"format": "jpg",
"background": "white"
},
{
"size": 945,
"directory": "resized/normal_detail_desktop",
"format": "jpg",
"background": "white"
},
{
"size": 1890,
"directory": "resized/retina_detail_desktop",
"format": "jpg",
"background": "white"
},
{
"size": "138x138^",
"gravity": "Center",
"crop": "138x138",
"directory": "resized/normal_list_mobile",
"format": "jpg",
"background": "white"
},
{
"size": "188x188^",
"gravity": "Center",
"crop": "188x188",
"directory": "resized/normal_list_desktop",
"format": "jpg",
"background": "white"
},
{
"size": "276x276^",
"gravity": "Center",
"crop": "276x276",
"directory": "resized/retina_list_mobile",
"format": "jpg",
"background": "white"
},
{
"size": "376x376^",
"gravity": "Center",
"crop": "376x376",
"directory": "resized/retina_list_desktop",
"format": "jpg",
"background": "white"
}
]
}
I've been struggling a full day with the ECONNRESET error. I narrowed it down to the reduce section, without it the error never appears. 3 weird points:
resizesutilizesreducecode, so how can it happen only toreduce?- It happens more on some images and less on others (even if larger ones). On the ones it happens more, it doesn't happen 100% of the time!
- The processing works perfectly, I can access the buffer from the
putObjectfunction, print it out etc. Theclient.putObjectis the one to throw the error. Why does it care where the buffer came from??
After 24 hours, I have reached a temporary solution: Instead of using the reduce section, add another resize section with "size": "10000x10000>^" (> means to not make the image larger than it is, ^ means to not go lower than 10000 on either width/height while keeping ratio).
PS. I have added a few pull requests for things I did while debugging, such as add more logs, process files one at a time (instead of parallel).
2nd PS. maybe this issue split up (@DerkBusser) and confused me, and the right place to post this was the title unfriendly #13.