{"record":{"id":"96c3a00a4b83a2a1","repo":"ory/kratos","slug":"expected-to-find-message-s-in-the-list-for-the-do","errorCode":null,"errorMessage":"expected to find message %s in the list for the documentation generation but could not","messagePattern":"expected to find message (.+?) in the list for the documentation generation but could not","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/clidoc/main.go","lineNumber":377,"sourceCode":"\t}\n\tallFiles := make([]*ast.File, 0)\n\tfor fn, f := range pack.Files {\n\t\tif strings.HasSuffix(fn, \"/id.go\") {\n\t\t\tallFiles = append(allFiles, f)\n\t\t}\n\t}\n\t_, err = (&types.Config{Importer: importer.Default()}).Check(\"text\", set, allFiles, info)\n\tif err != nil {\n\t\treturn err // type error\n\t}\n\n\tfor _, f := range pack.Files {\n\t\tfor _, d := range f.Decls {\n\t\t\tswitch decl := d.(type) {\n\t\t\tcase *ast.FuncDecl:\n\t\t\t\tif name := decl.Name.String(); decl.Name.IsExported() && strings.HasPrefix(name, \"New\") {\n\t\t\t\t\tif _, ok := messages[name]; !ok {\n\t\t\t\t\t\treturn errors.Errorf(\"expected to find message %s in the list for the documentation generation but could not\", name)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase *ast.GenDecl:\n\t\t\t\tif decl.Tok == token.CONST {\n\t\t\t\t\tfor _, spec := range decl.Specs {\n\t\t\t\t\t\tvalue := spec.(*ast.ValueSpec) // safe because decl.Tok is token.CONST\n\t\t\t\t\t\tif t, ok := value.Type.(*ast.Ident); ok {\n\t\t\t\t\t\t\tif t.Name == \"ID\" {\n\t\t\t\t\t\t\t\tfor _, name := range value.Names {\n\t\t\t\t\t\t\t\t\tc := info.ObjectOf(name)\n\t\t\t\t\t\t\t\t\tif c == nil {\n\t\t\t\t\t\t\t\t\t\treturn errors.Errorf(\"expected to find const %s in text/id.go\", name.Name)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tusedIDs = append(usedIDs, message{\n\t\t\t\t\t\t\t\t\t\tID:   c.(*types.Const).Val().ExactString(),\n\t\t\t\t\t\t\t\t\t\tName: name.Name,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/ory/kratos/blob/b86338da04a040247a07f46100a86dcfb3875909/cmd/clidoc/main.go#L359-L395","documentation":"The clidoc generator walked the text package and found an exported constructor function starting with 'New' that is not present in the generator's messages map. The messages registry and the actual source have drifted apart, so documentation cannot be generated for that message.","triggerScenarios":"Thrown at cmd/clidoc/main.go:377 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the missing message to the messages list in cmd/clidoc/main.go with its ID and name","If the constructor was renamed or removed on purpose, update the messages list to match","Regenerate the documentation afterwards to confirm the error is gone"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b86338da04a040247a07f46100a86dcfb3875909","analyzedAt":"2026-09-07T15:58:15.934Z","contentChangedAt":"2026-09-07T15:58:15.934Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}