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

running bun server in pm2 now crashes: ENXIO: No such device or address, SIGHUP #4327

Open
CodeFromAnywhere opened this issue Aug 25, 2023 · 6 comments
Labels
bug Something isn't working crash An issue that could cause a crash

Comments

@CodeFromAnywhere
Copy link

CodeFromAnywhere commented Aug 25, 2023

What version of Bun is running?

0.8.1

What platform is your computer?

Linux 5.15.0-79-generic x86_64 x86_64

What steps can reproduce the bug?

  • run a bun server via pm2 (like NODE_ENV=production pm2 start bun --name \"bun-server\" -- start)
  • bun run start, which is called here by pm2, would run this: NODE_ENV=production bun src/server.cli.ts ,which in turn would launch a server using Bun.serve

What is the expected behavior?

pm2 works

What do you see instead?

it crashes (see screenshot)
Screenshot 2023-08-25 at 15 12 27

Additional information

I don't know how to make it easy to reproduce, as this is my entire server. But maybe it also happens on a smaller server? Anyway, the server worked fine before on bun 0.7.3

@CodeFromAnywhere CodeFromAnywhere added the bug Something isn't working label Aug 25, 2023
@CodeFromAnywhere
Copy link
Author

CodeFromAnywhere commented Aug 25, 2023

Can confirm that it runs on 0.7.3 so it's a regression happening in 0.8.1

PS: also got some weird looking errors related to https://www.npmjs.com/package/@swc/core (binding errors) and also a (maybe unrelated) SIGSEGV error. As a temporary solution I have downgraded bun back to 0.7.3 in production, using curl -fsSL https://bun.sh/install | bash -s -- bun-v0.7.3.

@bnussman
Copy link

bnussman commented Aug 27, 2023

I am experiencing this when running my server with concurrently.

Edit: I actually was able to bypass this issue by running concurrently with bun by doing bun --bun concurrently

@CodeFromAnywhere
Copy link
Author

CodeFromAnywhere commented Aug 28, 2023

Not sure if 0.8.1 changed in the meantime (I've downgraded to 0.7.3 and upgraded again just now) but now I'm getting error: script "start" exited with code 11 (SIGSEGV) without changing anything.

The curious thing is:

  • when I run bun start without pm2, it runs without segfault
  • when pm2 uses bun to run the start script, it gets this segfault.
  • on macOS I have no trouble at all, only on linux

Conclusion: Still have no idea how to fix and thus I'm stuck at 0.7.3

@Jarred-Sumner
Copy link
Collaborator

We will fix this in Bun v0.8.2

In the meantime, make sure your linux distro has /dev/ mounted. On alpine, it might not be mounted by default

@jakebailey
Copy link

This is fixed by #4378, right?

@Electroid Electroid added the crash An issue that could cause a crash label Sep 4, 2023
@jdgriffith
Copy link

jdgriffith commented Sep 8, 2023

I'm still experiencing this issue on 1.0 and on a ubuntu box. Reverting to 7.3 gives me a stable runtime again though.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"

Screenshot 2023-09-08 at 11 30 52 AM
Screenshot 2023-09-08 at 11 31 40 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash An issue that could cause a crash
Projects
None yet
Development

No branches or pull requests

6 participants