{"record":{"id":"74381a14d969d40e","repo":"micro/go-micro","slug":"video-generation-failed-s","errorCode":null,"errorMessage":"video generation failed: %s","messagePattern":"video generation failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ai/atlascloud/atlascloud.go","lineNumber":1172,"sourceCode":"\tvar pollResp struct {\n\t\tData struct {\n\t\t\tStatus  string   `json:\"status\"`\n\t\t\tOutputs []string `json:\"outputs\"`\n\t\t\tError   string   `json:\"error\"`\n\t\t} `json:\"data\"`\n\t}\n\tif err := json.Unmarshal(body, &pollResp); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse poll response: %w\", err)\n\t}\n\n\tswitch pollResp.Data.Status {\n\tcase \"completed\", \"succeeded\":\n\t\tif len(pollResp.Data.Outputs) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"video completed but no outputs returned\")\n\t\t}\n\t\treturn &ai.VideoResponse{URL: pollResp.Data.Outputs[0]}, nil\n\tcase \"failed\":\n\t\treturn nil, fmt.Errorf(\"video generation failed: %s\", pollResp.Data.Error)\n\tdefault:\n\t\treturn nil, nil\n\t}\n}\n","sourceCodeStart":1154,"sourceCodeEnd":1177,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/ai/atlascloud/atlascloud.go#L1154-L1177","documentation":"The AtlasCloud video job reached terminal status 'failed' and the library surfaces the provider-supplied error text (pollResp.Data.Error) wrapped in this message. It means the generation itself failed upstream; the library is relaying the remote failure. The %s portion contains the provider's reason string.","triggerScenarios":"Calling video generation and polling a job whose poll response reported status == \"failed\"; the message includes pollResp.Data.Error verbatim.","commonSituations":"Content-policy rejections of the prompt; unsupported parameter combinations (resolution/duration); insufficient provider credits or quota; model-specific capacity issues.","solutions":["Read the %s suffix for the provider's failure reason and address it (rephrase prompt, adjust parameters).","Verify account quota/credits with AtlasCloud if the reason indicates limits or billing.","Retry with simplified or safer prompt content if the reason suggests policy rejection.","Check requested model/parameters against current API docs for validity."],"exampleFix":"// before\nresp, err := provider.GenerateVideo(ctx, req)\nif err != nil { log.Fatal(err) }\n// after\nresp, err := provider.GenerateVideo(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"video generation failed:\") {\n        reason := strings.TrimPrefix(err.Error(), \"video generation failed: \")\n        log.Printf(\"provider rejected job: %s\", reason)\n    }\n    return err\n}","handlingStrategy":"try-catch","validationCode":"if err := validatePromptForPolicy(req.Prompt); err != nil {\n    return fmt.Errorf(\"prompt likely rejected: %w\", err)\n}","typeGuard":"func isProviderJobFailure(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"video generation failed:\")\n}","tryCatchPattern":"video, err := provider.GenerateVideo(ctx, req)\nif err != nil {\n    if isProviderJobFailure(err) {\n        reason := strings.TrimPrefix(err.Error(), \"video generation failed: \")\n        log.Printf(\"job rejected by provider: %s\", reason)\n        return fmt.Errorf(\"video job failed upstream: %s\", reason)\n    }\n    return err\n}","preventionTips":["Pre-screen prompts for policy-sensitive content before submitting","Keep request parameters within documented model limits","Monitor provider quota/credits programmatically","Do not blind-retry 'failed' jobs — read the reason first"],"tags":["video-generation","provider-error","atlascloud","remote-failure"],"backgroundTag":"provider-job-failed","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}