chenhg5/cc-connect · error

project %q has no feishu/lark platform

Error message

project %q has no feishu/lark platform

What it means

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.

Source

Thrown at config/config.go:2069

		if cfg.Projects[i].Name == opts.ProjectName {
			projectIdx = i
			break
		}
	}
	if projectIdx < 0 {
		return nil, fmt.Errorf("project %q not found", opts.ProjectName)
	}

	proj := &cfg.Projects[projectIdx]
	candidates := make([]int, 0, len(proj.Platforms))
	for i := range proj.Platforms {
		t := strings.ToLower(strings.TrimSpace(proj.Platforms[i].Type))
		if t == "feishu" || t == "lark" {
			candidates = append(candidates, i)
		}
	}
	if len(candidates) == 0 {
		return nil, fmt.Errorf("project %q has no feishu/lark platform", opts.ProjectName)
	}

	targetPos := 0
	if opts.PlatformIndex > 0 {
		targetPos = opts.PlatformIndex - 1
	}
	if targetPos < 0 || targetPos >= len(candidates) {
		return nil, fmt.Errorf(
			"platform index %d out of range: project %q has %d feishu/lark platform(s)",
			opts.PlatformIndex, opts.ProjectName, len(candidates),
		)
	}

	absIdx := candidates[targetPos]
	platform := &proj.Platforms[absIdx]
	if opts.PlatformType != "" {
		platform.Type = opts.PlatformType
	}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Pick a project that actually contains a feishu/lark platform entry.
  2. Add a [[projects.platforms]] block with type = "feishu" (plus app_id/app_secret) to the target project.
  3. Fix a misspelled type value in the existing platform entry so it matches "feishu" or "lark".

Example fix

# before: project has only type = "telegram"
# after
[[projects.platforms]]
type = "feishu"
app_id = "cli_xxx"
app_secret = "xxx"
Defensive patterns

Strategy: validation

Validate before calling

cfg, err := config.Load()
if err != nil { return err }
proj := findProject(cfg, opts.ProjectName)
hasFeishu := slices.ContainsFunc(proj.Platforms, func(p config.Platform) bool {
    t := strings.ToLower(strings.TrimSpace(p.Type)); return t == "feishu" || t == "lark"
})
if !hasFeishu { return fmt.Errorf("project %q has no feishu/lark platform", opts.ProjectName) }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/4ddcc2ca5b7d57ff. Report an issue: GitHub.