chenhg5/cc-connect · error
project %q not found
Error message
project %q not found
What it means
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).
Source
Thrown at core/cron.go:694
go cs.runJob(&snapshot, true)
return nil
}
func (cs *CronScheduler) runJob(job *CronJob, manual bool) {
if job == nil {
return
}
if !manual && !job.Enabled {
return
}
cs.mu.RLock()
engine, ok := cs.engines[job.Project]
cs.mu.RUnlock()
if !ok {
slog.Error("cron: project not found", "job", job.ID, "project", job.Project, "manual", manual)
cs.store.MarkRun(job.ID, fmt.Errorf("project %q not found", job.Project))
return
}
slog.Info("cron: executing job", "id", job.ID, "project", job.Project, "manual", manual, "prompt", truncateStr(job.Prompt, 60))
done := make(chan error, 1)
go func() {
done <- engine.ExecuteCronJob(job)
}()
var err error
timeout := job.ExecutionTimeout()
if timeout > 0 {
select {
case err = <-done:
case <-time.After(timeout):
err = fmt.Errorf("job timed out after %v", timeout)
}View on GitHub (pinned to 4000b2338a)
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
Example fix
// before // jobs referencing project "oldname" keep failing after rename to "newname" // after cs.UpdateJob(jobID, "project", "newname") // or re-add [projects.oldname]
Defensive patterns
Strategy: fallback
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
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
- ErrCronProjectNotFound
- cron project not found
- parse existing Agy hooks %s: %w
- marshal Agy hooks overlay: %w
- tmux: 'session' option is required (name of the tmux session
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/09c3e57e19b90649.
Report an issue: GitHub.