Netflix/chaosmonkey · error
failed to deploy schedule: %v
Error message
failed to deploy schedule: %v
What it means
After the schedule is populated and filtered by constraints, do() calls deploySchedule to publish it to chaosmonkey-api and register it with the local cron. If deploySchedule returns an error (timezone lookup, publish failure, or cron registration failure), it is wrapped with this message. It is a wrapper, so the root cause always follows the colon.
Source
Thrown at command/schedule.go:72
}
}
// do is the actual implementation for the Schedule function
func do(d deploy.Deployment, g chaosmonkey.AppConfigGetter, ss schedstore.SchedStore, cfg *config.Monkey, cons schedule.Constrainer, apps []string) error {
s := schedule.New()
err := s.Populate(d, g, cfg, apps)
if err != nil {
return fmt.Errorf("failed to populate schedule: %v", err)
}
// Filter out terminations that violate constrains
sched := cons.Filter(*s)
err = deploySchedule(&sched, ss, cfg)
if err != nil {
return fmt.Errorf("failed to deploy schedule: %v", err)
}
return nil
}
// deploySchedule publishes the schedule to chaosmonkey-api
// and registers the schedule with the local cron
func deploySchedule(s *schedule.Schedule, ss schedstore.SchedStore, cfg *config.Monkey) error {
loc, err := cfg.Location()
if err != nil {
return fmt.Errorf("deploySchedule: could not retrieve local timezone: %v", err)
}
today := time.Now().In(loc)
err = ss.Publish(today, s)
if err != nil {View on GitHub (pinned to eaa28fb761)
Solutions
- Read the wrapped underlying error to determine which stage failed (timezone, publish, cron registration).
- If it is the timezone error, install tzdata or set the TZ environment variable correctly in the container.
- If it is the publish error, check schedstore backend availability and write permissions.
- If it is cron registration, validate the schedule's cron expressions and times.
Defensive patterns
Strategy: try-catch
Validate before calling
// before deploying, verify timezone and store availability
if _, err := cfg.Location(); err != nil {
return fmt.Errorf("precheck: timezone unavailable: %v", err)
}
if err := ss.Ping(); err != nil { // if your SchedStore exposes a health check
return fmt.Errorf("precheck: schedstore unavailable: %v", err)
} Try / catch
if err := do(dep, appCfgGetter, schedStore, cfg, constrainer, apps); err != nil {
if strings.HasPrefix(err.Error(), "failed to deploy schedule:") {
cause := errors.Unwrap(err)
log.Errorf("deploy failed: %v", cause)
switch {
case strings.Contains(cause.Error(), "timezone"):
log.Error("install tzdata or fix TZ")
case strings.Contains(cause.Error(), "publish"):
log.Error("check schedstore availability/permissions")
}
return err
}
return err
} Prevention
- Install tzdata in the runtime image so cfg.Location() succeeds.
- Run a preflight check of the schedstore backend before deploying.
- Check service-account write permissions to schedule storage.
- Log the unwrapped cause to distinguish timezone vs publish vs cron-registration failures.
When it happens
Trigger: Running the schedule command when deploySchedule fails: cfg.Location() cannot resolve the local timezone, ss.Publish fails to persist the schedule, or registerWithCron fails to register entries with the cron scheduler.
Common situations: Server missing timezone data (e.g. no tzdata in a scratch/container image), schedstore (Datastore/API) unavailable or permission-denied, or invalid schedule entries that the cron library rejects.
Related errors
- failed to populate schedule: %v
- schedule already exists
- 'attributes' field missing
- 'attributes.chaosMonkey' field missing
- 'attributes.chaosMonkey.enabled' field missing
AI-assisted analysis of Netflix/chaosmonkey@eaa28fb761 (2026-09-03).
Data as JSON: /api/errors/09d062aa85184f83.
Report an issue: GitHub.