Open k0d3r1s opened 1 year ago
Happens to me as well, please let me know if there's any solution
I'm also struggling getting this to work in a Docker environment. I've created a reproducible environment:
https://github.com/FranklinWaller/bunjs-accesserror
This is using VSCode's devcontainers + Docker to work.
Also encountering this issue with yarn as well.
[1.52ms] ".env"
2023-09-10 18:08:18 bun install v1.0.0 (822a00c4)
2023-09-10 18:08:19 Saved yarn.lock
2023-09-10 18:08:19
2023-09-10 18:08:19 error: AccessDenied
I had the same issue, I could solve it by telling bun to skip the lockfile: bun install --no-save
I ran into this as well. Oddly enough, the bun.lockb
is created - not sure if it's failing to create a package-lock.json, or if the error is erroneous?
I simply have
Dockerfile
FROM oven/bun:1.0
WORKDIR /usr/src/app
ENTRYPOINT [ "bun" ]
CMD [ "help" ]
compose.yml
services:
bun: &bun
tty: true
stdin_open: true
build:
context: .
entrypoint: bun
command: help
volumes:
- .:/usr/src/app:delegated
- node_modules:/node_modules:cached
volumes:
node_modules: {}
and I'm running
$ docker compose run --rm bun install
bun install v1.0.6 (969da088)
🔒 Saving lockfile... error: failed to save lockfile: AccessDenied
--no-save
seems unsatisfactory... I want the lockfile. gRPC FUSE
within Docker Desktop. Seems like a pretty big hammer for such a small nail.Any movement on figuring this out?
I think this is a dup of https://github.com/oven-sh/bun/issues/4923#issuecomment-1820040043?
What version of Bun is running?
0.8.0+9c68abdb8d51951f83b4b253cf5dd3922c2c58b5
What platform is your computer?
Linux 6.1.29-0-virt aarch64 unknown
What steps can reproduce the bug?
I have a basic project, with existing package.json and yarn and this happens on running
bun install
. It also happens when runningbun init
or any otherbun
command that interacts with lockfile.At first i was thinking that it might be something to do with fact I use volumes in docker but it still happen if i try to write lockfile to /tmp or any other non-volume directory
What is the expected behavior?
Lockfile is created with correct permissions and content is written to it
What do you see instead?
🔒 Saving lockfile... Saving 210 trees Saving 1330 hoisted_dependencies Saving 2308 resolutions Saving 2308 dependencies Saving 90 extern_strings Saving 94000 string_bytes error: failed to save lockfile: AccessDenied
$ ls -lah ---------- 1 root root 0 Aug 25 07:33 bun.lockb
Lockfile is created without any permissions and writing data to it or permission change obviously fails.
I'm not familiar with zig language but I think that issue is at code where you create lockfile and chmod it afterwards.
https://github.com/oven-sh/bun/blob/90f3bf2796b08f38297321c46366ed417b1ecb3b/src/install/lockfile.zig#L1476C5-L1480C7
Additional information
Using docker image
oven/bun:canary
but still happen withoven/bun:latest
as well.