chenhg5/cc-connect · error

project %q not found

Error message

project %q not found

What it means

WebhookServer.resolveEngine looks up the Engine registered under the requested project name in ws.engines. If the webhook URL/query specified a project that was never configured (or was removed at runtime), the lookup fails with this error. It guards against routing webhook events to a nonexistent engine.

Source

Thrown at core/webhook.go:187

		return subtle.ConstantTimeCompare([]byte(tok), []byte(ws.token)) == 1
	}

	// Check query parameter as fallback
	if tok := r.URL.Query().Get("token"); tok != "" {
		return subtle.ConstantTimeCompare([]byte(tok), []byte(ws.token)) == 1
	}

	return false
}

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]
	}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Correct the project identifier in the webhook URL to match a configured project
  2. Add the missing project to config.toml and restart cc-connect
  3. List configured projects (logs/startup output) and update all external webhook registrations accordingly

Example fix

// before
POST /hook/acme-prod  // config only has "acme"
// after
POST /hook/acme  // matches ws.engines["acme"]
Defensive patterns

Strategy: validation

Validate before calling

projects := configuredProjects() // from config.toml
if !slices.Contains(projects, reqProject) {
    return fmt.Errorf("project %q not configured", reqProject)
}
// then register/POST the webhook with reqProject

Prevention

When it happens

Trigger: handleHook receives a webhook whose project identifier (path segment or query param) does not match any key in ws.engines, e.g. POST /hook/acme-prod when only "acme" is configured.

Common situations: Project renamed in config.toml while external webhook URLs still point at the old name; typo in the webhook URL; server restarted with fewer projects configured than the registered webhooks expect.

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/4f89c244d98ff3ec. Report an issue: GitHub.