Skip to content

Commit a8593d6

Browse files
committed
fix: use chown -R to recursively set auth storage ownership
The LevelDB files inside the auth storage directory need to be owned by the kernel user, not just the directory itself. Use process exec with chown -R to fix the LOCK file access denied errors.
1 parent e5de29c commit a8593d6

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

internal/claude/loader.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ func LoadIntoBrowser(ctx context.Context, opts LoadIntoBrowserOptions) error {
5555
return fmt.Errorf("failed to upload auth storage: %w", err)
5656
}
5757

58-
// Set proper ownership on the auth storage directory
59-
if err := fs.SetFilePermissions(ctx, opts.BrowserID, kernel.BrowserFSetFilePermissionsParams{
60-
Path: authDestPath,
61-
Mode: "0755",
62-
Owner: kernel.Opt(KernelUser),
63-
Group: kernel.Opt(KernelUser),
64-
}); err != nil {
65-
return fmt.Errorf("failed to set auth storage permissions: %w", err)
58+
// Set proper ownership on the auth storage directory and all files inside
59+
// using chown -R via process exec (SetFilePermissions is not recursive)
60+
proc := opts.Client.Browsers.Process
61+
_, err = proc.Exec(ctx, opts.BrowserID, kernel.BrowserProcessExecParams{
62+
Command: "chown",
63+
Args: []string{"-R", KernelUser + ":" + KernelUser, authDestPath},
64+
AsRoot: kernel.Opt(true),
65+
TimeoutSec: kernel.Opt(int64(30)),
66+
})
67+
if err != nil {
68+
return fmt.Errorf("failed to set auth storage ownership: %w", err)
6669
}
6770
}
6871

0 commit comments

Comments
 (0)