{"record":{"id":"4ddcc2ca5b7d57ff","repo":"chenhg5/cc-connect","slug":"project-q-has-no-feishu-lark-platform","errorCode":null,"errorMessage":"project %q has no feishu/lark platform","messagePattern":"project %q has no feishu/lark platform","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":2069,"sourceCode":"\t\tif cfg.Projects[i].Name == opts.ProjectName {\n\t\t\tprojectIdx = i\n\t\t\tbreak\n\t\t}\n\t}\n\tif projectIdx < 0 {\n\t\treturn nil, fmt.Errorf(\"project %q not found\", opts.ProjectName)\n\t}\n\n\tproj := &cfg.Projects[projectIdx]\n\tcandidates := make([]int, 0, len(proj.Platforms))\n\tfor i := range proj.Platforms {\n\t\tt := strings.ToLower(strings.TrimSpace(proj.Platforms[i].Type))\n\t\tif t == \"feishu\" || t == \"lark\" {\n\t\t\tcandidates = append(candidates, i)\n\t\t}\n\t}\n\tif len(candidates) == 0 {\n\t\treturn nil, fmt.Errorf(\"project %q has no feishu/lark platform\", opts.ProjectName)\n\t}\n\n\ttargetPos := 0\n\tif opts.PlatformIndex > 0 {\n\t\ttargetPos = opts.PlatformIndex - 1\n\t}\n\tif targetPos < 0 || targetPos >= len(candidates) {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"platform index %d out of range: project %q has %d feishu/lark platform(s)\",\n\t\t\topts.PlatformIndex, opts.ProjectName, len(candidates),\n\t\t)\n\t}\n\n\tabsIdx := candidates[targetPos]\n\tplatform := &proj.Platforms[absIdx]\n\tif opts.PlatformType != \"\" {\n\t\tplatform.Type = opts.PlatformType\n\t}","sourceCodeStart":2051,"sourceCodeEnd":2087,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L2051-L2087","documentation":"The project was found, but none of its [[projects.platforms]] entries have type \"feishu\" or \"lark\" (compared case-insensitively after trimming whitespace). Since the helper's purpose is to ensure a feishu/lark platform within an existing project that already uses one, a project with zero such platforms is an error rather than a trigger to create one.","triggerScenarios":"Calling the ensure-feishu-platform API (config/config.go:2069) on a project whose platforms are all other types (telegram, discord, weixin, ...) or that has no platforms at all.","commonSituations":"User targets a project that was configured for a different chat platform; the feishu block was deleted from the project; the platform type string is misspelled in the TOML (e.g. type = \"fishu\") so it fails the feishu/lark filter.","solutions":["Pick a project that actually contains a feishu/lark platform entry.","Add a [[projects.platforms]] block with type = \"feishu\" (plus app_id/app_secret) to the target project.","Fix a misspelled type value in the existing platform entry so it matches \"feishu\" or \"lark\"."],"exampleFix":"# before: project has only type = \"telegram\"\n# after\n[[projects.platforms]]\ntype = \"feishu\"\napp_id = \"cli_xxx\"\napp_secret = \"xxx\"","handlingStrategy":"validation","validationCode":"cfg, err := config.Load()\nif err != nil { return err }\nproj := findProject(cfg, opts.ProjectName)\nhasFeishu := slices.ContainsFunc(proj.Platforms, func(p config.Platform) bool {\n    t := strings.ToLower(strings.TrimSpace(p.Type)); return t == \"feishu\" || t == \"lark\"\n})\nif !hasFeishu { return fmt.Errorf(\"project %q has no feishu/lark platform\", opts.ProjectName) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the target project actually uses feishu/lark before calling the helper","Fix typos in platform type strings in config.toml","Derive the target project from the platform type rather than hardcoding"],"tags":["go","config","lookup"],"backgroundTag":"resource-not-found","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}