fix(offload): resolve rsync permission errors and refine remote ownership

This commit is contained in:
mkorwel
2026-03-17 21:48:23 -07:00
parent e7d3860d40
commit 51f1ebecbd
2 changed files with 5 additions and 3 deletions

View File

@@ -54,8 +54,8 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
if (check.status !== 0) {
console.log(' - Provisioning isolated git worktree...');
// Fix permissions first
await provider.exec(`sudo docker exec -u root maintainer-worker chown -R node:node ${containerHome}/dev`);
// Only re-own the worktrees directory, NOT the entire home dir or scripts
await provider.exec(`sudo docker exec -u root maintainer-worker mkdir -p ${containerHome}/dev/worktrees && sudo docker exec -u root maintainer-worker chown -R node:node ${containerHome}/dev/worktrees`);
const setupCmd = `
git config --global --add safe.directory ${remoteWorkDir} && \

View File

@@ -56,7 +56,9 @@ export class GceConnectionManager {
sync(localPath: string, remotePath: string, options: { delete?: boolean; exclude?: string[] } = {}): number {
const fullRemote = this.getMagicRemote();
const rsyncArgs = ['-avz', '--quiet'];
// We use --no-t and --no-perms to avoid "Operation not permitted" errors
// when syncing to volumes that might have UID mismatches with the container.
const rsyncArgs = ['-rvz', '--quiet', '--no-t', '--no-perms', '--no-owner', '--no-group'];
if (options.delete) rsyncArgs.push('--delete');
if (options.exclude) options.exclude.forEach(ex => rsyncArgs.push(`--exclude="${ex}"`));