{"record":{"id":"928449adc2eeed4d","repo":"chenhg5/cc-connect","slug":"job-q-not-found","errorCode":null,"errorMessage":"job %q not found","messagePattern":"job %q not found","errorType":"exception","errorClass":null,"httpStatus":404,"severity":"error","filePath":"core/cron.go","lineNumber":510,"sourceCode":"\tif job.Enabled {\n\t\treturn cs.scheduleJob(job)\n\t}\n\treturn nil\n}\n\nfunc (cs *CronScheduler) RemoveJob(id string) bool {\n\tcs.mu.Lock()\n\tif entryID, ok := cs.entries[id]; ok {\n\t\tcs.cron.Remove(entryID)\n\t\tdelete(cs.entries, id)\n\t}\n\tcs.mu.Unlock()\n\treturn cs.store.Remove(id)\n}\n\nfunc (cs *CronScheduler) EnableJob(id string) error {\n\tif !cs.store.SetEnabled(id, true) {\n\t\treturn fmt.Errorf(\"job %q not found\", id)\n\t}\n\tjob := cs.store.Get(id)\n\tif job != nil {\n\t\treturn cs.scheduleJob(job)\n\t}\n\treturn nil\n}\n\nfunc (cs *CronScheduler) DisableJob(id string) error {\n\tif !cs.store.SetEnabled(id, false) {\n\t\treturn fmt.Errorf(\"job %q not found\", id)\n\t}\n\tcs.mu.Lock()\n\tif entryID, ok := cs.entries[id]; ok {\n\t\tcs.cron.Remove(entryID)\n\t\tdelete(cs.entries, id)\n\t}\n\tcs.mu.Unlock()","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/cron.go#L492-L528","documentation":"EnableJob returns this error when store.SetEnabled(id, true) reports no job with the given ID exists, so there is nothing to enable or reschedule. Callers are executeCardAction (interactive card buttons) and cmdCronToggle.","triggerScenarios":"Calling CronScheduler.EnableJob with an ID that was never added, or that was removed (deleted job, store file reset, another session removed it).","commonSituations":"Stale cron card/buttons referencing a deleted job; IDs captured before a restart where the store was rewritten; typo'd job ID in /cron toggle.","solutions":["List current jobs (e.g. /cron list) and use a valid ID.","Recreate the job with AddJob if it was deleted.","Handle the error in UI code by refreshing the card/list instead of retrying the same ID."],"exampleFix":"// before\nif err := sched.EnableJob(id); err != nil { return err }\n// after\nif err := sched.EnableJob(id); err != nil {\n    return fmt.Errorf(\"enable: %w (try /cron list for valid ids)\", err)\n}","handlingStrategy":"try-catch","validationCode":"if cs.store.Get(id) == nil { return fmt.Errorf(\"job %q not found\", id) }","typeGuard":null,"tryCatchPattern":"if err := sched.EnableJob(id); err != nil {\n    if strings.Contains(err.Error(), \"not found\") {\n        // refresh UI / treat as gone\n    }\n    return err\n}","preventionTips":["Refresh card/list state after deletions so stale IDs are not reused.","Treat not-found as idempotent success in toggle flows.","Avoid caching job IDs across restarts."],"tags":["go","cron","not-found"],"backgroundTag":"record-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"}