AgentSkillsCN

sandbox-troubleshooting

Daytona 沙箱的故障排查与问题解决。适用于已知问题、常见失误,以及各种应对方案的总结与分享。

SKILL.md
--- frontmatter
name: sandbox-troubleshooting
# prettier-ignore
description: Daytona sandbox troubleshooting. Use for known issues, common mistakes, workarounds.

Sandbox Troubleshooting

Known Issues

IssueWorkaround
SSH PATH brokenUse full paths: /usr/bin/git, /usr/bin/gh
exec returns -1 on snapshotsUse SSH instead (Daytona bug #2283)
Work dir is /home/daytonaNot /workspaces
SSH exit code 255Ignore - check output, not exit code
--env vars not in SSHTeam-lead sets credentials before spawning

Upstream: daytonaio/daytona#2283

Common Mistakes

1. Not using snapshot

  • BAD: ralph-town sandbox create
  • GOOD: ralph-town sandbox create --snapshot ralph-town-dev

Snapshot has gh, git, bun pre-installed.

2. Using exec instead of SSH

  • BAD: ralph-town sandbox exec <id> -- git status
  • GOOD: ssh <token>@ssh.app.daytona.io "/usr/bin/git status"

exec returns -1 on snapshots (known bug).

3. Not using full paths

  • BAD: git clone ...
  • GOOD: /usr/bin/git clone ...

PATH is broken in SSH sessions.

4. Teammate setting up credentials

  • BAD: Teammate runs credential setup commands
  • GOOD: Team-lead configures via SSH BEFORE spawning teammate

SSH sessions don't inherit --env vars.

5. Wrong quoting for $GH_TOKEN

  • BAD: ssh ... '/bin/echo "https://oauth2:$GH_TOKEN@..."'
  • GOOD: ssh ... "/bin/echo 'https://oauth2:$GH_TOKEN@...'"

Single quotes prevent local expansion.

6. Token in git URL

  • BAD: git clone https://$GH_TOKEN@github.com/...
  • GOOD: Use credential helper:
    bash
    /usr/bin/git config --global credential.helper store
    /bin/echo "https://oauth2:$GH_TOKEN@github.com" > ~/.git-credentials
    

Tokens in URLs leak to process list, logs, error messages.

Full Path Reference

ToolPath
git/usr/bin/git
gh/usr/bin/gh
bun/root/.bun/bin/bun
ls, cat, echo/bin/ls, /bin/cat, /bin/echo
curl/usr/bin/curl