fix(install): ensure .openclaw-data ownership for sandbox user (fixes #692)#698
fix(install): ensure .openclaw-data ownership for sandbox user (fixes #692)#698kagura-agent wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
…VIDIA#692) The native curl installer may create .openclaw-data directories as root, causing EACCES when openclaw (running as the sandbox user) tries to write device-auth.json to the identity directory. Add a startup ownership check to nemoclaw-start.sh that: - Creates any missing writable subdirectories (mirrors Dockerfile setup) - Fixes ownership if files are not owned by the current user - Creates the identity symlink if missing on native installs The Docker path is unaffected (Dockerfile already sets correct ownership).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a startup shell function in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/nemoclaw-start.sh`:
- Around line 151-155: The comment above the ownership-fix block is misleading:
the find invocation in the nemoclaw-start.sh snippet (using -maxdepth 0) only
checks the top-level directory (variable data_dir) rather than any files under
it; either update the comment to say it only checks the directory itself or
change the find behavior to check recursively (remove -maxdepth 0 and test for
any non-owned files under "$data_dir") so chown -R runs when any contained file
is misowned; locate the block referencing data_dir and the find call to apply
the fix.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 586bdba6-6707-415b-baad-ee3dbdcb2d2b
📒 Files selected for processing (1)
scripts/nemoclaw-start.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for fixing the issue with the ownership of the .openclaw-data directory, this helps improve the functionality of our project. |
|
Closing to reduce open PR count — I had too many PRs open, which adds review burden rather than helping. Happy to resubmit if this fix is still wanted. |
Problem
When NemoClaw is installed via the curl installer on Linux, the
.openclaw-datadirectories (includingidentity/) may be created with root ownership. When openclaw subsequently runs as thesandboxuser, it getsEACCES: permission deniedtrying to writedevice-auth.json.The Docker path handles this correctly (Dockerfile line 52:
chown -R sandbox:sandbox), but the native install path lacks an equivalent ownership fix.Fix
Add a
fix_openclaw_data_ownership()function toscripts/nemoclaw-start.shthat runs before gateway startup:identitysymlink if missing on native installsThis only activates when the split layout (
.openclaw-data+ symlinks) is present, so it's a no-op on setups that don't use this pattern.Testing
bash -nsyntax check|| truefor all operations so it won't break existing working setupsFixes #692
Summary by CodeRabbit