hcengineering/platform · error · DatalakeError
Upload failed:
Error message
Upload failed:
What it means
After a successful form-data upload, the single BlobUploadResult is checked for an 'error' field; if present, DatalakeError('Upload failed: <server error>') is thrown with the server-provided reason.
Source
Thrown at foundations/server/packages/datalake/src/client.ts:294
form.append('file', file)
const response = await fetchSafe(ctx, url, {
method: 'POST',
body: form as unknown as BodyInit,
headers: {
...this.headers
}
})
const result = (await response.json()) as BlobUploadResult[]
if (result.length !== 1) {
throw new DatalakeError('Bad datalake response: ' + result.toString())
}
const uploadResult = result[0]
if ('error' in uploadResult) {
throw new DatalakeError('Upload failed: ' + uploadResult.error)
}
return uploadResult.metadata
}
async uploadWithMultipart (
ctx: MeasureContext,
workspace: WorkspaceUuid,
objectName: string,
stream: Readable | Buffer | string,
params: UploadObjectParams
): Promise<ObjectMetadata> {
const chunkSize = 10 * 1024 * 1024
const multipart = await this.multipartUploadStart(ctx, workspace, objectName, params)
try {
const parts: MultipartUploadPart[] = []View on GitHub (pinned to 63e28dc964)
Solutions
- Read the server error appended in the message and fix the underlying cause (permissions, quota, name)
- Retry the upload with a valid objectName
- Check datalake server logs for the corresponding upload failure
Defensive patterns
Strategy: try-catch
Type guard
function isUploadOk(r: BlobUploadResult): boolean {
return !('error' in r)
} Try / catch
try {
await client.putObject(ctx, workspace, objectName, stream)
} catch (err) {
if (err instanceof DatalakeError && err.message.startsWith('Upload failed:')) {
const reason = err.message.slice('Upload failed: '.length)
// act on server-provided reason (permissions, quota, name)
} else throw err
} Prevention
- Verify workspace/container permissions before uploads
- Respect object naming policies to avoid server-side rejections
- Monitor server-side storage capacity and quotas
When it happens
Trigger: The datalake accepted the request but the per-blob upload result carries an error — e.g. bucket/workspace permissions, quota exceeded, name conflicts, or backend write failure.
Common situations: Insufficient permissions on the target workspace/container; object name policy violations; disk-full or backend storage errors server-side.
Related errors
- err.message?.length > 0 ? err.message : 'Internal Server Err
- result.error
- Network error ${error}
- await response.text()
- Storage error ${error.error}
AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29).
Data as JSON: /api/errors/b4e9d24b8316f1e1.
Report an issue: GitHub.