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

Error: write EPIPE after upgrade to vr 9 #1526

Closed
kvnam opened this issue Aug 4, 2022 · 2 comments · Fixed by #1527
Closed

Error: write EPIPE after upgrade to vr 9 #1526

kvnam opened this issue Aug 4, 2022 · 2 comments · Fixed by #1527
Labels

Comments

@kvnam
Copy link

kvnam commented Aug 4, 2022

Hey,

I upgraded serverless-offline to 9.1.4 from 8.3.1 and am unable to run my Serverless app, which is a Graphql Express/Node backend. Any request to it crashes immediately with this error.

The error

Error: write EPIPE
    at ChildProcess.target._send (node:internal/child_process:866:20)
    at ChildProcess.target.send (node:internal/child_process:739:19)
    at ChildProcessRunner.run (file:///<my_path>/node_modules/serverless-offline/src/lambda/handler-runner/child-process-runner/ChildProcessRunner.js:57:18)
    at HandlerRunner.run (file:///<my_path>/node_modules/serverless-offline/src/lambda/handler-runner/HandlerRunner.js:134:25)
    at async LambdaFunction.runHandler (file:///<my_path>/node_modules/serverless-offline/src/lambda/LambdaFunction.js:289:20)
    at async file:///<my_path>/node_modules/serverless-offline/src/events/http/HttpServer.js:556:18
    at async exports.Manager.execute (<my_path>/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
    at async Object.internals.handler (<my_path>/node_modules/@hapi/hapi/lib/handler.js:46:20)
    at async exports.execute (<my_path>/node_modules/@hapi/hapi/lib/handler.js:31:20)
    at async Request._lifecycle (<my_path>/node_modules/@hapi/hapi/lib/request.js:371:32)
    at async Request._execute (<my_path>/node_modules/@hapi/hapi/lib/request.js:281:9)

Environment: darwin, node 16.16.0, framework 3.21.0 (local), plugin 6.2.2, SDK 4.3.2

Serverless is at "^3.20.0"

When I downgrade to 8.8.1, it works fine. I have read the release notes, and my serverless and node are both the required versions. I know a change was made with regards to worker threads, but I'm unsure of what I need to do here about that. Any pointers on how to resolve this would be great. Thanks!

@dnalborczyk
Copy link
Collaborator

dnalborczyk commented Aug 4, 2022

thank you for the report @kvnam .

just checked the code, I introduced a bug in v9.1.1, v9.1.0 should still work for you.

it seems that you are using child processes, with the flag --useChildProcesses (or as an option in your serverless.yml). if you are unsure why you are using that flag I would suggest to remove it and give worker threads (the default now) a try. if you want auto-reload of the handlers for development you can use the flag --reloadHandler, which reloads handlers on each request automatically.

Regardless, I should have a fix for the child process problem ready soon.

@kvnam
Copy link
Author

kvnam commented Aug 4, 2022

Thanks @dnalborczyk! You are right I did have useChildProcesses set in the serverless.yml, missed it completely. I'll switch to 9.1.5 with your fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants