vxcontrol/pentagi · error
failed to get flow term log: %w
Error message
failed to get flow term log: %w
What it means
Wraps a failure from cnts.tlc.GetFlowTermLog(ctx, flowID) — the terminal-log worker could not be created for the flow. Returned with %w so the root cause (DB/service error) remains inspectable. Assembly of flowProviderWorkers stops at this point.
Source
Thrown at backend/pkg/controller/flow.go:1235
) (*flowProviderWorkers, error) {
alw, err := cnts.alc.GetFlowAgentLog(ctx, flowID)
if err != nil {
return nil, fmt.Errorf("failed to get flow agent log: %w", err)
}
mlw, err := cnts.mlc.GetFlowMsgLog(ctx, flowID)
if err != nil {
return nil, fmt.Errorf("failed to get flow msg log: %w", err)
}
slw, err := cnts.slc.GetFlowSearchLog(ctx, flowID)
if err != nil {
return nil, fmt.Errorf("failed to get flow search log: %w", err)
}
tlw, err := cnts.tlc.GetFlowTermLog(ctx, flowID)
if err != nil {
return nil, fmt.Errorf("failed to get flow term log: %w", err)
}
vslw, err := cnts.vslc.GetFlowVectorStoreLog(ctx, flowID)
if err != nil {
return nil, fmt.Errorf("failed to get flow vector store log: %w", err)
}
tclw, err := cnts.tclc.GetFlowToolCallLog(ctx, flowID)
if err != nil {
return nil, fmt.Errorf("failed to get flow tool call log: %w", err)
}
sw, err := cnts.sc.GetFlowScreenshot(ctx, flowID)
if err != nil {
return nil, fmt.Errorf("failed to get flow screenshot: %w", err)
}
return &flowProviderWorkers{View on GitHub (pinned to ea665308ba)
Solutions
- Check the wrapped cause for the specific storage error.
- Validate the flowID exists and has not been deleted.
- Ensure migrations creating terminal-log tables have run.
- Retry transient failures; verify DB health.
Defensive patterns
Strategy: try-catch
Validate before calling
var exists bool
err := db.QueryRow("SELECT EXISTS(SELECT 1 FROM flows WHERE id=$1)", flowID).Scan(&exists)
if err != nil || !exists { /* abort with 404 */ } Type guard
func isTermLogError(err error) bool {
return err != nil && strings.Contains(err.Error(), "failed to get flow term log")
} Try / catch
tlw, err := cnts.tlc.GetFlowTermLog(ctx, flowID)
if err != nil {
if errors.Is(err, sql.ErrNoRows) { /* return empty log */ }
return nil, fmt.Errorf("failed to get flow term log: %w", err)
} Prevention
- Check flow existence before log retrieval.
- Ensure terminal-log migrations have run.
- Watch for flow deletion races; use soft deletes if needed.
- Retry transient connection errors.
When it happens
Trigger: Retrieving flow logs when the terminal-log store lookup for flowID fails (missing rows/connection error).
Common situations: Terminal session data purged or flow deleted; DB unreachable; migration drift missing terminal-log tables.
Related errors
- failed to get flow msg log: %w
- failed to get flow search log: %w
- failed to get flow vector store log: %w
- failed to get flow tool call log: %w
- failed to get search log: %w
AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01).
Data as JSON: /api/errors/33adb24c9d5542f6.
Report an issue: GitHub.