{"record":{"id":"5d4622ccd92000ec","repo":"chenhg5/cc-connect","slug":"project-is-required-multiple-projects-configured","errorCode":null,"errorMessage":"project is required (multiple projects configured)","messagePattern":"project is required \\(multiple projects configured\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/webhook.go","lineNumber":198,"sourceCode":"func (ws *WebhookServer) resolveEngine(project string) (*Engine, error) {\n\tws.mu.RLock()\n\tdefer ws.mu.RUnlock()\n\n\tif project != \"\" {\n\t\te, ok := ws.engines[project]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"project %q not found\", project)\n\t\t}\n\t\treturn e, nil\n\t}\n\n\tif len(ws.engines) == 1 {\n\t\tfor _, e := range ws.engines {\n\t\t\treturn e, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"project is required (multiple projects configured)\")\n}\n\nfunc (ws *WebhookServer) executePrompt(engine *Engine, sessionKey, prompt string, silent bool, event string) {\n\tplatformName := \"\"\n\tif idx := strings.Index(sessionKey, \":\"); idx > 0 {\n\t\tplatformName = sessionKey[:idx]\n\t}\n\n\tvar targetPlatform Platform\n\tfor _, p := range engine.platforms {\n\t\tif p.Name() == platformName {\n\t\t\ttargetPlatform = p\n\t\t\tbreak\n\t\t}\n\t}\n\tif targetPlatform == nil {\n\t\tslog.Error(\"webhook: platform not found\", \"event\", event, \"platform\", platformName)\n\t\treturn","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/webhook.go#L180-L216","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Include the project in the webhook URL path/query (e.g. /hook/<project>)","Remove or consolidate extra projects if only one is actually used","Keep exactly one configured project if un-scoped webhooks must keep working"],"exampleFix":"// before\nPOST /hook            // multiple projects configured\n// after\nPOST /hook/acme       // explicit project","handlingStrategy":"validation","validationCode":"if len(configuredProjects()) > 1 && webhookProject == \"\" {\n    return errors.New(\"webhook URL must include the project when multiple projects are configured\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use project-scoped webhook URLs (/hook/<project>)","Re-check webhook URLs after adding a second project","Avoid un-scoped legacy endpoints in multi-project deployments"],"tags":["webhook","routing","ambiguous"],"backgroundTag":"missing-required-argument","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"}