tracecraft
tracecraft copied to clipboard
init --backend hf fails on a non-existent bucket with a cryptic error (should auto-create or fail-fast)
Summary
tracecraft init --backend hf fails when the target HF Bucket doesn't already exist, with a cryptic error. The command that's meant to initialize a project can't bootstrap the bucket it needs, and the failure message doesn't point at the cause.
What happened
First-time setup against a brand-new HF bucket handle:
$ tracecraft init --backend hf --bucket arrmlet/tracecraft-apex \
--project text_clustering --agent claude-code --hf-token "$HF_TOKEN"
Added .tracecraft.json to .gitignore
Error: HF put failed: text_clustering/agents/claude-code.json.
Make sure the repository and revision exist before writing data.
The error sent me down two wrong paths before I found the fix:
- Assumed a permissions/token problem (it wasn't).
- Created a HF dataset repo
arrmlet/tracecraft-apex(wrong resource type —hf.pywrites tohf://buckets/..., i.e. an HF Bucket, not a dataset repo). Still failed.
The actual fix was to pre-create the Bucket out-of-band:
from huggingface_hub import HfApi
HfApi(token=HF_TOKEN).create_bucket("arrmlet/tracecraft-apex", private=True)
After that, init succeeded immediately.
Why it's confusing
initsounds like it provisions everything (its help: "Initialize tracecraft config, create bucket, and register agent"). The help even says "create bucket" — but it doesn't.- The error
"Make sure the repository and revision exist"is HfFileSystem-level and doesn't mention buckets orcreate_bucket.
Suggested fix (either)
- Auto-create the bucket in
init(callHfApi.create_bucket(..., exist_ok=True)before the first write). Matches what the help text already promises. - Or, fail fast with an actionable message: detect the missing bucket and print
Bucket 'arrmlet/tracecraft-apex' does not exist. Create it first: tracecraft bucket create ... (or pass --create-bucket).
Option 1 is the turnkey experience.
Env
- tracecraft-ai 0.2.1, huggingface_hub 1.12.0, macOS, HF backend.