UBERF-9608 Fix ceph s3 upload (#8209)
Some checks failed
CI / build (push) Has been cancelled
CI / uitest (push) Has been cancelled
CI / uitest-pg (push) Has been cancelled
CI / uitest-qms (push) Has been cancelled
CI / uitest-workspaces (push) Has been cancelled
CI / svelte-check (push) Has been cancelled
CI / formatting (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker-build (push) Has been cancelled
CI / dist-build (push) Has been cancelled

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-03-12 10:39:30 +03:00 committed by GitHub
parent a06c0cc5b7
commit 07e9c31902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 11 deletions

View File

@ -136,9 +136,8 @@ export async function handleBlobDelete (
try {
await datalake.delete(ctx, workspace, name)
res.status(204).send()
} catch (err: any) {
const message = err instanceof Error ? err.message : String(err)
ctx.error('failed to delete blob', { message })
} catch (error: any) {
ctx.error('failed to delete blob', { error })
res.status(500).send()
}
}
@ -155,9 +154,8 @@ export async function handleBlobDeleteList (
try {
await datalake.delete(ctx, workspace, body.names)
res.status(204).send()
} catch (err: any) {
const message = err instanceof Error ? err.message : String(err)
ctx.error('failed to delete blobs', { message })
} catch (error: any) {
ctx.error('failed to delete blobs', { error })
res.status(500).send()
}
}
@ -174,9 +172,8 @@ export async function handleBlobSetParent (
try {
await datalake.setParent(ctx, workspace, name, parent)
res.status(204).send()
} catch (err: any) {
const message = err instanceof Error ? err.message : String(err)
ctx.error('failed to delete blob', { message })
} catch (error: any) {
ctx.error('failed to delete blob', { error })
res.status(500).send()
}
}
@ -229,7 +226,7 @@ export async function handleUploadFormData (
return { key, metadata }
} catch (err: any) {
const error = err instanceof Error ? err.message : String(err)
ctx.error('failed to upload blob', { error })
ctx.error('failed to upload blob', { error: err })
return { key, error }
}
})

View File

@ -102,7 +102,7 @@ class S3BucketImpl implements S3Bucket {
}
}
if (options.contentLength < 5 * 1024 * 1024) {
if (Buffer.isBuffer(body)) {
const result = await ctx.with('s3.putObject', {}, () => this.client.putObject(command))
return {

View File

@ -27,6 +27,7 @@ export interface S3Options {
export function createClient (opt: S3Options): S3 {
return new S3({
forcePathStyle: true,
endpoint: opt.endpoint,
credentials: {
accessKeyId: opt.accessKey,