Skip to content

Commit 07e9c31

Browse files
authored
UBERF-9608 Fix ceph s3 upload (#8209)
Signed-off-by: Alexander Onnikov <[email protected]>
1 parent a06c0cc commit 07e9c31

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

services/datalake/pod-datalake/src/handlers/blob.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ export async function handleBlobDelete (
136136
try {
137137
await datalake.delete(ctx, workspace, name)
138138
res.status(204).send()
139-
} catch (err: any) {
140-
const message = err instanceof Error ? err.message : String(err)
141-
ctx.error('failed to delete blob', { message })
139+
} catch (error: any) {
140+
ctx.error('failed to delete blob', { error })
142141
res.status(500).send()
143142
}
144143
}
@@ -155,9 +154,8 @@ export async function handleBlobDeleteList (
155154
try {
156155
await datalake.delete(ctx, workspace, body.names)
157156
res.status(204).send()
158-
} catch (err: any) {
159-
const message = err instanceof Error ? err.message : String(err)
160-
ctx.error('failed to delete blobs', { message })
157+
} catch (error: any) {
158+
ctx.error('failed to delete blobs', { error })
161159
res.status(500).send()
162160
}
163161
}
@@ -174,9 +172,8 @@ export async function handleBlobSetParent (
174172
try {
175173
await datalake.setParent(ctx, workspace, name, parent)
176174
res.status(204).send()
177-
} catch (err: any) {
178-
const message = err instanceof Error ? err.message : String(err)
179-
ctx.error('failed to delete blob', { message })
175+
} catch (error: any) {
176+
ctx.error('failed to delete blob', { error })
180177
res.status(500).send()
181178
}
182179
}
@@ -229,7 +226,7 @@ export async function handleUploadFormData (
229226
return { key, metadata }
230227
} catch (err: any) {
231228
const error = err instanceof Error ? err.message : String(err)
232-
ctx.error('failed to upload blob', { error })
229+
ctx.error('failed to upload blob', { error: err })
233230
return { key, error }
234231
}
235232
})

services/datalake/pod-datalake/src/s3/bucket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class S3BucketImpl implements S3Bucket {
102102
}
103103
}
104104

105-
if (options.contentLength < 5 * 1024 * 1024) {
105+
if (Buffer.isBuffer(body)) {
106106
const result = await ctx.with('s3.putObject', {}, () => this.client.putObject(command))
107107

108108
return {

services/datalake/pod-datalake/src/s3/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface S3Options {
2727

2828
export function createClient (opt: S3Options): S3 {
2929
return new S3({
30+
forcePathStyle: true,
3031
endpoint: opt.endpoint,
3132
credentials: {
3233
accessKeyId: opt.accessKey,

0 commit comments

Comments
 (0)