{"record":{"id":"09c3e57e19b90649","repo":"chenhg5/cc-connect","slug":"project-q-not-found-09c3e5","errorCode":null,"errorMessage":"project %q not found","messagePattern":"project %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/cron.go","lineNumber":694,"sourceCode":"\tgo cs.runJob(&snapshot, true)\n\treturn nil\n}\n\nfunc (cs *CronScheduler) runJob(job *CronJob, manual bool) {\n\tif job == nil {\n\t\treturn\n\t}\n\tif !manual && !job.Enabled {\n\t\treturn\n\t}\n\n\tcs.mu.RLock()\n\tengine, ok := cs.engines[job.Project]\n\tcs.mu.RUnlock()\n\n\tif !ok {\n\t\tslog.Error(\"cron: project not found\", \"job\", job.ID, \"project\", job.Project, \"manual\", manual)\n\t\tcs.store.MarkRun(job.ID, fmt.Errorf(\"project %q not found\", job.Project))\n\t\treturn\n\t}\n\n\tslog.Info(\"cron: executing job\", \"id\", job.ID, \"project\", job.Project, \"manual\", manual, \"prompt\", truncateStr(job.Prompt, 60))\n\n\tdone := make(chan error, 1)\n\tgo func() {\n\t\tdone <- engine.ExecuteCronJob(job)\n\t}()\n\n\tvar err error\n\ttimeout := job.ExecutionTimeout()\n\tif timeout > 0 {\n\t\tselect {\n\t\tcase err = <-done:\n\t\tcase <-time.After(timeout):\n\t\t\terr = fmt.Errorf(\"job timed out after %v\", timeout)\n\t\t}","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/cron.go#L676-L712","documentation":"runJob executes a cron job in the background; when the job's project has no registered engine it logs the failure and records it via store.MarkRun with the message 'project %q not found', then returns without running the prompt. Unlike RunJobNow's synchronous check, this path handles projects disappearing between trigger and execution (scheduled runs, races).","triggerScenarios":"A scheduled fire for a job whose project engine was removed (config reload, project renamed/deleted) after the job was scheduled; also RunJobNow passing its own re-check if the engine disappears concurrently.","commonSituations":"Daemon config.toml edited to remove/rename a project while cron jobs referencing it remain persisted; hot-reload drops an engine while timers keep firing.","solutions":["Restore the project in config.toml and restart/reload the daemon","Update or delete the stale cron job referencing the missing project","Check store MarkRun records / logs for 'cron: project not found' to identify affected job ids"],"exampleFix":"// before\n// jobs referencing project \"oldname\" keep failing after rename to \"newname\"\n// after\ncs.UpdateJob(jobID, \"project\", \"newname\") // or re-add [projects.oldname]","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Watch store MarkRun records for 'project not found' to detect stale jobs after config changes","Reconcile persisted cron jobs against configured projects on daemon startup","Log and alert when scheduled fires fail synchronously in the background goroutine"],"tags":["go","cron","config","background-failure"],"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"}