{"record":{"id":"e4050064addd4a37","repo":"remotion-dev/remotion","slug":"could-not-read-progress-for-render-q-w","errorCode":null,"errorMessage":"could not read progress for render %q: %w","messagePattern":"could not read progress for render %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/lambda-go/s3.go","lineNumber":86,"sourceCode":"func inputPropsKey(hash string) string {\n\treturn fmt.Sprintf(\"input-props/%s.json\", hash)\n}\n\nfunc overallProgressKey(renderId string) string {\n\treturn fmt.Sprintf(\"renders/%s/progress.json\", renderId)\n}\n\nfunc cancellationKey(renderId string) string {\n\treturn fmt.Sprintf(\"renders/%s/cancel.json\", renderId)\n}\n\nfunc cancelRenderOnLambda(client cancellationObjectClient, input CancelRenderOnLambdaInput) error {\n\tprogressObject, err := client.GetObject(context.TODO(), &s3.GetObjectInput{\n\t\tBucket: new(input.BucketName),\n\t\tKey:    new(overallProgressKey(input.RenderId)),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not read progress for render %q: %w\", input.RenderId, err)\n\t}\n\tdefer progressObject.Body.Close()\n\n\tprogressBody, err := io.ReadAll(progressObject.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not read progress for render %q: %w\", input.RenderId, err)\n\t}\n\n\tvar progress struct {\n\t\tCancellationEnabled bool `json:\"cancellationEnabled\"`\n\t}\n\tif err := json.Unmarshal(progressBody, &progress); err != nil {\n\t\treturn fmt.Errorf(\"could not parse progress for render %q: %w\", input.RenderId, err)\n\t}\n\tif !progress.CancellationEnabled {\n\t\treturn fmt.Errorf(\"cannot cancel render %s: the render was not started with enableCancellation: true\", input.RenderId)\n\t}\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/lambda-go/s3.go#L68-L104","documentation":"Go client error from cancelRenderOnLambda: the initial S3 GetObject for `renders/<renderId>/progress.json` failed, and the underlying S3 error (wrapped with %w) explains why — most often NoSuchKey because no render with that ID ever wrote progress to this bucket.","triggerScenarios":"CancelRenderOnLambda with a wrong or mistyped RenderId, a render in a different bucket (BucketName mismatch), or an S3/permissions problem on GetObject (AccessDenied is wrapped the same way).","commonSituations":"Persisting render IDs and later cancelling against a different environment/bucket; render finished and its files were already cleaned up; wrong region endpoint or credentials.","solutions":["Unwrap the error (errors.Is/As on the smithy APIError) to distinguish NoSuchKey (wrong renderId/bucket) from AccessDenied (IAM).","Verify RenderId matches the one returned by StartRenderOnLambda and BucketName is the same bucket the render wrote to.","For AccessDenied, grant the caller s3:GetObject on the bucket's renders/* prefix.","If the render already finished, treat cancellation as a no-op success in your orchestration code."],"exampleFix":" // before\nerr := client.CancelRenderOnLambda(ctx, input)\n\n// after: distinguish missing progress from other failures\nvar apiErr smithy.APIError\nif errors.As(err, &apiErr) && apiErr.ErrorCode() == \"NoSuchKey\" {\n    // render not found in this bucket: nothing to cancel\n    return nil\n}","handlingStrategy":"try-catch","validationCode":"// Confirm the progress object exists before cancelling\n_, err := client.HeadObject(ctx, &s3.HeadObjectInput{\n  Bucket: ptr(bucketName),\n  Key:    ptr(fmt.Sprintf(\"renders/%s/progress.json\", renderId)),\n})\nif err != nil { /* render unknown/finished: skip cancel */ }","typeGuard":"var notFound *types.NoSuchKey\nisRenderProgressMissing := func(err error) bool {\n  var apiErr smithy.APIError\n  return errors.As(err, &apiErr) && apiErr.ErrorCode() == \"NoSuchKey\"\n}","tryCatchPattern":"if err := client.CancelRenderOnLambda(ctx, input); err != nil {\n  var apiErr smithy.APIError\n  if errors.As(err, &apiErr) && apiErr.ErrorCode() == \"NoSuchKey\" {\n    // no such render in this bucket: treat as already finished\n    return nil\n  }\n  return fmt.Errorf(\"cancel render: %w\", err)\n}","preventionTips":["Store (renderId, bucket) pairs together at start time so cancels always target the right bucket.","Treat NoSuchKey on cancel as a benign terminal state in orchestration code.","Grant the cancelling role s3:GetObject on renders/*."],"tags":["go","s3","cancellation","lambda"],"backgroundTag":"s3-object-not-found","analyzedSha":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}