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 |
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! |
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/.cachewhen 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_cacheand~/.cache/bazeliskBAZEL_*environment variables set$HOMEis correct and not/rootstartup --output_user_root=/home/myuser/.bazel-output-rootto.bazelrc--output_base,--nohome_rc,--nosystem_rc, and--host_jvm_args="-Duser.home=$HOME"BAZELISK_SKIP_JDK_DOWNLOAD=1and properJAVA_HOME)strace, which showed that something still tries to stat/root/.cache, even though I’ve pointed everything to user-local paths/root/.cachewith a symlink to/dev/null, or making itchmod 000— nothing helpedbazel shutdownbetween 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/.cachepath. 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.
All reactions