Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MRoci opened this issue Oct 26, 2021 · 1 comment
Open

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

MRoci opened this issue Oct 26, 2021 · 1 comment
Labels

Comments

@MRoci
Copy link

MRoci commented Oct 26, 2021

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

@fquffio
Copy link
Contributor

fquffio commented Oct 26, 2021

Hi @MRoci,
thanks for reporting this issue.

I'll take a look as soon as possible. Rather than using layers, I'd probably opt to refactor this project to use containers in Lambda functions. Hopefully it's easier to maintain and doesn't require duplicate package.json: it wasn't possible when we first started this project, so we had to stick with Layers.

@fquffio fquffio added the bug label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants