You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a buildlet is running as a non-root user, read-only directories like those managed by the Go module system can cause the work directory cleanup step to fail. The buildlet ends up exiting, and the stage0 program goes into a loop like this:
The unlink() and unlinkat() functions will fail if:
EACCES
Search permission is denied for a component of the path
prefix, or write permission is denied on the directory
containing the link to be removed.
You can see this with a relatively simple test case:
#!/bin/bashset -o errexit
set -o pipefail
ROOT=/var/tmp/blahblah
chmod -R u+rwx "$ROOT"||true
rm -rf "$ROOT"
mkdir "$ROOT"
mkdir "$ROOT/first"
mkdir "$ROOT/first/second"
date >"$ROOT/first/second/file0"
date >"$ROOT/first/second/file1"
mkdir "$ROOT/first/third"
date >"$ROOT/first/third/file2"
date >"$ROOT/first/third/file3"
chmod 0444 "$ROOT/first/second/file0"
chmod 0444 "$ROOT/first/third/file2"
chmod 0500 "$ROOT/first/third"
find "$ROOT" -ls
When a buildlet is running as a non-root user, read-only directories like those managed by the Go module system can cause the work directory cleanup step to fail. The buildlet ends up exiting, and the
stage0
program goes into a loop like this:The file we're trying to remove is read-only:
But the real issue is that the directory in which the file appears is also read-only:
According to unlinkat(2):
You can see this with a relatively simple test case:
As root, though, this succeeds:
Prior to calling
os.RemoveAll()
, the buildlet should make an attempt to ensure all directories under the work area are writeable.The text was updated successfully, but these errors were encountered: