{"record":{"id":"9702aab0dd585d0e","repo":"dagger/dagger","slug":"host-service-proxy-client-q-not-found-for-client","errorCode":null,"errorMessage":"host service proxy client %q not found for client %q","messagePattern":"host service proxy client %q not found for client %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/server/session.go","lineNumber":1077,"sourceCode":"\tctx context.Context,\n\tid string,\n) (engineutil.SessionCaller, error) {\n\tif id == client.clientID && client.hostServiceProxyClientID != \"\" {\n\t\t// Synthetic nested clients (e.g. builtin dang evaluation) do not\n\t\t// establish their own session attachables. When host-backed services\n\t\t// such as git config are requested through the current client ID, fall\n\t\t// back to the explicit proxy client chain.\n\t\tif caller, ok := client.daggerSession.attachables.Lookup(id); ok {\n\t\t\treturn caller, nil\n\t\t}\n\n\t\tfor i := len(client.parents) - 1; i >= 0; i-- {\n\t\t\tparent := client.parents[i]\n\t\t\tif parent.clientID == client.hostServiceProxyClientID {\n\t\t\t\treturn parent.getHostServiceCaller(ctx, parent.clientID)\n\t\t\t}\n\t\t}\n\t\treturn nil, fmt.Errorf(\"host service proxy client %q not found for client %q\", client.hostServiceProxyClientID, client.clientID)\n\t}\n\n\treturn client.getClientCaller(ctx, id)\n}\n\nfunc (srv *Server) clientFromContext(ctx context.Context) (*daggerClient, error) {\n\tclientMetadata, err := engine.ClientMetadataFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get client metadata for session call: %w\", err)\n\t}\n\tclient, err := srv.clientFromIDs(clientMetadata.SessionID, clientMetadata.ClientID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn client, nil\n}\n\nfunc (srv *Server) clientFromIDs(sessID, clientID string) (*daggerClient, error) {","sourceCodeStart":1059,"sourceCodeEnd":1095,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/engine/server/session.go#L1059-L1095","documentation":"getHostServiceCaller walks the client's parent chain looking for a parent whose clientID equals the client's hostServiceProxyClientID, to route host-service calls through the proxy client. If no such parent exists in the chain, this error is returned.","triggerScenarios":"A client performs a host-service call, client.hostServiceProxyClientID is set, but no parent in client.parents has that clientID — the proxy parent disconnected, was never registered, or the chain was pruned.","commonSituations":"Nested function calls where an intermediate parent session exited/cancelled before the child made a host call, custom SDK harnesses that build client chains incorrectly, or race between parent teardown and child host-service usage.","solutions":["Re-run the pipeline so a fresh parent chain including the host-service proxy client is established","Ensure parent sessions stay alive for the duration of child host-service calls","Check for early cancellation of the parent session in your workflow","If reproducible in a supported setup, report as an engine bug with session/parent IDs from the message"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Go: ensure parent sessions outlive child operations\n// structure code so parent queries aren't cancelled before children finish\nerrGroup, ctx := errgroup.WithContext(baseCtx) // propagate cancellation carefully","typeGuard":null,"tryCatchPattern":"// Go\nif err != nil && strings.Contains(err.Error(), \"host service proxy client\") {\n    // re-establish the session and retry the operation\n}","preventionTips":["Keep parent sessions alive for the duration of nested calls","Avoid cancelling parent contexts while children use host services","Let the SDK manage client chains rather than building custom ones"],"tags":["engine","session","host-service","parent-chain"],"backgroundTag":"host-service-proxy-client-not-found","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}