Skip to content

Phase 2: S3 partsize for >5GB uploads (#886) - #935

Merged
neuromechanist merged 2 commits into
feature/issue-896-epic-arch-hardeningfrom
feature/issue-886-phase2-largefile
Jul 6, 2026
Merged

neuromechanist merged 2 commits into
feature/issue-896-epic-arch-hardeningfrom
feature/issue-886-phase2-largefile

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

nemar dataset upload could not upload any data file larger than 5 GB — a hard failure for essentially all raw iEEG/large-EEG datasets — with only a generic Failed to copy to remote.

  • buildS3RemoteArgs now emits partsize (default DEFAULT_S3_PARTSIZE="1GiB", per-remote configurable via S3RemoteConfig.partsize). Without it git-annex does a single-part PUT, which S3 caps at 5 GB (400 EntityTooLarge); partsize forces multipart. Applies to existing remotes on the next enableremote.
  • extractCopyError surfaces git-annex stdout on copy failure — the S3 error lands on stdout, not stderr, so the old stderr.trim() || "Failed to copy to remote" hid it. Prefers stderr, else the informative stdout lines (else its tail).

Test plan

  • test/s3-remote-partsize.test.ts — partsize present (default 1GiB), configurable, core params intact.
  • test/copy-error-surface.test.ts — stderr preferred; EntityTooLarge recovered from stdout; tail fallback; generic only when empty.
  • test/git-annex-remote.test.ts (32 tests, real git-annex initremote/enableremote) passes — confirms git-annex accepts partsize=1GiB end to end.
  • Export-surface pin updated in the same commit (buildS3RemoteArgs/DEFAULT_S3_PARTSIZE/extractCopyError added to the s3-remote/transfer lists + INTERNAL_WIRING). tsc + Biome clean.

Closes #886
Part of epic #896

Epic #896 Phase 2 (#886). git-annex uploads of any data file >5 GB (common
for raw iEEG/EEG) failed with a generic 'Failed to copy to remote'.
- buildS3RemoteArgs now emits partsize (default DEFAULT_S3_PARTSIZE=1GiB,
  per-remote configurable via S3RemoteConfig.partsize) so git-annex uses
  multipart PUT instead of a single-part PUT that S3 caps at 5 GB
  (400 EntityTooLarge). Applies to existing remotes on next enableremote.
- extractCopyError surfaces git-annex STDOUT on copy failure (the S3 error
  lands on stdout, not stderr), so users see the real cause not a generic msg.
- buildS3RemoteArgs/DEFAULT_S3_PARTSIZE/extractCopyError exported for unit
  tests; export-surface pin updated (INTERNAL_WIRING) in the same commit.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR935

Version: 0.8.76-PR935.ddf7a66
Commit: ddf7a66


🤖 Updated on each push.

extractCopyError's relevant-lines branch was unbounded; a many-file copy
failure (generic fail/error matches) could surface hundreds of lines to
the CLI. Cap to the last 20 with an omitted-count note, matching the
bounded-subprocess-error convention (github.ts, import-openneuro.ts).
Added a >20-line test case.
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review (sonnet) — findings addressed in 2963f41

Clean except one moderate: extractCopyError's relevant-lines branch was unbounded (a many-file failure with generic fail/error matches could dump hundreds of lines). Capped to the last 20 with an omitted-count note, matching the github.ts/import-openneuro.ts convention; added a >20-line test. Reviewer confirmed clean on: partsize=1GiB (git-annex's own recommended value), enableremote safety on existing remotes, downloads unaffected, no secret-leak vector, and the export-surface pin.

@neuromechanist
neuromechanist merged commit d0dd96d into feature/issue-896-epic-arch-hardening Jul 6, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/issue-886-phase2-largefile branch July 6, 2026 21:35

This branch was previously deployed

1 inactive deployment
npm — 2963f416 Deployed Jul 6, 2026 by neuromechanist via publish #1694
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant