chenhg5/cc-connect · error

project is required (multiple projects configured)

Error message

project is required (multiple projects configured)

What it means

resolveEngine requires an explicit project when more than one engine is configured, because it cannot guess which engine should handle an un-scoped webhook. If no project was specified and ws.engines has 2+ entries, it fails with this instruction to the caller.

Source

Thrown at core/webhook.go:198

func (ws *WebhookServer) resolveEngine(project string) (*Engine, error) {
	ws.mu.RLock()
	defer ws.mu.RUnlock()

	if project != "" {
		e, ok := ws.engines[project]
		if !ok {
			return nil, fmt.Errorf("project %q not found", project)
		}
		return e, nil
	}

	if len(ws.engines) == 1 {
		for _, e := range ws.engines {
			return e, nil
		}
	}

	return nil, fmt.Errorf("project is required (multiple projects configured)")
}

func (ws *WebhookServer) executePrompt(engine *Engine, sessionKey, prompt string, silent bool, event string) {
	platformName := ""
	if idx := strings.Index(sessionKey, ":"); idx > 0 {
		platformName = sessionKey[:idx]
	}

	var targetPlatform Platform
	for _, p := range engine.platforms {
		if p.Name() == platformName {
			targetPlatform = p
			break
		}
	}
	if targetPlatform == nil {
		slog.Error("webhook: platform not found", "event", event, "platform", platformName)
		return

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Include the project in the webhook URL path/query (e.g. /hook/<project>)
  2. Remove or consolidate extra projects if only one is actually used
  3. Keep exactly one configured project if un-scoped webhooks must keep working

Example fix

// before
POST /hook            // multiple projects configured
// after
POST /hook/acme       // explicit project
Defensive patterns

Strategy: validation

Validate before calling

if len(configuredProjects()) > 1 && webhookProject == "" {
    return errors.New("webhook URL must include the project when multiple projects are configured")
}

Prevention

When it happens

Trigger: handleHook receives a webhook without any project identifier while ws.engines contains multiple engines, e.g. POST /hook with projects "acme" and "beta" both configured.

Common situations: Deploying a multi-project cc-connect instance but reusing old single-project webhook URLs that omit the project segment; a webhook integration that never sent a project field before a second project was added.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — 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/5d4622ccd92000ec. Report an issue: GitHub.