Bazel permanently tries to access /root/.cache after container run as root #25946
Replies: 2 comments
-
Make sure to clean out any Bazel convenience symlinks |
Beta Was this translation helpful? Give feedback.
0 replies
-
I realized that only this Bazel project had the issue; other Bazel projects were fine. Eventually, I found that a symlink in the project folder was causing the problem:
Thanks, @benjaminp! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running into a really weird Bazel issue and I'm starting to feel stuck.
Some time ago I accidentally ran Bazel inside a container as root. Ever since then, even on my host system, Bazel keeps trying to access
/root/.cache
when it starts. If it doesn't have permission, it fails the build immediately.I've already done everything I can think of to reset the environment:
sudo apt remove bazel
)/usr/local/
,/usr/lib/
,/usr/bin/
that looked Bazel-related~/.cache/bazel
,~/.bazel*
,.bazeliskrc
,.bazelversion
, and.bazelrc
~/.local/bazel_cache
and~/.cache/bazelisk
BAZEL_*
environment variables set$HOME
is correct and not/root
startup --output_user_root=/home/myuser/.bazel-output-root
to.bazelrc
--output_base
,--nohome_rc
,--nosystem_rc
, and--host_jvm_args="-Duser.home=$HOME"
BAZELISK_SKIP_JDK_DOWNLOAD=1
and properJAVA_HOME
)strace
, which showed that something still tries to stat/root/.cache
, even though I’ve pointed everything to user-local paths/root/.cache
with a symlink to/dev/null
, or making itchmod 000
— nothing helpedbazel shutdown
between runsNo matter what I try, I always get this on every build:
It really feels like Bazel got “stuck” in some state after being run as root once, and now even after wiping everything and reinstalling cleanly, it still somehow remembers that
/root/.cache
path. I can't find where it's coming from anymore.Is this expected behavior? Has anyone else hit something like this before?
Any suggestions would be appreciated. At this point it feels like the only thing left is to wipe the OS entirely and reinstall.
Beta Was this translation helpful? Give feedback.
All reactions