bun icon indicating copy to clipboard operation
bun copied to clipboard

Docker io_uring error

Open Olyno opened this issue 1 year ago • 6 comments

Version

0.1.4

Platform

Linux olyno-PC 5.10.101-amd64-desktop #20.00.05.06-release SMP Mon Mar 14 09:34:55 CST 2022 x86_64 GNU/Linux

What steps will reproduce the bug?

Here are my steps to reproduce the error:

docker pull jarredsumner/bun:edge
docker run -it --rm --init --ulimit memlock=-1:-1 jarredsumner/bun:edge
bun create next ./next-bun

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

Creating a NextJS project with Bun without error

What do you see instead?

Fetching package.json... error: Linux kernel version doesn't support io_uring, which Bun depends on. 

To fix this error: please upgrade to a newer Linux kernel.

If you're using Windows Subsystem for Linux, here's how: 
  1. Open PowerShell as an administrator
  2. Run this:
    wsl --update
    wsl --shutdown

If that doesn't work (and you're on a Windows machine), try this:
  1. Open Windows Update
  2. Download any updates to Windows Subsystem for Linux

If you're still having trouble, ask for help in bun's discord https://bun.sh/discord

Additional information

No response

Olyno avatar Jul 18 '22 22:07 Olyno

Same

7flash avatar Jul 19 '22 02:07 7flash

I get the same error

Very helpfull on it's own

System: Debian 10 Kernel: Linux 4.19.0-21-amd64 x86_64 Env: No wsl, docker service running, no containers running Bun path: $HOME/.bun/bin/bun

Reproduction:

❯ bun --verbose install
error: Linux kernel version doesn't support io_uring, which Bun depends on. 

To fix this error: please upgrade to a newer Linux kernel.

If you're using Windows Subsystem for Linux, here's how: 
  1. Open PowerShell as an administrator
  2. Run this:
    wsl --update
    wsl --shutdown

If that doesn't work (and you're on a Windows machine), try this:
  1. Open Windows Update
  2. Download any updates to Windows Subsystem for Linux

If you're still having trouble, ask for help in bun's discord https://bun.sh/discord

❯ which -a wsl
wsl not found

I can provide additional info if needed

shiftgeist avatar Jul 19 '22 11:07 shiftgeist

You must update kernel to latest version.

xHyroM avatar Jul 28 '22 04:07 xHyroM

Updating the kernel to the latest version can literally break the whole OS we're using. It's definitely not recommended.

Olyno avatar Jul 28 '22 15:07 Olyno

Io_uring requires kernel 5.1>

xHyroM avatar Jul 29 '22 13:07 xHyroM

I suggest adding a check in the install script

shiftgeist avatar Jul 29 '22 15:07 shiftgeist

Container images do not ship with the linux kernel. Containers share the kernel of the host OS. If the host of the container does not have io_uring support, such as any kernel <5.1 and kernels >5.1 with io_uring disabled, then io_uring won't be available in the container.

If your host OS does not have io_uring support, instead of using a container I recommend running a kernel-based virtual machine running an OS with io_uring support.

This is a serious problem with Bun, I don't think it can be solved easily. RHEL is one major distribution, particularly on servers, and it ships with io_uring disabled despite the kernel being >5.14 on version 9.

Coachonko avatar Aug 16 '22 13:08 Coachonko

So what should I do? How to run Bun on WSL2?

7flash avatar Aug 17 '22 01:08 7flash

Older releases of Bun used to depend more heavily on io_uring, like for bun install and fetch(). Not anymore, though we will still keep this open so we can implement nice fallbacks.

Electroid avatar Nov 02 '22 23:11 Electroid