Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fs/s3): fix stream writing support with Object Lock enabled #6190

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions @xen-orchestra/fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.54.0",
"@aws-sdk/lib-storage": "^3.54.0",
"@aws-sdk/middleware-apply-body-checksum": "^3.58.0",
"@aws-sdk/node-http-handler": "^3.54.0",
"@marsaud/smb2": "^0.18.0",
"@sindresorhus/df": "^3.1.1",
Expand Down
6 changes: 6 additions & 0 deletions @xen-orchestra/fs/src/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from '@aws-sdk/client-s3'
import { Upload } from '@aws-sdk/lib-storage'
import { NodeHttpHandler } from '@aws-sdk/node-http-handler'
import { getApplyMd5BodyChecksumPlugin } from '@aws-sdk/middleware-apply-body-checksum'
import assert from 'assert'
import { Agent as HttpAgent } from 'http'
import { Agent as HttpsAgent } from 'https'
Expand Down Expand Up @@ -75,6 +76,11 @@ export default class S3Handler extends RemoteHandlerAbstract {
}),
})

// Workaround for https://github.com/aws/aws-sdk-js-v3/issues/2673
this._s3.middlewareStack.use(
getApplyMd5BodyChecksumPlugin(this._s3.config)
)

const parts = split(path)
this._bucket = parts.shift()
this._dir = join(...parts)
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

- [VM/Host Console] Fix support of older versions of XCP-ng/XS, please not that HTTP proxies are note supported in that case [#6191](https://github.com/vatesfr/xen-orchestra/pull/6191)
- Fix HTTP proxy support to connect to pools (introduced in XO 5.69.0) [#6204](https://github.com/vatesfr/xen-orchestra/pull/6204)
- [Backup] Fix failure when sending a backup (Full/Delta/Metadata) to S3 with Object Lock enabled (PR [#6190](https://github.com/vatesfr/xen-orchestra/pull/6190))
ByScripts marked this conversation as resolved.
Show resolved Hide resolved

### Packages to release

Expand All @@ -38,6 +39,10 @@
- @vates/event-listeners-manager major
- xen-api minor
- xo-vmdk-to-vhd minor
- @xen-orchestra/fs patch
- @xen-orchestra/proxy patch
- @xen-orchestra/backups patch
- xo-server minor
- xo-web minor
- vhd-cli patch
- @xen-orchestra/backups-cli patch
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,16 @@
"@aws-sdk/util-utf8-node" "3.55.0"
tslib "^2.3.1"

"@aws-sdk/middleware-apply-body-checksum@^3.58.0":
version "3.58.0"
resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-apply-body-checksum/-/middleware-apply-body-checksum-3.58.0.tgz#f14b9c96f3cc9e567b49184ebda96db84317811f"
integrity sha512-sAdY2IbFFgCdhBdiY7CamlShgZrFuli1eVJF60yndqSyVM5hUvOg4fNsMqXWCSqJ83151T3yf/j7G78yfoSt9g==
dependencies:
"@aws-sdk/is-array-buffer" "3.55.0"
"@aws-sdk/protocol-http" "3.58.0"
"@aws-sdk/types" "3.55.0"
tslib "^2.3.1"

"@aws-sdk/middleware-bucket-endpoint@3.58.0":
version "3.58.0"
resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.58.0.tgz#cec84100ff776862e3bbd4bd596a1e869ad81e5e"
Expand Down