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

pidfd_open(2) system call is not supported #5803

Closed
garder500 opened this issue Sep 20, 2023 · 16 comments · Fixed by #6724
Closed

pidfd_open(2) system call is not supported #5803

garder500 opened this issue Sep 20, 2023 · 16 comments · Fixed by #6724
Labels
bug Something isn't working node.js Compatibility with Node.js APIs

Comments

@garder500
Copy link

garder500 commented Sep 20, 2023

What version of Bun is running?

1.0.2

What platform is your computer?

Linux 4.4.0-19041-Microsoft x86_64 unknown

What steps can reproduce the bug?

bun create next-app

What is the expected behavior?

The project is succefuly created

What do you see instead?

Aborting installation.

Unexpected error. Please report it as a bug:
 610 |   }
611 |   get stdio() {
612 |     return this.#stdioObject ??= this.#createStdioObject();
613 |   }
614 | 
615 |   spawn(options) {
                 ^
error: "pidfd_open(2)" system call is not supported by your Linux kernel
To fix this error, either:
- Upgrade your Linux kernel to a newer version (current: 4.4.0-wn frame descri)
- Ensure the seccomp filter allows "pidfd_open"
      at spawn (node:child_process:615:14)
      at node:child_process:2:40
      at spawn (/tmp/create-next-app@latest--bunx/node_modules/create-next-app/dist/index.js:8:83666)
      at /tmp/create-next-app@latest--bunx/node_modules/create-next-app/dist/index.js:74:33775
      at new Promise (:1:20)
      at install (/tmp/create-next-app@latest--bunx/node_modules/create-next-app/dist/index.js:74:33158)
      at /tmp/create-next-app@latest--bunx/node_modules/create-next-app/dist/index.js:74:38669
      at processTicksAndRejections (:55:76)

Additional information

Version WSL : 1.2.5.0
Version du noyau : 5.15.90.1
Version WSLg : 1.0.51
Version MSRDC : 1.2.3770
Version direct3D : 1.608.2-61064218
Version de DXCore : 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Version de Windows : 10.0.19045.3448

@garder500 garder500 added the bug Something isn't working label Sep 20, 2023
@Electroid Electroid changed the title NextJS installation fail pidfd_open(2) system call is not supported Sep 20, 2023
@Electroid Electroid added the node.js Compatibility with Node.js APIs label Sep 20, 2023
@Electroid
Copy link
Contributor

As the error suggests, you'll want to see if you can upgrade your Linux Kernel. Since you're using WSL, you can run: wsl --update

@niudai
Copy link

niudai commented Sep 21, 2023

running into the same error when I'm using debian 10

@arno-fukuda
Copy link

arno-fukuda commented Sep 21, 2023

Same here with Debian 10.
Using Google Cloud Compute Engine and can't upgrade beyond 4.19

edit: Ended up having to change to a different image with Debian 12.

@garder500
Copy link
Author

As the error suggests, you'll want to see if you can upgrade your Linux Kernel. Since you're using WSL, you can run: wsl --update

Already tried it, but didn't work :( (The update itself don't work)

@garder500 garder500 reopened this Sep 21, 2023
@mvgiacomello
Copy link

Same error using the latest oven/bun docker image with --platform linux/amd64.

@FlyingTurkman
Copy link

As the error suggests, you'll want to see if you can upgrade your Linux Kernel. Since you're using WSL, you can run: wsl --update

Not worked

@FujiwaraChoki
Copy link

+1, any updates?

@royal
Copy link

royal commented Oct 2, 2023

pidfd_open isn't supported by gVisor - the container sandbox used in GCP for all container-based products.

linux/arm64 - https://gvisor.dev/docs/user_guide/compatibility/linux/arm64/#pidfd_open
linux/amd64 - https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/#pidfd_open

This means bun cannot be used as a runtime in GCP products including:

  • Cloud Functions
  • Cloud Run
  • App Engine
  • Google Kubernetes Engine
  • Cloud ML Engine

This also affects any 3rd party clouds that use GCP infrastructure (I believe Vercel is one, I imagine there's a few).

Please remove this kernel call or provide an alternate path when it's not available.

EDIT: some details to reproduce, the call is triggered somewhere inside the GCP authentication library. So you can use bun, until you try and authenticate to use any other GCP service (such as pubsub, firestore, cloud tasks, anything). They all use the same underlying auth library. If you were to try Google's PubSub sample inside cloud run using bun/docker it should fail. I'm sure there are other code paths that trigger this system call but this is the one we're hitting.

@gdevenyi
Copy link

This function was added in version 5.3 of the Linux kernel and doesn't appear to have been backported. Either bun needs to add a check/workaround for older versions, or you are forced to upgrade.

@jeloi
Copy link

jeloi commented Oct 11, 2023

I am encountering this while using google-auth-library package as well.

@programeoww
Copy link

Linux kernel must be >= 5.13, you are using 4.4

@royal
Copy link

royal commented Oct 12, 2023

Linux kernel must be >= 5.13, you are using 4.4

As explained here, users of GCP container-based environments have no control over the linux kernel version.

This works fine when using node as a runtime. It's a bug in bun.

@Electroid
Copy link
Contributor

To be clear, we will fix this so Bun works properly in GCP environments.

@rizrmd
Copy link

rizrmd commented Oct 16, 2023

I am also experiencing this error using official oven/bun:debian docker image.

@magnussp
Copy link

I encounter the same error when using puppeteer together with the latest oven/bun:slim image.

@Jarred-Sumner
Copy link
Collaborator

I have implemented a workaround in #6724.

When the next version of Bun is released please run bun upgrade. In the meantime, if you wait a few hours, bun upgrade --canary should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node.js Compatibility with Node.js APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.