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

write EPIPE error

Open kd-biztrology opened this issue 5 years ago • 5 comments

{ "errorType": "Error", "errorMessage": "write EPIPE", "trace": [ "Error: write EPIPE", " at WriteWrap.afterWrite [as oncomplete] (net.js:789:14)" ] }

my image is 12M have this error,

kd-biztrology avatar Jan 08 '20 06:01 kd-biztrology

I would recommend doing a full install with the new 10.x runtime and dedicated layer.

Had a number of issues with this today, and a full reinstall got it working for me.

schmoove avatar Apr 30 '20 03:04 schmoove

I installed from scratch and the latest and I'm getting this error for pngs and jpgs with this config, images are around 400KB. gifs work fine:

{
    "bucket": "mybucket",
    "backup": {
        "directory": "./original"
    },
    "keepExtension": true,
    "reduce": {
        "directory": "./reduced",
        "quality": 70,
        "acl": "public-read"
    },
    "optimizers": {
        "pngquant": ["--speed=1", "--quality=60-90"],
        "mozjpeg": ["-optimize", "-progressive", "-quality 70"],
        "gifsicle": ["-O3"]
    }
}

glassdimlygr avatar Aug 03 '20 16:08 glassdimlygr

My issue here was the following line: "mozjpeg": ["-optimize", "-progressive", "-quality 70"], Specifically, "-quality 70". Likewise, "-quality=70" didn't work. This worked: "mozjpeg": ["-optimize", "-progressive"],

This seems a little odd to me seeing as I can test on my cli like so:

/usr/local/Cellar/mozjpeg/3.3.1_1/bin/cjpeg -optimize -progressive -quality 70  ./gorilla.jpg > gorilla-opt.jpg

But I guess quality is being set above in the reduce stanza, so perhaps that's why.

glassdimlygr avatar Aug 03 '20 17:08 glassdimlygr

I'm seeing the same symptom. Using tagged v1.1(aws-lambda-image-with-dedicated-layer), replicable with any jpeg (4mb largest file). Occurs whenever a reduce config is provided. It feels like the binaries are not installed to reduce? When the reduce config is removed resizes work as expected

  "reduce": { 
    "directory": "downloads/",
    "suffix": "_sixty_percent",
    "quality":90
  },

I've experimented with different optimizer options (as recommended here) without a positive effect

  "optimizers": {
    "mozjpeg": ["-optimize", "-progressive"]
  },
  "jpegOptimizer": "jpegoptim",
  "optimizers": {
      "jpegoptim": ["--all-progressive"]
  },

jshow avatar Jan 19 '21 16:01 jshow

I was able to solve short-term with the following config - changing the reduce into a resizes

"resizes": [
    {
      "directory": "downloads/",
      "suffix": "_sixty_percent",
      "size": "100%",
      "quality": 60
    },

jshow avatar Jan 19 '21 19:01 jshow