Sandbox doesn't allow process to write files
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
I am trying to run py_test using bazel. While setting up the action, it requires to write a log file during the execution but sandboxing is not allowing to write the file saying `OSError: [Errno 30] Read-only file system`
This was working fine with bazel `6.2.0` but when I upgraded to `7.0.2` it started throwing this error.
I don't want to use standalone spawn strategy
### Which category does this issue belong to?
Python Rules
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
_No response_
### Which operating system are you running Bazel on?
Ubuntu 22.04.3
### What is the output of `bazel info release`?
release 7.0.2
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
_No response_
### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
_No response_
### Have you found anything relevant by searching the web?
Yes, I checked this issue https://github.com/bazelbuild/bazel/issues/2612
Tried running my test with flag --sandbox_tmpfs_path=/dev/shm but still the same error
### Any other information, logs, or outputs that you want to share?
Traceback (most recent call last):
File "/tmp/bazel_user_root/3599625ebb0c2f093fc58dec586ff41a/execroot/qureai/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/logging/config.py", line 564, in configure
handler = self.configure_handler(handlers[name])
File "/tmp/bazel_user_root/3599625ebb0c2f093fc58dec586ff41a/execroot/qureai/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/logging/config.py", line 745, in configure_handler
result = factory(**kwargs)
File "/tmp/bazel_user_root/3599625ebb0c2f093fc58dec586ff41a/execroot/qureai/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/logging/__init__.py", line 1146, in __init__
StreamHandler.__init__(self, self._open())
File "/tmp/bazel_user_root/3599625ebb0c2f093fc58dec586ff41a/execroot/qureai/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/logging/__init__.py", line 1175, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding,
OSError: [Errno 30] Read-only file system: '/tmp/logs/hct-api.log'
Contributor guide
Research direction
Start by reproducing the reported py_test failure on Ubuntu 22.04.3 with Bazel 7.0.2, using the /tmp/logs/hct-api.log path and the --sandbox_tmpfs_path=/dev/shm flag. Compare behavior with Bazel 6.2.0 and verify that the test can write its log without using the standalone spawn strategy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100