{"record":{"id":"8343f601f496ef43","repo":"apache/beam","slug":"the-specified-upload-does-not-exist","errorCode":null,"errorMessage":"The specified upload does not exist","messagePattern":"The specified upload does not exist","errorType":"http","errorClass":"S3ClientError","httpStatus":404,"severity":"error","filePath":"sdks/python/apache_beam/io/aws/clients/s3/fake_client.py","lineNumber":196,"sourceCode":"    self.add_file(dest_file)\n\n  def create_multipart_upload(self, request):\n    # Create hash of bucket and key\n    # Store upload_id internally\n    upload_id = request.bucket + request.object\n    self.multipart_uploads[upload_id] = {}\n    return messages.UploadResponse(upload_id)\n\n  def upload_part(self, request):\n    # Save off bytes passed to internal data store\n    upload_id, part_number = request.upload_id, request.part_number\n\n    if part_number < 0 or not isinstance(part_number, int):\n      raise messages.S3ClientError(\n          'Param validation failed on part number', 400)\n\n    if upload_id not in self.multipart_uploads:\n      raise messages.S3ClientError('The specified upload does not exist', 404)\n\n    self.multipart_uploads[upload_id][part_number] = request.bytes\n\n    etag = '\"%s\"' % ('x' * 32)\n    return messages.UploadPartResponse(etag, part_number)\n\n  def complete_multipart_upload(self, request):\n    MIN_PART_SIZE = 5 * 2**10  # 5 KiB\n\n    parts_received = self.multipart_uploads[request.upload_id]\n\n    # Check that we got all the parts that they intended to send\n    part_numbers_to_confirm = set(part['PartNumber'] for part in request.parts)\n\n    # Make sure all the expected parts are present\n    if part_numbers_to_confirm != set(parts_received.keys()):\n      raise messages.S3ClientError(\n          'One or more of the specified parts could not be found', 400)","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/aws/clients/s3/fake_client.py#L178-L214","documentation":"FakeS3Client.upload_part raises S3ClientError('The specified upload does not exist', 404) when the request's upload_id is not a key in the fake's multipart_uploads dict. It mirrors a 404 NoSuchUpload from real S3.","triggerScenarios":"Calling upload_part with an upload_id never created by create_multipart_upload, already completed/aborted, or mistyped/reconstructed differently.","commonSituations":"Test aborts an upload then still sends parts; upload_id stored/retrieved from a different variable; exception during create_multipart_upload swallowed, leaving parts to be uploaded against a stale ID.","solutions":["Create the multipart upload first and use the returned upload_id for all parts","Ensure no complete_multipart_upload/abort happens before all upload_part calls","Keep the upload_id from create_multipart_upload in a variable rather than retyping it","Check for swallowed exceptions during upload creation in test setup"],"exampleFix":"// before\nupload_id = 'hardcoded-id'\nfake_client.upload_part(messages.UploadPartRequest(upload_id, 1, b'data'))\n// after\nupload_id = fake_client.create_multipart_upload('bucket', 'key').upload_id\nfake_client.upload_part(messages.UploadPartRequest(upload_id, 1, b'data'))","handlingStrategy":"try-catch","validationCode":"assert upload_id in fake_client.multipart_uploads, f'upload {upload_id} not created/already completed'","typeGuard":null,"tryCatchPattern":"try:\n    fake_client.upload_part(req)\nexcept messages.S3ClientError as e:\n    if e.code == 404 and 'upload does not exist' in e.message:\n        ...  # recreate or fail test with a clear message\n    else:\n        raise","preventionTips":["Always capture upload_id from create_multipart_upload's response","Never complete/abort an upload before all parts are sent","Don't hardcode upload IDs in tests","Check that create_multipart_upload actually succeeded before uploading parts"],"tags":["aws","s3","multipart-upload"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}