micro/go-micro · error

video completed but no outputs returned

Error message

video completed but no outputs returned

What it means

AtlasCloud's video polling loop detected a terminal 'completed'/'succeeded' status, but the poll response's Outputs array was empty, so there is no video URL to return. The library treats an empty outputs list on a successful status as an inconsistent API response rather than silently returning an empty result. This surfaces from the video generation polling path after the job finished.

Source

Thrown at ai/atlascloud/atlascloud.go:1168

	defer httpResp.Body.Close()

	body, _ := io.ReadAll(httpResp.Body)

	var pollResp struct {
		Data struct {
			Status  string   `json:"status"`
			Outputs []string `json:"outputs"`
			Error   string   `json:"error"`
		} `json:"data"`
	}
	if err := json.Unmarshal(body, &pollResp); err != nil {
		return nil, fmt.Errorf("failed to parse poll response: %w", err)
	}

	switch pollResp.Data.Status {
	case "completed", "succeeded":
		if len(pollResp.Data.Outputs) == 0 {
			return nil, fmt.Errorf("video completed but no outputs returned")
		}
		return &ai.VideoResponse{URL: pollResp.Data.Outputs[0]}, nil
	case "failed":
		return nil, fmt.Errorf("video generation failed: %s", pollResp.Data.Error)
	default:
		return nil, nil
	}
}

View on GitHub (pinned to 24529f1404)

Solutions

  1. Retry the whole generation job; this is usually a provider-side data inconsistency, not a client bug.
  2. Log the full pollResp.Data payload (add temporary debugging or check API docs) to see if outputs moved to another field.
  3. Check the AtlasCloud API changelog for changes to the poll response schema or outputs field.
  4. Add a short re-poll with backoff before failing, in case outputs populate shortly after the status flips to completed.

Example fix

// before
if len(pollResp.Data.Outputs) == 0 {
    return nil, fmt.Errorf("video completed but no outputs returned")
}
// after
if len(pollResp.Data.Outputs) == 0 {
    // optionally re-poll once before giving up
    return nil, fmt.Errorf("video completed but no outputs returned (status=%s, job=%s)", pollResp.Data.Status, jobID)
}
Defensive patterns

Strategy: validation

Validate before calling

if len(resp.Outputs()) == 0 && resp.Status() == "completed" {
    // treat as provider inconsistency; re-run or alert before using the result
}

Type guard

func hasVideoURL(r *ai.VideoResponse) bool { return r != nil && r.URL != "" }

Try / catch

video, err := provider.GenerateVideo(ctx, req)
if err != nil {
    if strings.Contains(err.Error(), "video completed but no outputs returned") {
        video, err = provider.GenerateVideo(ctx, req) // one retry
    }
    if err != nil { return err }
}

Prevention

When it happens

Trigger: Polling an AtlasCloud video generation job whose status became 'completed' or 'succeeded' while pollResp.Data.Outputs contained zero entries.

Common situations: Provider-side retention issues where the output URL expired or was purged before polling; API contract changes to the outputs field name; model variants that deliver results via a different field; transient backend glitches after job completion.

Related errors


AI-assisted analysis of micro/go-micro@24529f1404 (2026-09-01). Data as JSON: /api/errors/d1ff531e50e79811. Report an issue: GitHub.