{"record":{"id":"ed747173c330910a","repo":"vxcontrol/pentagi","slug":"failed-to-get-flow-screenshot-w","errorCode":null,"errorMessage":"failed to get flow screenshot: %w","messagePattern":"failed to get flow screenshot: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/controller/flow.go","lineNumber":1250,"sourceCode":"\n\ttlw, err := cnts.tlc.GetFlowTermLog(ctx, flowID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get flow term log: %w\", err)\n\t}\n\n\tvslw, err := cnts.vslc.GetFlowVectorStoreLog(ctx, flowID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get flow vector store log: %w\", err)\n\t}\n\n\ttclw, err := cnts.tclc.GetFlowToolCallLog(ctx, flowID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get flow tool call log: %w\", err)\n\t}\n\n\tsw, err := cnts.sc.GetFlowScreenshot(ctx, flowID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get flow screenshot: %w\", err)\n\t}\n\n\treturn &flowProviderWorkers{\n\t\tmlw:  mlw,\n\t\talw:  alw,\n\t\tslw:  slw,\n\t\ttlw:  tlw,\n\t\tvslw: vslw,\n\t\ttclw: tclw,\n\t\tsw:   sw,\n\t}, nil\n}\n","sourceCodeStart":1232,"sourceCodeEnd":1263,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/controller/flow.go#L1232-L1263","documentation":"Wraps a failure from cnts.sc.GetFlowScreenshot(ctx, flowID) — the screenshot worker could not be created while assembling flowProviderWorkers. Cause preserved via %w; this is the final fetch step before the bundle is returned.","triggerScenarios":"Flow log retrieval where the screenshot storage lookup for flowID fails or the screenshot container/backend errors.","commonSituations":"Screenshot storage (DB/blob store) unavailable; flow deleted before screenshots were persisted; storage misconfiguration in environment.","solutions":["Check the wrapped cause to identify whether it is storage (DB/blob) related.","Verify the flowID exists and screenshots were persisted for it.","Check screenshot storage configuration/env vars and connectivity.","Retry on transient storage errors."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var exists bool\nerr := db.QueryRow(\"SELECT EXISTS(SELECT 1 FROM flows WHERE id=$1)\", flowID).Scan(&exists)\nif err != nil || !exists { /* abort with 404 */ }","typeGuard":"func isScreenshotError(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"failed to get flow screenshot\")\n}","tryCatchPattern":"sw, err := cnts.sc.GetFlowScreenshot(ctx, flowID)\nif err != nil {\n\tif isTransient(err) { /* retry */ }\n\treturn nil, fmt.Errorf(\"failed to get flow screenshot: %w\", err)\n}","preventionTips":["Verify screenshot storage config/env vars at startup.","Confirm screenshots are persisted before exposing the flow detail endpoint.","Check storage backend connectivity in health checks.","Retry transient storage failures with backoff."],"tags":["storage","screenshots","error-wrapping"],"backgroundTag":"data-source-query-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}