{"record":{"id":"024afc6dd196cce6","repo":"hcengineering/platform","slug":"invalid-upload-id","errorCode":null,"errorMessage":"Invalid upload id","messagePattern":"Invalid upload id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"services/datalake/pod-datalake/src/handlers/multipart.ts","lineNumber":162,"sourceCode":"    return\n  }\n\n  const { bucket } = await datalake.selectStorage(ctx, workspace)\n  await bucket.abortMultipartUpload(ctx, uuid, { uploadId })\n\n  ctx.info('multipart-abort', { workspace, name, uuid, uploadId })\n\n  res.status(204).send()\n}\n\nfunction formatUploadId (uuid: string, uploadId: string): string {\n  return `${uuid}/${uploadId}`\n}\n\nfunction parseUploadId (value: string): { uuid: string, uploadId: string } {\n  const [uuid, uploadId] = value.split('/')\n  if (uuid == null || uploadId == null) {\n    throw new Error('Invalid upload id')\n  }\n  return { uuid, uploadId }\n}\n","sourceCodeStart":144,"sourceCodeEnd":166,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/services/datalake/pod-datalake/src/handlers/multipart.ts#L144-L166","documentation":"parseUploadId splits the upload id path value on '/' and requires both a uuid and an uploadId segment; if either is missing it throws Error('Invalid upload id'). Multipart upload part/complete/abort handlers depend on this format.","triggerScenarios":"Calling handleMultipartUploadPart, handleMultipartUploadComplete, or handleMultipartUploadAbort with an id string lacking the 'uuid/uploadId' shape — e.g. no slash, empty segments, or only one segment.","commonSituations":"Client truncates the upload id; URL decoding strips or mangles the '/'; older API versions returned ids in a different format; manual construction of the id string.","solutions":["Send/derive the upload id exactly as '<uuid>/<uploadId>' as returned by the multipart upload initiation response","Log the raw id value before parsing to spot missing segments or encoding issues","Check for double URL-encoding that corrupts the '/' separator","Align client code with the current multipart API response format after version upgrades"],"exampleFix":"// before\nconst id = uploadIdOnly // 'abc123'\n// after\nconst id = `${uuid}/${uploadId}` // '9f8e.../abc123'","handlingStrategy":"validation","validationCode":"function isWellFormedUploadId(id: string): boolean {\n  const [uuid, uploadId] = id.split('/')\n  return uuid != null && uuid.length > 0 && uploadId != null && uploadId.length > 0\n}\nif (!isWellFormedUploadId(rawUploadId)) throw new Error(`Malformed upload id: '${rawUploadId}'`)","typeGuard":"function isUploadId(v: string): v is `${string}/${string}` {\n  const [a, b] = v.split('/')\n  return a != null && b != null\n}","tryCatchPattern":"try {\n  await datalake.uploadPart(rawId, part)\n} catch (err) {\n  if (/Invalid upload id/.test(String(err.message))) {\n    // re-fetch the upload id from the initiate-upload response\n  } else throw err\n}","preventionTips":["Always use the id string verbatim from the initiate-multipart-upload response","Avoid double URL-encoding of ids containing '/'","Assert the '<uuid>/<uploadId>' shape client-side before upload calls"],"tags":["parsing","validation","multipart-upload"],"backgroundTag":"invalid-identifier-format","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}