Repository navigation
Closed
Labels
bugSomething isn't working
Description
Symptom
When nemar sandbox fails after createDataset returns (any of the eight downstream error paths in src/commands/sandbox.ts), the GitHub repo (under nemarDatasets/xx*) and the S3 prefix (s3://nemar/xx*/objects/) are left orphaned. cleanupSandboxDataset(datasetPath) only removes the local temp directory.
Impact
- Each failed retry provisions a fresh
xx-prefixed dataset rather than reusing the orphan. - WSL/HPC users hitting
gitAnnexAddorcopyToAnnexRemotefailures repeatedly accumulate orphans. - The 14-day sandbox sweep (per
nemar-cli/CLAUDE.md) eventually catches them, but in the meantime the user is never told the server-side resource exists. - Re-running offers no resume path, even though the GitHub repo + S3 prefix are still valid.
Affected paths
All post-createDataset failure paths in src/commands/sandbox.ts:
acceptGitHubInvitationinvalid URLinitDataset/configureLargefiles/configureGitHubRemoterequestUploadCredentialsconfigureS3RemotegitAnnexAddcopyToAnnexRemotesaveDataset/pushToGitHubfinalizeDataset
Proposed fix
Wire a single failSandbox(datasetId, datasetPath) helper that:
- Calls
DELETE /admin/datasets/:id(or a sandbox-scoped equivalent that does not require admin) to remove the GitHub repo + S3 prefix + D1 row. - Calls
cleanupSandboxDataset(datasetPath)for the local temp dir. - Falls back to a user-visible warning if the backend teardown fails (so they know to clean up manually).
Route every post-createDataset error path through failSandbox instead of cleanupSandboxDataset alone.
Notes
- Surfaced during
/review-pron fix(sandbox): migrate to S3 special remote, add --verbose #378 by the silent-failure-hunter agent. - Out of scope for fix(sandbox): migrate to S3 special remote, add --verbose #378, which focuses on the upload-path bug (sandbox: surface real errors and add --verbose; migrate off fragile registerurl path #377).
- The
DELETE /admin/datasets/:idendpoint exists but is admin-only; check whether sandbox owners can invoke it for their ownxx*datasets, or whether a newDELETE /sandbox/:idis needed.
Related
- sandbox: surface real errors and add --verbose; migrate off fragile registerurl path #377 - sandbox: surface real errors and add --verbose
- fix(sandbox): migrate to S3 special remote, add --verbose #378 - PR migrating sandbox to S3 special remote
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Address PR review: gate, comments, verbose unit test
fix(sandbox): migrate to S3 special remote, add --verbose (#378)