{"id":"4fc4139644736977","repo":"docker/cli","slug":"secret-not-found-s","errorCode":null,"errorMessage":"secret not found: %s","messagePattern":"secret not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/parse.go","lineNumber":50,"sourceCode":"\t}\n\n\tres, err := apiClient.SecretList(ctx, client.SecretListOptions{\n\t\tFilters: args,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfoundSecrets := make(map[string]string)\n\tfor _, secret := range res.Items {\n\t\tfoundSecrets[secret.Spec.Annotations.Name] = secret.ID\n\t}\n\n\taddedSecrets := make([]*swarm.SecretReference, 0, len(secretRefs))\n\tfor _, ref := range secretRefs {\n\t\tid, ok := foundSecrets[ref.SecretName]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"secret not found: %s\", ref.SecretName)\n\t\t}\n\n\t\t// set the id for the ref to properly assign in swarm\n\t\t// since swarm needs the ID instead of the name\n\t\tref.SecretID = id\n\t\taddedSecrets = append(addedSecrets, ref)\n\t}\n\n\treturn addedSecrets, nil\n}\n\n// ParseConfigs retrieves the configs from the requested names and converts\n// them to config references to use with the spec\nfunc ParseConfigs(ctx context.Context, apiClient client.ConfigAPIClient, requestedConfigs []*swarm.ConfigReference) ([]*swarm.ConfigReference, error) {\n\tif len(requestedConfigs) == 0 {\n\t\treturn []*swarm.ConfigReference{}, nil\n\t}\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/parse.go#L32-L68","documentation":"Error \"secret not found: %s\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/parse.go:50 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}