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

SystemResources error when running with Docker #4785

Closed
neuralstring opened this issue Sep 10, 2023 · 5 comments
Closed

SystemResources error when running with Docker #4785

neuralstring opened this issue Sep 10, 2023 · 5 comments
Labels
bug Something isn't working docker An issue that occurs when running in Docker

Comments

@neuralstring
Copy link

What version of Bun is running?

1.0.0

What platform is your computer?

Linux 6.4.11 x86_64 | Docker version 24.0.5, build ced0996600

What steps can reproduce the bug?

Runing bunx with docker (via command provided in bun docs) will result SystemResources error after ~10sec

$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun bunx cowsay "Hello world!"

error: SystemResources

----- bun meta -----
Bun v1.0.0 (822a00c4) Linux x64 #1 SMP PREEMPT_DYNAMIC Sat, 19 Aug 2023 15:38:34 +0000
BunxCommand: 
Elapsed: 8ms | User: 0ms | Sys: 9ms
RSS: 33.55MB | Peak: 13.63MB | Commit: 33.55MB | Faults: 0
----- bun meta -----

0   0x563194e8d72b
1   ???
2   ???
3   ???
4   ???
5   ???

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@neuralstring neuralstring added the bug Something isn't working label Sep 10, 2023
@jlexposito
Copy link

I'm also getting the same error

@Gautam--Roy
Copy link

Getting the same error inside a docker container. Tried with a --ulimit memlock=819200000:819200000 flag in the docker run command, didn't work.

@Electroid Electroid changed the title Bunx SystemResources error when running with Docker SystemResources error when running with Docker Sep 13, 2023
@Electroid Electroid added the docker An issue that occurs when running in Docker label Sep 16, 2023
@Achalogy
Copy link

Same here, bun 1.0.3

@zoidyzoidzoid
Copy link

I think it has something to do with the global bun cache used by bunx.

❯ docker run --rm -it --init --ulimit memlock=-1:-1 oven/bun bash -c "bunx cowsay 'Hello World!'"

error: SystemResources

----- bun meta -----
Bun v1.0.3 (25e69c71) Linux arm64 #1 SMP PREEMPT Thu Sep  7 07:48:47 UTC 2023
BunxCommand:
Elapsed: 4ms | User: 2ms | Sys: 2ms
RSS: 33.55MB | Peak: 12.45MB | Commit: 33.55MB | Faults: 0
----- bun meta -----

0   0xaaaae3126698
1   ???
2   ???
3   ???
4   ???
5   ???

Crash report saved to:
  ~/.bun-crash/v1.0.3-1695644830244.crash

Search GitHub issues https://bun.sh/issues or ask for #help in https://bun.sh/discord

If you instead use bun add and add the dependency to your own project's dependencies, e.g. serve or cowsay, then it works! 🎉

❯ docker run --rm -it --init --ulimit memlock=-1:-1 oven/bun bash -c "bun add cowsay && bunx cowsay 'Hello World!'"
bun add v1.0.3 (25e69c71)

 installed cowsay@1.5.0 with binaries:
  - cowsay
  - cowthink


 33 packages installed [1249.00ms]
 ______________
< Hello World! >
 --------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

@Electroid
Copy link
Contributor

This has been fixed as of Bun v1.0.26. If you're still experiencing this issue, let us know and we'll re-open it.

❯ docker run --rm --init --ulimit memlock=-1:-1 oven/bun bunx cowsay "Hello world!"
 Resolving dependencies
 Resolved, downloaded and extracted [124]
 Saved lockfile
 ______________
< Hello world! >
 --------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker An issue that occurs when running in Docker
Projects
None yet
Development

No branches or pull requests

6 participants