{"record":{"id":"16fdf25bdd79f80e","repo":"chenhg5/cc-connect","slug":"cron-scheduler-not-available","errorCode":null,"errorMessage":"cron scheduler not available","messagePattern":"cron scheduler not available","errorType":"http","errorClass":null,"httpStatus":503,"severity":"error","filePath":"core/api.go","lineNumber":337,"sourceCode":"\tSessionKey  string `json:\"session_key\"`\n\tCronExpr    string `json:\"cron_expr\"`\n\tPrompt      string `json:\"prompt\"`\n\tExec        string `json:\"exec\"`\n\tWorkDir     string `json:\"work_dir\"`\n\tDescription string `json:\"description\"`\n\tSilent      *bool  `json:\"silent,omitempty\"`\n\tSessionMode string `json:\"session_mode,omitempty\"`\n\tMode        string `json:\"mode,omitempty\"`\n\tTimeoutMins *int   `json:\"timeout_mins,omitempty\"`\n}\n\nfunc (s *APIServer) handleCronAdd(w http.ResponseWriter, r *http.Request) {\n\tif r.Method != http.MethodPost {\n\t\thttp.Error(w, \"POST only\", http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\tif s.cron == nil {\n\t\thttp.Error(w, \"cron scheduler not available\", http.StatusServiceUnavailable)\n\t\treturn\n\t}\n\n\tvar req CronAddRequest\n\tif err := json.NewDecoder(r.Body).Decode(&req); err != nil {\n\t\thttp.Error(w, \"invalid JSON: \"+err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif req.CronExpr == \"\" {\n\t\thttp.Error(w, \"cron_expr is required\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tif req.Prompt == \"\" && req.Exec == \"\" {\n\t\thttp.Error(w, \"either prompt or exec is required\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tif req.Prompt != \"\" && req.Exec != \"\" {\n\t\thttp.Error(w, \"prompt and exec are mutually exclusive\", http.StatusBadRequest)","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/api.go#L319-L355","documentation":"handleCronAdd rejected the request because the API server was constructed without a cron scheduler (s.cron == nil) — cron functionality is not wired into this deployment, so no cron jobs can be created via the API.","triggerScenarios":"Thrown at core/api.go:337 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable the cron scheduler in the server/engine wiring before exposing the cron API","Return 503 to clients and document that cron is disabled in this build"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}