{"record":{"id":"cd6b8bc956741287","repo":"sipeed/picoclaw","slug":"error-setting-up-cron-service-w","errorCode":null,"errorMessage":"error setting up cron service: %w","messagePattern":"error setting up cron service: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/gateway/gateway.go","lineNumber":426,"sourceCode":"\tagentLoop *agent.AgentLoop,\n\tmsgBus *bus.MessageBus,\n\tauthToken string,\n\tlistenResult netbind.OpenResult,\n) (*services, error) {\n\trunningServices := &services{}\n\n\texecTimeout := time.Duration(cfg.Tools.Cron.ExecTimeoutMinutes) * time.Minute\n\tvar err error\n\trunningServices.CronService, err = setupCronTool(\n\t\tagentLoop,\n\t\tmsgBus,\n\t\tcfg.WorkspacePath(),\n\t\tcfg.Agents.Defaults.RestrictToWorkspace,\n\t\texecTimeout,\n\t\tcfg,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error setting up cron service: %w\", err)\n\t}\n\tif err = runningServices.CronService.Start(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error starting cron service: %w\", err)\n\t}\n\tfmt.Println(\"✓ Cron service started\")\n\n\trunningServices.HeartbeatService = heartbeat.NewHeartbeatService(\n\t\tcfg.WorkspacePath(),\n\t\tcfg.Heartbeat.Interval,\n\t\tcfg.Heartbeat.Enabled,\n\t)\n\trunningServices.HeartbeatService.SetBus(msgBus)\n\trunningServices.HeartbeatService.SetHandler(createHeartbeatHandler(agentLoop))\n\tif err = runningServices.HeartbeatService.Start(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error starting heartbeat service: %w\", err)\n\t}\n\tfmt.Println(\"✓ Heartbeat service started\")\n","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/gateway/gateway.go#L408-L444","documentation":"setupAndStartServices wraps a setupCronTool failure: the cron service (scheduled task runner) could not be initialized from cfg.Tools.Cron (bad workspace path, config issue). Gateway startup fails since cron is a core service.","triggerScenarios":"Thrown at pkg/gateway/gateway.go:426 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped cause and the tools.cron settings in config.json","Verify the workspace path exists and is accessible","Adjust tools.cron.exec_timeout_minutes to a valid positive value"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}