Skip to content

Lambda runtimes from nodejs10.x onwards break PNG conversion  #24

@MRoci

Description

@MRoci

using as runtime node from version 10 (since nodejs8.10 cannot be used anymore) trying converting to PNG produces the following error:

{
    "errorType": "Error",
    "errorMessage": "write EPIPE",
    "code": "EPIPE",
    "errno": "EPIPE",
    "syscall": "write",
    "stack": [
        "Error: write EPIPE",
        "    at afterWriteDispatched (internal/stream_base_commons.js:156:25)",
        "    at writevGeneric (internal/stream_base_commons.js:139:3)",
        "    at Socket._writeGeneric (net.js:785:11)",
        "    at Socket._writev (net.js:794:8)",
        "    at doWrite (_stream_writable.js:401:12)",
        "    at clearBuffer (_stream_writable.js:519:5)",
        "    at Socket.Writable.uncork (_stream_writable.js:338:7)",
        "    at Socket.Writable.end (_stream_writable.js:590:10)",
        "    at Socket.end (net.js:591:31)",
        "    at writeBufferInChunks (/opt/nodejs/node_modules/svg2png/lib/svg2png.js:54:20)"
    ]
}

This seems to be a problem linked with PhantomJS (dependency of svg2png ), which can no longer be used directly in the Lambda environment as some system dependencies have been removed from the newer runtimes (eg. fontconfig)

In order to fix the problem an extra layer could be created to add the missing libs ( https://github.com/naeemshaikh27/phantom-lambda-fontconfig-pack ) or maybe the function body could be defined as container image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions