chenhg5/cc-connect · error
cron_expr is required
Error message
cron_expr is required
What it means
HTTP 400 validation response from the cron-add API endpoint: the decoded CronAddRequest JSON has an empty cron_expr field, so the scheduler has no schedule expression to register the job with.
Source
Thrown at core/api.go:347
}
func (s *APIServer) handleCronAdd(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
http.Error(w, "POST only", http.StatusMethodNotAllowed)
return
}
if s.cron == nil {
http.Error(w, "cron scheduler not available", http.StatusServiceUnavailable)
return
}
var req CronAddRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
http.Error(w, "invalid JSON: "+err.Error(), http.StatusBadRequest)
return
}
if req.CronExpr == "" {
http.Error(w, "cron_expr is required", http.StatusBadRequest)
return
}
if req.Prompt == "" && req.Exec == "" {
http.Error(w, "either prompt or exec is required", http.StatusBadRequest)
return
}
if req.Prompt != "" && req.Exec != "" {
http.Error(w, "prompt and exec are mutually exclusive", http.StatusBadRequest)
return
}
// Resolve project: use provided, or pick single engine
project := req.Project
if project == "" {
s.mu.RLock()
if len(s.engines) == 1 {
for name := range s.engines {
project = nameView on GitHub (pinned to 4000b2338a)
Solutions
- Include a valid cron_expr (e.g. "0 9 * * *") in the request body
- Validate the expression syntax client-side before sending
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/api.go:347 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/43fe596d93bcda8d.
Report an issue: GitHub.