{"record":{"id":"09d062aa85184f83","repo":"Netflix/chaosmonkey","slug":"failed-to-deploy-schedule-v","errorCode":null,"errorMessage":"failed to deploy schedule: %v","messagePattern":"failed to deploy schedule: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/schedule.go","lineNumber":72,"sourceCode":"\t}\n\n}\n\n// do is the actual implementation for the Schedule function\nfunc do(d deploy.Deployment, g chaosmonkey.AppConfigGetter, ss schedstore.SchedStore, cfg *config.Monkey, cons schedule.Constrainer, apps []string) error {\n\n\ts := schedule.New()\n\terr := s.Populate(d, g, cfg, apps)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to populate schedule: %v\", err)\n\t}\n\n\t// Filter out terminations that violate constrains\n\tsched := cons.Filter(*s)\n\n\terr = deploySchedule(&sched, ss, cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to deploy schedule: %v\", err)\n\t}\n\n\treturn nil\n}\n\n// deploySchedule publishes the schedule to chaosmonkey-api\n// and registers the schedule with the local cron\nfunc deploySchedule(s *schedule.Schedule, ss schedstore.SchedStore, cfg *config.Monkey) error {\n\tloc, err := cfg.Location()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deploySchedule: could not retrieve local timezone: %v\", err)\n\t}\n\n\ttoday := time.Now().In(loc)\n\n\terr = ss.Publish(today, s)\n\n\tif err != nil {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/command/schedule.go#L54-L90","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before deploying, verify timezone and store availability\nif _, err := cfg.Location(); err != nil {\n    return fmt.Errorf(\"precheck: timezone unavailable: %v\", err)\n}\nif err := ss.Ping(); err != nil { // if your SchedStore exposes a health check\n    return fmt.Errorf(\"precheck: schedstore unavailable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := do(dep, appCfgGetter, schedStore, cfg, constrainer, apps); err != nil {\n    if strings.HasPrefix(err.Error(), \"failed to deploy schedule:\") {\n        cause := errors.Unwrap(err)\n        log.Errorf(\"deploy failed: %v\", cause)\n        switch {\n        case strings.Contains(cause.Error(), \"timezone\"):\n            log.Error(\"install tzdata or fix TZ\")\n        case strings.Contains(cause.Error(), \"publish\"):\n            log.Error(\"check schedstore availability/permissions\")\n        }\n        return err\n    }\n    return err\n}","preventionTips":["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."],"tags":["schedule","deployment","go"],"backgroundTag":"schedule-deploy-failed","analyzedSha":"eaa28fb761c0ebe8644d1333e5d164e9cc3071e9","analyzedAt":"2026-09-03T17:04:39.020Z","contentChangedAt":"2026-09-03T17:04:39.020Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}