Skip to main content
You’ll see one of these on cargo fetch / cargo build / gen genie build:

Why it happens

The workshop repos pull framework dependencies from the private gen-bc/gen-framework-preview GitHub repo over HTTPS. Cargo delegates the fetch to the git CLI (because .cargo/config.toml sets net.git-fetch-with-cli = true), so git has to be able to authenticate non-interactively. The token flows host → container like this:
Anything that breaks a link produces the errors above.

Step-by-step diagnosis

1. Confirm git-fetch-with-cli is enabled
[net] only works in .cargo/config.toml, NOT in Cargo.toml. If you see warning: unused manifest key: net during a build, you have a stray [net] block in Cargo.toml — remove it; it does nothing there.
2. Check whether the token reached the container
  • GH_TOKEN EMPTY → the token never made it in. Fix on the host:
    gh stores its token in the OS keyring, not as an env var, so you must export it. Then relaunch VS Code from that terminal (code .) or set it machine-wide and rebuild the container:
  • GH_TOKEN set → continue.
3. Reproduce the failure with a raw git fetch
  • Returns a commit SHA → auth works; your problem is elsewhere (network, wrong tag/ref, Cargo.lock). Stop here.
  • gh: not found or could not read Username → the credential helper is broken. Continue to step 4.
4. Inspect the git credential helper
The classic failure: the helper points at a host path that doesn’t exist in the Linux container, e.g.:
This happens because VS Code’s “Dev Containers” extension copies your host ~/.gitconfig into the container, including the credential helper line that gh auth setup-git wrote on your Mac (which hard-codes /opt/homebrew/bin/gh).5. Fix the credential helper (immediate, in the running container)Replace the broken helper with a token-backed one that doesn’t depend on where gh lives:
Verify:
6. Make the fix durableThe container’s ~/.gitconfig isn’t on a persistent volume, and VS Code re-injects the host gitconfig on every connect, so step 5 alone is temporary. Pick one permanent fix:
  • Preferred — stop VS Code copying the host gitconfig. Add to VS Code user settings.json:
  • Or fix the host gitconfig so the copied path is valid in both OSes — use a bare gh instead of an absolute Homebrew path:
    gh resolves to /opt/homebrew/bin/gh on the host and /usr/bin/gh in the container, so the same line works in both.
7. Force a real authenticated fetch to prove it end-to-endA plain Rebuild Container doesn’t re-fetch — the cargo cache volume keeps the cached git deps. Force a real network fetch:

One-liner triage

Inside the container:

Host vs container quick reference

remoteEnv from devcontainer.json is only applied to the VS Code terminal, not to docker exec sessions. If you’re shelling in directly, export them yourself before running cargo / gen:
VS Code’s cargo wrapper inside the devcontainer can strip PATH, leaving rust-analyzer unable to invoke the right toolchain. Symptom: code compiles fine on the command line, but the IDE shows no errors or shows stale ones.Workarounds:
  • Reload the VS Code window after the container finishes setting up (Developer: Reload Window).
  • Confirm which cargo resolves inside the integrated terminal (the one VS Code reuses for rust-analyzer) to /home/vscode/.cargo/bin/cargo, not /usr/bin/cargo.
  • If still wrong, add ~/.cargo/bin explicitly to the front of PATH in the VS Code terminal profile.
Hit something not on this page? Send the failing command and the full error output to your Gen Labs contact — the page grows from real reports.