{"record":{"id":"4f89c244d98ff3ec","repo":"chenhg5/cc-connect","slug":"project-q-not-found-4f89c2","errorCode":null,"errorMessage":"project %q not found","messagePattern":"project %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/webhook.go","lineNumber":187,"sourceCode":"\t\treturn subtle.ConstantTimeCompare([]byte(tok), []byte(ws.token)) == 1\n\t}\n\n\t// Check query parameter as fallback\n\tif tok := r.URL.Query().Get(\"token\"); tok != \"\" {\n\t\treturn subtle.ConstantTimeCompare([]byte(tok), []byte(ws.token)) == 1\n\t}\n\n\treturn false\n}\n\nfunc (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}","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/webhook.go#L169-L205","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Correct the project identifier in the webhook URL to match a configured project","Add the missing project to config.toml and restart cc-connect","List configured projects (logs/startup output) and update all external webhook registrations accordingly"],"exampleFix":"// before\nPOST /hook/acme-prod  // config only has \"acme\"\n// after\nPOST /hook/acme  // matches ws.engines[\"acme\"]","handlingStrategy":"validation","validationCode":"projects := configuredProjects() // from config.toml\nif !slices.Contains(projects, reqProject) {\n    return fmt.Errorf(\"project %q not configured\", reqProject)\n}\n// then register/POST the webhook with reqProject","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate webhook URLs from the configured project names","Update external webhook registrations whenever a project is renamed","Log all configured project names at startup for cross-checking"],"tags":["webhook","routing","not-found"],"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"}