vxcontrol/pentagi · error
failed to create flow screenshot: %w
Error message
failed to create flow screenshot: %w
What it means
Final step of newFlowProviderWorkers: the screenshot worker is created via cnts.sc.NewFlowScreenshot(ctx, flowID, pub). Failure wrapped with this message aborts flow startup — screenshots captured by browser tooling could not be wired to persistent storage for this flow.
Source
Thrown at backend/pkg/controller/flow.go:1199
tlw, err := cnts.tlc.NewFlowTermLog(ctx, flowID, pub)
if err != nil {
return nil, fmt.Errorf("failed to create flow term log: %w", err)
}
vslw, err := cnts.vslc.NewFlowVectorStoreLog(ctx, flowID, pub)
if err != nil {
return nil, fmt.Errorf("failed to create flow vector store log: %w", err)
}
tclw, err := cnts.tclc.NewFlowToolCallLog(ctx, flowID, pub)
if err != nil {
return nil, fmt.Errorf("failed to create flow tool call log: %w", err)
}
sw, err := cnts.sc.NewFlowScreenshot(ctx, flowID, pub)
if err != nil {
return nil, fmt.Errorf("failed to create flow screenshot: %w", err)
}
return &flowProviderWorkers{
mlw: mlw,
alw: alw,
slw: slw,
tlw: tlw,
vslw: vslw,
tclw: tclw,
sw: sw,
}, nil
}
func getFlowProviderWorkers(
ctx context.Context,
flowID int64,
cnts *flowProviderControllers,
) (*flowProviderWorkers, error) {View on GitHub (pinned to ea665308ba)
Solutions
- Check the wrapped error and backend logs for the storage/DB failure
- Verify the screenshot storage backend configuration and that its table/bucket exists
- Confirm DB connectivity and retry flow creation
- Ensure the flow row exists (rule out concurrent deletion)
Example fix
// before: screenshot storage path not validated at startup
sw, err := cnts.sc.NewFlowScreenshot(ctx, flowID, pub)
if err != nil { return nil, fmt.Errorf("failed to create flow screenshot: %w", err) }
// after: pre-validate storage dir/config before creating workers
if err := ensureScreenshotStorage(ctx, cfg); err != nil {
return nil, fmt.Errorf("screenshot storage unavailable: %w", err)
}
sw, err = cnts.sc.NewFlowScreenshot(ctx, flowID, pub)
if err != nil {
return nil, fmt.Errorf("failed to create flow screenshot (flow=%d): %w", flowID, err)
} Defensive patterns
Strategy: validation
Validate before calling
if fi, err := os.Stat(cfg.ScreenshotStoragePath); err != nil || !fi.IsDir() {
return errors.New("screenshot storage path missing or not a directory")
} Type guard
func hasValidFlowID(flowID int64) bool { return flowID > 0 } Try / catch
sw, err := cnts.sc.NewFlowScreenshot(ctx, flowID, pub)
if err != nil {
return nil, fmt.Errorf("failed to create flow screenshot (flow=%d): %w", flowID, err)
} Prevention
- Validate screenshot storage config (path/table) at application boot, not per-flow
- Keep DB migrations current so the screenshot storage table exists
- Check disk space/permissions on the storage volume
- Confirm flow existence before the final worker-creation step
When it happens
Trigger: NewFlowScreenshot fails during flow startup — DB error initializing the screenshot storage record for the flow, invalid flowID, or context cancellation after all earlier worker steps.
Common situations: DB outage or pool exhaustion at flow creation; screenshot storage table/blob path misconfigured or missing; flow deleted concurrently; ctx deadline exceeded due to slow earlier steps.
Related errors
- failed to create flow agent log: %w
- failed to create flow msg log: %w
- failed to create flow search log: %w
- failed to create flow term log: %w
- failed to create flow vector store log: %w
AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01).
Data as JSON: /api/errors/c72bde31f4bf5a10.
Report an issue: GitHub.