aws-lambda-image icon indicating copy to clipboard operation
aws-lambda-image copied to clipboard

EPIPE write errors

Open gbernitz opened this issue 9 years ago • 10 comments

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)

gbernitz avatar May 14 '16 05:05 gbernitz

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.

leonfancy avatar May 16 '16 01:05 leonfancy

I had problem on dependency library, and updated to 0.8.0. Please update package or re-install this, try it.

ysugimoto avatar May 16 '16 09:05 ysugimoto

@slimfancy thank you for posting your project! I was having issues with larger files and yours works great!

michaelstephens avatar Jun 07 '16 23:06 michaelstephens

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)

DerkBusser avatar Jul 20 '16 10:07 DerkBusser

@slimfancy could you look at this error?

DerkBusser avatar Jul 25 '16 20:07 DerkBusser

@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.

leonfancy avatar Jul 26 '16 09:07 leonfancy

@DerkBusser did you find a solution? I'm hitting the same error...

guyellis avatar Sep 09 '16 20:09 guyellis

@guyellis i am using the new package https://github.com/slimfancy/image-lambda now, works like a charm

DerkBusser avatar Sep 12 '16 07:09 DerkBusser

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"
    }
  ]
}

maennchen avatar Sep 27 '16 10:09 maennchen

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:

  1. resizes utilizes reduce code, so how can it happen only to reduce?
  2. 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!
  3. The processing works perfectly, I can access the buffer from the putObject function, print it out etc. The client.putObject is 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.

odedniv avatar Nov 07 '16 07:11 odedniv