{"record":{"id":"de4bfe2e11079983","repo":"vxcontrol/pentagi","slug":"entity-relationships-search-failed-w","errorCode":null,"errorMessage":"entity relationships search failed: %w","messagePattern":"entity relationships search failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/graphiti_search.go","lineNumber":435,"sourceCode":"\tvar edgeTypes *[]string\n\tif len(args.EdgeTypes) > 0 {\n\t\tedgeTypes = &args.EdgeTypes\n\t}\n\n\treq := graphiti.EntityRelationshipSearchRequest{\n\t\tQuery:          args.Query,\n\t\tGroupID:        &groupID,\n\t\tCenterNodeUUID: args.CenterNodeUUID,\n\t\tMaxDepth:       maxDepth,\n\t\tNodeLabels:     nodeLabels,\n\t\tEdgeTypes:      edgeTypes,\n\t\tMaxResults:     maxResults,\n\t\tObservation:    observationObject,\n\t}\n\n\tresp, err := t.graphitiClient.EntityRelationshipsSearch(ctx, req)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"entity relationships search failed: %w\", err)\n\t}\n\n\treturn FormatGraphitiEntityRelationshipResults(resp, args.Query), nil\n}\n\n// handleDiverseResultsSearch gets diverse, non-redundant results\nfunc (t *graphitiSearchTool) handleDiverseResultsSearch(\n\tctx context.Context,\n\tgroupID string,\n\targs GraphitiSearchAction,\n\tobservationObject *graphiti.Observation,\n) (string, error) {\n\tmaxResults := args.MaxResults.Int()\n\tif maxResults <= 0 {\n\t\tmaxResults = DefaultDiverseMaxResults\n\t}\n\n\tdiversityLevel := args.DiversityLevel.String()","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/graphiti_search.go#L417-L453","documentation":"Wrapper error returned when the Graphiti client's EntityRelationshipsSearch call fails (transport error, timeout, or server-side 5xx). The underlying cause is preserved via %w for errors.Is/As inspection. Like other upstream failures it is distinct from the argument-validation errors in the same handler.","triggerScenarios":"EntityRelationshipsSearch returns non-nil error: Graphiti unreachable, request timeout, or internal server error while traversing relationships.","commonSituations":"Graphiti service outage; network flakiness between PentAGI and the Graphiti container; Graphiti crashing on a very large traversal around a hub node.","solutions":["Retry after a short backoff if the wrapped cause is a transient transport error","Verify the Graphiti service is running and reachable","Check Graphiti server logs for the internal error","Reduce max_results to shrink the traversal if the failure correlates with large queries"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Validate arguments first so only genuine upstream failures reach the call\nif _, err := uuid.Parse(args.CenterNodeUUID); err != nil {\n    return err // don't hit the network with bad args\n}","typeGuard":null,"tryCatchPattern":"resp, err := client.EntityRelationshipsSearch(ctx, req)\nif err != nil {\n    var urlErr *url.Error\n    if errors.As(err, &urlErr) {\n        return retryWithBackoff(ctx, req)\n    }\n    return fmt.Errorf(\"entity relationships search failed: %w\", err)\n}","preventionTips":["Cap max_results to avoid heavy traversals on hub nodes","Monitor Graphiti health and restart policies","Apply exponential backoff for transient transport errors only"],"tags":["network","upstream","graphiti","retryable"],"backgroundTag":"upstream-request-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}