buchgr / bazel-remote

A remote cache for Bazel
https://bazel.build
Apache License 2.0
576 stars 150 forks source link

mkdir /data/cas.v2: permission denied #750

Closed pward123 closed 2 months ago

pward123 commented 2 months ago
parallels@ubuntu-linux-22-04-02-desktop:~$ stat /data/cache
  File: /data/cache
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 802h/2050d  Inode: 131074      Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/parallels)   Gid: ( 1000/parallels)
Access: 2024-05-23 06:07:53.212219406 -0500
Modify: 2024-05-23 06:07:53.212219406 -0500
Change: 2024-05-23 06:08:00.788382188 -0500
 Birth: 2024-05-23 06:07:53.212219406 -0500

parallels@ubuntu-linux-22-04-02-desktop:~$ docker run -u 1000:1000 -v /data/cache:/data -p 9090:8080 -p 9092:9092 buchgr/bazel-remote-cache --max_size 5
2024/05/23 11:08:29 bazel-remote built with go1.22.0 X:nocoverageredesign from git commit 54d1782d72b291937988edad32c9752abe269d8e.
2024/05/23 11:08:29 Initial RLIMIT_NOFILE cur: 524288 max: 524288
2024/05/23 11:08:29 Setting RLIMIT_NOFILE cur: 524288 max: 524288
2024/05/23 11:08:29 Storage mode: zstd
2024/05/23 11:08:29 Zstandard implementation: go
2024/05/23 11:08:29 Limiting concurrent file removals to 5000
2024/05/23 11:08:29 mkdir /data/cas.v2: permission denied

parallels@ubuntu-linux-22-04-02-desktop:~$ sudo chown 65532:65532 /data/cache
parallels@ubuntu-linux-22-04-02-desktop:~$ docker run -v /data/cache:/data -p 9090:8080 -p 9092:9092 buchgr/bazel-remote-cache --max_size 5
2024/05/23 11:08:55 bazel-remote built with go1.22.0 X:nocoverageredesign from git commit 54d1782d72b291937988edad32c9752abe269d8e.
2024/05/23 11:08:55 Initial RLIMIT_NOFILE cur: 524288 max: 524288
2024/05/23 11:08:55 Setting RLIMIT_NOFILE cur: 524288 max: 524288
2024/05/23 11:08:55 Storage mode: zstd
2024/05/23 11:08:55 Zstandard implementation: go
2024/05/23 11:08:55 Limiting concurrent file removals to 5000
2024/05/23 11:08:55 mkdir /data/cas.v2: permission denied

parallels@ubuntu-linux-22-04-02-desktop:~$ docker version
Client:
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.8
 Git commit:        ced0996
 Built:             Sat Oct  7 00:27:16 2023
 OS/Arch:           linux/arm64
 Context:           default

Server:
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.8
  Git commit:       a61e2b4
  Built:            Sat Oct  7 00:29:03 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
pward123 commented 2 months ago

I've also tried chowning /data/cache to 777 per the comment in https://github.com/buchgr/bazel-remote/issues/547#issuecomment-1385050526 with the same permission denied error.

I've also tried pre-creating the /data/cache/cas.v2 directory with the same permission denied error

pward123 commented 2 months ago

The failures occur in an ubuntu 22.04.2 parallels virtual machine running on an m2 max macbook pro.

I am able to run the docker image on an intel nuc running 22.04.4

pward123 commented 2 months ago

Closing this as I'm just going to run my test on one of the machines at the office. If you'd like me to perform troubleshooting steps to address this in a vm, let me know.

mostynb commented 2 months ago

Thanks for the report, and the followup. Was this an arm64 ubuntu VM?

Note that you can run bazel-remote natively on mac, it's a single file statically linked go binary.

pward123 commented 2 months ago

Yes, arm64 ubuntu. For development we use macs, but our build servers run ubuntu.