Skip to content

fix(sandbox): add credentials directory to writable state layout#1126

Open
latenighthackathon wants to merge 4 commits intoNVIDIA:mainfrom
latenighthackathon:fix/sandbox-credentials-dir
Open

fix(sandbox): add credentials directory to writable state layout#1126
latenighthackathon wants to merge 4 commits intoNVIDIA:mainfrom
latenighthackathon:fix/sandbox-credentials-dir

Conversation

@latenighthackathon
Copy link
Copy Markdown
Contributor

@latenighthackathon latenighthackathon commented Mar 30, 2026

Summary

OpenClaw creates ~/.openclaw/credentials at runtime for storing auth tokens (WhatsApp, Telegram, OAuth). Since .openclaw is locked read-only via Landlock + root-owned DAC, the mkdir fails with EACCES: permission denied.

Same root cause pattern as the memory directory bug fixed in #1061.

Scope note: This PR addresses the credentials directory EACCES (error 3 in #1114). The openclaw.json.*.tmp EACCES errors (errors 1-2 in #1114) are a separate issue — OpenClaw's atomic config write creates temp files in the locked .openclaw/ directory, which requires a different fix (either redirecting temp writes to .openclaw-data/ or unlocking openclaw.json ownership to the sandbox user).

Related Issue

Partially addresses #1114 (fixes credential directory access; openclaw.json temp file writes remain)

Changes

  • Added /sandbox/.openclaw-data/credentials to the writable state directory layout in Dockerfile.base
  • Added symlink /sandbox/.openclaw/credentials -> /sandbox/.openclaw-data/credentials
  • Follows the existing pattern for memory, agents, extensions, etc.

Testing

  • npx prek run --all-files passes (all checks pass; hadolint and ESLint failures are pre-existing on main)
  • npm test passes (38 passed, 1 failed — same baseline as main)

Executed:

  • Full make check equivalent in Docker (Linux): shellcheck, shfmt, hadolint, ESLint, gitleaks, markdownlint, Vitest all pass
  • hadolint Dockerfile.base passes clean (no warnings from our change)
  • No new test failures introduced

Checklist

Signed-off-by: latenighthackathon latenighthackathon@users.noreply.github.com

Summary by CodeRabbit

  • Chores
    • Extended base environment configuration with an additional writable directory structure to support enhanced system operations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6e25efb5-5758-4940-bdcc-4a0772c6bf01

📥 Commits

Reviewing files that changed from the base of the PR and between 1fcc80c and ef490bc.

📒 Files selected for processing (1)
  • Dockerfile.base
✅ Files skipped from review due to trivial changes (1)
  • Dockerfile.base

📝 Walkthrough

Walkthrough

Modified Dockerfile.base to create a new writable directory /sandbox/.openclaw-data/credentials and a symlink /sandbox/.openclaw/credentials pointing to it, extending the existing .openclaw-data writable-state pattern for credential storage.

Changes

Cohort / File(s) Summary
Docker Filesystem Configuration
Dockerfile.base
Added creation of /sandbox/.openclaw-data/credentials and a symlink /sandbox/.openclaw/credentials to route credential storage to the writable .openclaw-data location.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 I made a nook where secrets hide,
A little link to place them inside,
From read-only shelf to writable bed,
Safe credentials rest their head,
Hopping happy — all set and fed.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(sandbox): add credentials directory to writable state layout' accurately and concisely summarizes the main change: adding a credentials directory to the sandbox's writable state layout in Dockerfile.base.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@cv cv assigned cv and ericksoa Mar 31, 2026
@wscurran wscurran added bug Something isn't working Getting Started Use this label to identify setup, installation, or onboarding issues. priority: high Important issue that should be resolved in the next release labels Mar 31, 2026
@cv cv enabled auto-merge (squash) April 1, 2026 04:13
OpenClaw creates ~/.openclaw/credentials at runtime for storing
auth tokens (WhatsApp, Telegram, OAuth). Since .openclaw is locked
read-only (Landlock + root-owned DAC), the mkdir fails with EACCES.

Add credentials to the .openclaw-data writable layout with a symlink,
matching the pattern used for agents and other writable paths.

Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
auto-merge was automatically disabled April 2, 2026 23:29

Head branch was pushed to by a user without write access

@latenighthackathon latenighthackathon force-pushed the fix/sandbox-credentials-dir branch from 3039ed2 to ef490bc Compare April 2, 2026 23:29
Dongni-Yang added a commit to Dongni-Yang/NemoClaw that referenced this pull request Apr 3, 2026
Remove the Dockerfile.base credentials directory changes to avoid
overlap with PR NVIDIA#1126 which already addresses that fix.

Signed-off-by: Dongni Yang <dongniy@nvidia.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Getting Started Use this label to identify setup, installation, or onboarding issues. priority: high Important issue that should be resolved in the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants