{"id":"5da836381c27f70d","repo":"docker/cli","slug":"could-not-fetch-unlock-key-w-5da836","errorCode":null,"errorMessage":"could not fetch unlock key: %w","messagePattern":"could not fetch unlock key: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/swarm/update.go","lineNumber":70,"sourceCode":"\n\topts.mergeSwarmSpec(&sw.Swarm.Spec, flags, &sw.Swarm.ClusterInfo.TLSInfo.TrustRoot)\n\n\tcurAutoLock := sw.Swarm.Spec.EncryptionConfig.AutoLockManagers\n\n\t_, err = apiClient.SwarmUpdate(ctx, client.SwarmUpdateOptions{\n\t\tVersion: sw.Swarm.Version,\n\t\tSpec:    sw.Swarm.Spec,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, _ = fmt.Fprintln(dockerCLI.Out(), \"Swarm updated.\")\n\n\tif curAutoLock && !prevAutoLock {\n\t\tresp, err := apiClient.SwarmGetUnlockKey(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not fetch unlock key: %w\", err)\n\t\t}\n\t\tprintUnlockCommand(dockerCLI.Out(), resp.Key)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":52,"sourceCodeEnd":77,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/swarm/update.go#L52-L77","documentation":"Error \"could not fetch unlock key: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/swarm/update.go:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}