Skip to content

Support streaming uploads on the Veeam SOSAPI route - #6236

Merged
bert-e merged 3 commits into
development/9.4from
bugfix/CLDSRV-962/veeam-route-streaming-uploads
Jul 30, 2026
Merged

Support streaming uploads on the Veeam SOSAPI route#6236
bert-e merged 3 commits into
development/9.4from
bugfix/CLDSRV-962/veeam-route-streaming-uploads

Conversation

@delthas

@delthas delthas commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The Veeam SOSAPI route prepared its request stream with arsenal's s3middleware/prepareStream, which only decodes STREAMING-AWS4-HMAC-SHA256-PAYLOAD — and was called with misaligned arguments (vault receiving the logger, log the callback), breaking that case too.

Unsigned streaming uploads with a trailing checksum (STREAMING-UNSIGNED-PAYLOAD-TRAILER, the default for aws CLI ≥ 2.23 and current AWS SDKs) went through undecoded: the aws-chunked framing exceeded the announced decoded length and the route replied 500 InternalError (data stream exceed announced size), so any modern client PUTting capacity.xml/system.xml failed.

This switches receiveData() to the checksum-aware object-path prepareStream():

  • both streaming encodings (signed chunks and unsigned + trailing checksum) are now decoded before the size check and XML parsing;
  • x-amz-checksum-* header and trailing checksums are validated with the same semantics as PutObject (BadDigest on mismatch);
  • a body exceeding the announced content-length now returns InvalidRequest (400) instead of InternalError, as this indicates a malformed client request.

The Veeam route was the last consumer of the arsenal helper in CloudServer.

Issue: CLDSRV-962

@bert-e

bert-e commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@scality scality deleted a comment from bert-e Jul 28, 2026
@bert-e

bert-e commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Comment thread lib/routes/veeam/utils.js Fixed
Comment thread tests/sur/routeVeeam.js
Comment thread tests/sur/routeVeeam.js Outdated
Comment thread tests/unit/routes/veeam-utils.js
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
9733 1 9732 0
View the full list of 1 ❄️ flaky test(s)
should create a bunch of objects and their versions::put and head object with versioning With v4 signature on versioning suspended then enabled bucket w/ null version should create a bunch of objects and their versions

Flake rate in main: 13.81% (Passed 668 times, Failed 107 times)

Stack Traces | 600s run time
Timeout of 600000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (.../test/versioning/objectHead.js)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Comment thread tests/sur/routeVeeam.js Outdated
Comment thread lib/routes/veeam/utils.js
Comment on lines +60 to +72
write(chunk, _enc, cb) {
totalLength += chunk.length;
if (totalLength > parsedContentLength) {
log.error('data stream exceed announced size', { parsedContentLength, overflow: totalLength });
return cb(
errorInstances.InvalidRequest.customizeDescription(
'request body exceeds the announced content-length',
),
);
}
return resolve(result);
});
let totalLength = 0;
const chunks = [];
const collector = new Writable({
write(chunk, _enc, cb) {
totalLength += chunk.length;
if (totalLength > parsedContentLength) {
log.error('data stream exceed announced size', { parsedContentLength, overflow: totalLength });
return cb(errors.InternalError);
}
chunks.push(chunk);
return cb();
},
final(cb) {
settle(null, Buffer.concat(chunks).toString());
cb();
},
});
const dataStream = prepareStream(request, request.streamingV4Params, log, settle);
pipeline(dataStream, collector).catch(err => settle(err));
chunks.push(chunk);
return cb();
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cb here is the Node.js stream.Writable API contract: a write(chunk, encoding, callback) implementation must invoke the callback to signal completion and backpressure — Node streams have no async/await form of this hook (promise support only covers pipeline/finished, which this function already awaits). Same pattern as every Writable/Transform implementation in the codebase (e.g. the object data path in storeObject). Not refactorable — suggest dismissing as won't-fix.

@delthas
delthas force-pushed the bugfix/CLDSRV-962/veeam-route-streaming-uploads branch from 4a95275 to 1afcfa8 Compare July 28, 2026 13:44
@delthas
delthas requested review from a team, SylvainSenechal and benzekrimaha July 28, 2026 13:56
Comment thread lib/routes/veeam/utils.js
Comment thread tests/sur/routeVeeam.js Outdated

@benzekrimaha benzekrimaha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking on my side just tiny nits

delthas added 3 commits July 30, 2026 10:24
The route prepared its request stream with arsenal's
s3middleware/prepareStream, which only decodes
STREAMING-AWS4-HMAC-SHA256-PAYLOAD — and was called with misaligned
arguments (vault receiving the logger, log the callback), breaking that
case too. Unsigned streaming uploads with a trailing checksum
(STREAMING-UNSIGNED-PAYLOAD-TRAILER), the default for aws CLI >= 2.23
and current AWS SDKs, went through undecoded: the aws-chunked framing
exceeded the announced decoded length and the route replied 500
InternalError ("data stream exceed announced size").

Switch receiveData() to the checksum-aware object-path prepareStream():
both streaming encodings are now decoded, and x-amz-checksum-* header
and trailing checksums are validated with the same semantics as
PutObject. Also return InvalidRequest (400) instead of InternalError
when the body exceeds the announced content-length, as this indicates
a malformed client request.

Issue: CLDSRV-962
Replace the promise-executor and .then() bridge with await on the
pipeline. Transform errors delivered through the errCb side-channel are
bridged into a promise raced against the pipeline completion; promise
settlement semantics replace the jsutil.once guard.

Issue: CLDSRV-962
@delthas
delthas force-pushed the bugfix/CLDSRV-962/veeam-route-streaming-uploads branch from 51c28af to f5538f6 Compare July 30, 2026 08:25
@delthas

delthas commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Build failed

The build for commit did not succeed in branch bugfix/CLDSRV-962/veeam-route-streaming-uploads

The following options are set: approve

@bert-e

bert-e commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9.4

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3

This pull request did not target the following hotfix branch(es) so they
were left untouched:

  • hotfix/7.10.2
  • hotfix/7.10.8
  • hotfix/7.10.27
  • hotfix/7.4.7
  • hotfix/7.70.45
  • hotfix/6.4.7
  • hotfix/7.70.21
  • hotfix/7.8.0
  • hotfix/9.2.24
  • hotfix/7.9.0
  • hotfix/7.7.0
  • hotfix/9.0.7
  • hotfix/7.4.4
  • hotfix/7.4.5
  • hotfix/7.10.15
  • hotfix/7.4.6
  • hotfix/7.4.1
  • hotfix/7.70.11
  • hotfix/7.10.3
  • hotfix/7.10.1
  • hotfix/7.10.28
  • hotfix/9.2.36
  • hotfix/7.4.2
  • hotfix/7.6.0
  • hotfix/7.4.3
  • hotfix/7.10.4
  • hotfix/7.10.49
  • hotfix/7.4.10
  • hotfix/8.8.45
  • hotfix/7.4.0
  • hotfix/9.0.32
  • hotfix/7.4.9
  • hotfix/7.2.0
  • hotfix/7.10.0
  • hotfix/7.10.30
  • hotfix/7.4.8
  • hotfix/7.70.51
  • hotfix/7.70.73

Please check the status of the associated issue CLDSRV-962.

Goodbye delthas.

The following options are set: approve

@bert-e
bert-e merged commit f5538f6 into development/9.4 Jul 30, 2026
59 of 61 checks passed
@bert-e
bert-e deleted the bugfix/CLDSRV-962/veeam-route-streaming-uploads branch July 30, 2026 08:59
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.

5 participants