Skip to content

config: emit blake3sum_command for sftp so --hash blake3 syncs work#127

Merged
mbertschler merged 1 commit into
offload-v1from
fix-sftp-blake3sum-command
Jun 16, 2026
Merged

config: emit blake3sum_command for sftp so --hash blake3 syncs work#127
mbertschler merged 1 commit into
offload-v1from
fix-sftp-blake3sum-command

Conversation

@mbertschler

Copy link
Copy Markdown
Owner

Problem

Every non-shallow squirrel sync to an sftp destination runs rclone copy --checksum --hash blake3 (sync/sync.go:603, sync/node.go:586). rclone's sftp backend, however, only autodetects md5sum/sha1sum — it never discovers a BLAKE3 command (the NAS has b3sum, but rclone probes a different name). So the transfer aborts immediately:

servers → kreisel  status=failed transferred=0 checked=0 errors=0 bytes=0
  rclone: rclone exit: exit status 1

rclone hashsum blake3 <remote> confirms it: hash unsupported: hash type not supported. With the 02ffdc1 guard ("downgrade a --checksum run that silently lost its hash"), squirrel correctly fails the run rather than recording an unverified sync — so a brand-new sftp volume can never complete its first sync.

Fix

Render blake3sum_command = b3sum in every sftp section of the generated rclone.conf (config/destinations.go, RcloneSection). rclone 1.74's sftp backend exposes --sftp-blake3sum-command / config key blake3sum_command for exactly this. b3sum is the canonical BLAKE3 CLI and must be on the remote's PATH (squirrel already assumes this — see nas/first-backup-pipeline.md).

Harmless for sftp destinations that verify with another algo: rclone only invokes b3sum when BLAKE3 is requested.

Testing

  • New TestRcloneSectionSFTPEmitsBlake3sumCommand: sftp sections carry the line; s3 (fixed provider checksum) does not.
  • Updated the two exact-match crypt-overlay renders (config, sync) for the added line.
  • go vet ./... clean; go test ./... green.

rclone's sftp backend only autodetects md5sum/sha1sum, never a BLAKE3
command, so every non-shallow sync — which runs `rclone copy --checksum
--hash blake3` — aborted with "hash type not supported", even when the
remote has b3sum installed. Render `blake3sum_command = b3sum` in every
sftp section so rclone can compute server-side BLAKE3.
@mbertschler mbertschler merged commit 175b4f7 into offload-v1 Jun 16, 2026
2 checks passed
@mbertschler mbertschler deleted the fix-sftp-blake3sum-command branch June 16, 2026 20:25
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