Repository navigation
Description
The CLI's S3-upload step inside nemar dataset push (and --pr / nemar dataset update) consistently fails to upload annex content for collaborators of public datasets. Two independent bugs combine. Repro'd against on003825, nm000133, nm000134 on [email protected] and 0.8.8, git-annex 10.20260213.
Bug A — getAnnexS3Remotes doesn't filter remotes with annex-ignore=true
Affected: on003825 and almost certainly every other dataset under nemarDatasets/on* imported from OpenNeuro (the s3-PUBLIC / s3-PRIVATE remotes are inherited from the upstream OpenNeuro mirror).
Code locations:
src/lib/git-annex.ts(around lines 1798-1860) —getAnnexS3Remotessrc/commands/dataset.ts(around line 4221) — push-data step
Repro:
nemar dataset clone on003825
cd on003825
git remote -v
# nemar-s3
# origin https://github.com/nemarDatasets/on003825.git
# s3-PUBLIC <-- inherited from upstream OpenNeuro mirror
# s3-PRIVATE <-- ditto
# Stage annexable changes, then:
nemar dataset push --pr -t … -b …Symptom: every `copy stimuli/.jpg` fails with
```
Remote is configured to use versioning, but no S3 version ID is recorded for this key
(cannot check content) failed
```
The CLI prints a final `Git changes were pushed successfully.` so it looks half-successful, but no annex content lands on S3.
Root cause: `getAnnexS3Remotes` enumerates S3 remotes via `git config --get-regexp '^remote\..*\.annex-s3'` and picks `s3Remotes[0]` as the upload destination, without filtering remotes whose `remote..annex-ignore` is `true`. For OpenNeuro mirrors that list returns `[s3-PUBLIC, nemar-s3]` in that order, so the CLI uploads to the inherited `s3-PUBLIC` remote which is configured with `versioning=yes exporttree=yes`. git-annex's "no S3 version ID recorded for this key" branch then fires for every new key. `git annex info nemar-s3` shows `annex-ignore=false`; the picker should consult `remote..annex-ignore`.
Workaround:
git remote remove s3-PUBLIC
git remote remove s3-PRIVATE
nemar dataset push # now uploads cleanlySuggested fix: in `getAnnexS3Remotes`, skip any remote where `git config remote..annex-ignore=true`. As a follow-up, when more than one valid candidate remains, prefer the one whose UUID matches the configured `nemar-s3` (or whose description equals `[nemar-s3]`) before falling back to first-match.
Bug B — `push` doesn't recover when the API denies upload credentials
Affected: `nm000133`, `nm000134` and likely every dataset where the user has GitHub `push:true` but hasn't yet `nemar dataset request-access`-ed (i.e. is a GitHub collaborator but not a NEMAR collaborator).
Repro:
gh api 'repos/nemarDatasets/nm000133' -q .permissions
# {\"admin\":false,\"maintain\":false,\"pull\":true,\"push\":true,\"triage\":true}
cd nm000133
git checkout -b stimuli-add main
# … stage / commit some annex content …
nemar --verbose dataset push --pr -t … -b …Symptom:
- Pushing to GitHub...
✔ Pushed to GitHub
- Requesting upload credentials...
⚠ Could not get upload credentials: Only dataset owner or collaborators can request upload credentials. Trying environment credentials.
- Copying data to S3 (nemar-s3)...
✖ S3 push failed
copy stimuli/train2017/000000000584.jpg (to nemar-s3...)
Set both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to use S3
No S3 credentials configured
failed
…× N keys…
Ensure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set,
or log in with 'nemar auth login' for automatic credentials.
Git changes were pushed successfully.
Two things that go wrong here:
- The user IS auth'd. `nemar whoami` returns the right account; the API key is in `~/.config/nemar/config.json`. The fall-through error message "or log in with `nemar auth login` for automatic credentials" is misleading — login isn't the issue, the NEMAR-collaborator status is.
- The PR is never created even though `--pr` was passed and git push succeeded. The CLI aborts on S3 failure and never reaches PR creation, so the user is left with a remote branch and no PR.
Workaround (which the CLI should arguably do automatically):
nemar dataset request-access nm000133 # auto-approved if user has GH push perm
nemar dataset push # now succeeds end-to-endSuggested fixes:
- On the "Only dataset owner or collaborators can request upload credentials" response, instead of falling through to env-var creds, either retry once after auto-calling `request-access`, or surface a directly actionable message like "Run `nemar dataset request-access ` first". The current message points at the wrong fix.
- Make the `--pr` flow idempotent / order-independent: if S3 fails but git push succeeded, still create the PR (or detect an existing branch and reuse it), so the user can later retry just the S3 phase via `nemar dataset push --no-pr`.
- The "Trying environment credentials." path should print what env-var values it actually found (or explicitly "AWS_ACCESS_KEY_ID not set in env") so the misleading suggestion to set env vars is concretely diagnosable.
Bonus DX suggestion
`nemar dataset collaborators ` returns `Only dataset owner or admin can view collaborators` for non-owners — fair. But there should be a `nemar dataset whoami ` (or `nemar whoami --in `) that reports for the current user, on this dataset: GitHub permission level, NEMAR-collaborator status, S3 upload allowed (yes/no). That single command would have made both of these bugs visible in 5 seconds.
Evidence
End-to-end runs (with PRs that show the half-completed state):
- `nemarDatasets/on003825` PR Add proper test coverage measurement (90%+ target) #1 (Bug A) — opened from a fork because of an unrelated GitHub-perm issue at the time; same S3 failure reproduces on a direct push too
- `nemarDatasets/nm000133` PR Optimize KV usage to stay within free tier limits #2 (Bug B) — `request-access` + retry resolved
- `nemarDatasets/nm000134` PR Optimize KV usage to stay within free tier limits #2 (Bug B) — same path, same fix
Happy to provide `--verbose` logs or push attempts on a specific commit if useful.
Activity
bruAristimunha commentedon May 1, 2026
Bug C —
nemar dataset pushdoes not push thegit-annexbranch to originWhile verifying the on003825 / nm000133 / nm000134 PRs by doing a fresh
nemar dataset download, every annexgetfor the new annex content failed:git annex whereison the failing file showed it as only present on the local clone where the push originated:Yet the source clone, on the same path, sees nemar-s3 as having all the keys:
So the binary content did make it onto S3 (it's there — the source clone can
getfrom it just fine), but the git-annex branch commits that record "key X is now on nemar-s3" never got pushed to origin. Anyone cloning fresh therefore can't find the new annex objects on any remote.The CLI's help text claims it pushes both: "Push git commits to GitHub (main + git-annex branches) and optionally copy annexed data to the S3 remote." In practice it only pushed
stimuli-add, not thegit-annexbranch.Fix from the user side:
# After `nemar dataset push` reports success, also: git push origin git-annexOnce that landed,
git fetch origin git-annexfrom a fresh clone followed bynemar dataset getworks:Suggested fix in the CLI: at the end of the S3 copy step, do an explicit
git push origin git-annex(orgit push origin --allscoped to that branch). The current state where the binary content is uploaded but the location records are not is a silent corruption that only surfaces when someone else tries to download — exactly what would happen for an end user, not the maintainer who pushed.This affected all three PRs in the original report (on003825, nm000133, nm000134). Reproducible with the latest 0.8.8.
bruAristimunha commentedon May 9, 2026
hey @arnodelorme and @neuromechanist,
any update about this?
Fix nemar dataset push --pr S3 upload failures (#401) (#404)
Refresh the browser epic map (#1464)