{"record":{"id":"c6b7bc42834bff9c","repo":"dagger/dagger","slug":"load-volume-known-hosts-w","errorCode":null,"errorMessage":"load volume known hosts: %w","messagePattern":"load volume known hosts: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/volume.go","lineNumber":111,"sourceCode":"\t\treturn dagql.ObjectResult[*core.Volume]{}, err\n\t}\n\tif !args.KnownHosts.Valid && !args.InsecureSkipHostKeyCheck {\n\t\treturn dagql.ObjectResult[*core.Volume]{}, fmt.Errorf(\"knownHosts is required unless insecureSkipHostKeyCheck is true\")\n\t}\n\n\tsrv, err := core.CurrentDagqlServer(ctx)\n\tif err != nil {\n\t\treturn dagql.ObjectResult[*core.Volume]{}, err\n\t}\n\tprivateKey, err := args.PrivateKey.Load(ctx, srv)\n\tif err != nil {\n\t\treturn dagql.ObjectResult[*core.Volume]{}, fmt.Errorf(\"load volume private key: %w\", err)\n\t}\n\tvar knownHosts dagql.ObjectResult[*core.Secret]\n\tif args.KnownHosts.Valid {\n\t\tknownHosts, err = args.KnownHosts.Value.Load(ctx, srv)\n\t\tif err != nil {\n\t\t\treturn dagql.ObjectResult[*core.Volume]{}, fmt.Errorf(\"load volume known hosts: %w\", err)\n\t\t}\n\t}\n\tvar serviceHost dagql.ObjectResult[*core.Service]\n\tif args.ExperimentalServiceHost.Valid {\n\t\tserviceHost, err = args.ExperimentalServiceHost.Value.Load(ctx, srv)\n\t\tif err != nil {\n\t\t\treturn dagql.ObjectResult[*core.Volume]{}, fmt.Errorf(\"load volume service host: %w\", err)\n\t\t}\n\t}\n\n\tvol := &core.Volume{\n\t\tBackend: core.VolumeBackendKindSSHFS,\n\t\tSSHFS: &core.SSHFSVolumeConfig{\n\t\t\tEndpoint:                 endpoint,\n\t\t\tPrivateKey:               privateKey,\n\t\t\tKnownHosts:               knownHosts,\n\t\t\tInsecureSkipHostKeyCheck: args.InsecureSkipHostKeyCheck,\n\t\t\tHostKeyAlias:             hostKeyAlias,","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/volume.go#L93-L129","documentation":"Raised in sshfsVolume when the optional knownHosts secret cannot be loaded from the dagql server (args.KnownHosts.Value.Load fails). Same mechanism as the private-key load error but for the SSH known-hosts pins secret.","triggerScenarios":"Calling Query.sshfsVolume with a valid-flagged knownHosts whose SecretID fails to resolve: ID from another session, deleted secret, or server fetch error.","commonSituations":"knownHosts secret created in a previous Dagger session; CI caching secret IDs across runs; mismatched engine instances.","solutions":["Re-set the knownHosts secret in the current session and pass the new ID","Confirm the SecretID originates from the same engine/session","Check the wrapped error for not-found vs permission causes","Guard creation order: setSecret before sshfsVolume"],"exampleFix":"// before\nsshfsVolume({ ..., knownHosts: cachedKnownHostsID }) // stale across sessions\n// after\nkh := client.setSecret(\"known-hosts\", sshKeyscanOutput)\nsshfsVolume({ ..., knownHosts: kh })","handlingStrategy":"validation","validationCode":"if (knownHostsId) { /* ensure it was produced by client.setSecret in this session */ }","typeGuard":null,"tryCatchPattern":"try { client.sshfsVolume({ knownHosts }) } catch (e) { if (String(e).includes('load volume known hosts')) { knownHosts = await client.setSecret('known-hosts', khText) /* retry */ } throw e }","preventionTips":["Set the knownHosts secret fresh in each session via setSecret","Keep a helper that runs ssh-keyscan + setSecret + sshfsVolume together","Don't cache SecretIDs in CI between jobs/runs"],"tags":["secret","sshfs","volume","known-hosts"],"backgroundTag":"secret-load-failed","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"}