{"record":{"id":"0562bac618b28d53","repo":"alibaba/spring-cloud-alibaba","slug":"create-schedulerx-job-failed-jobname-message","errorCode":null,"errorMessage":"create schedulerx job failed, jobName={}, message={}","messagePattern":"create schedulerx job failed, jobName=(.+?), message=(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/service/JobSyncService.java","lineNumber":329,"sourceCode":"\t\t\trequest.setTimeType(jobProperty.getTimeType());\n\t\t\tif (StringUtils.isNotEmpty(jobProperty.getTimeExpression())) {\n\t\t\t\trequest.setTimeExpression(jobProperty.getTimeExpression());\n\t\t\t}\n\t\t}\n\n\t\trequest.setTimeoutEnable(true);\n\t\trequest.setTimeoutKillEnable(true);\n\t\trequest.setSendChannel(SchedulerxConstants.JOB_ALARM_CHANNEL_DEFAULT);\n\t\trequest.setFailEnable(true);\n\t\trequest.setTimeout(SchedulerxConstants.JOB_TIMEOUT_DEFAULT);\n\t\trequest.setMaxAttempt(SchedulerxConstants.JOB_RETRY_COUNT_DEFAULT);\n\t\trequest.setAttemptInterval(SchedulerxConstants.JOB_RETRY_INTERVAL_DEFAULT);\n\t\tCreateJobResponse response = client.getAcsResponse(request);\n\t\tif (response.getSuccess()) {\n\t\t\tlogger.info(\"create schedulerx job successfully, jobId={}, jobName={}\", response.getData().getJobId(), jobName);\n\t\t}\n\t\telse {\n\t\t\tthrow new IOException(\"create schedulerx job failed, jobName=\" + jobName + \", message=\" + response.getMessage());\n\t\t}\n\t}\n\n\t/**\n\t * update job.\n\t *\n\t * @param client          pop client\n\t * @param jobConfigInfo   job config info\n\t * @param jobProperty     job property\n\t * @param namespaceSource namespace source\n\t * @throws Exception update job exception\n\t */\n\tprivate void updateJob(DefaultAcsClient client, JobConfigInfo jobConfigInfo, JobProperty jobProperty, String namespaceSource) throws Exception {\n\t\tString executeMode = jobProperty.getJobModel();\n\t\tif (SchedulerxConstants.JOB_MODEL_MAPREDUCE_ALIAS.equals(jobProperty.getJobModel())) {\n\t\t\texecuteMode = ExecuteMode.BATCH.getKey();\n\t\t}\n\t\tint timeType;","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/alibaba/spring-cloud-alibaba/blob/115d5901102009492e05d5ec18c3f79cad4077d0/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/service/JobSyncService.java#L311-L347","documentation":"Thrown by JobSyncService.createJob when the CreateJob POP RPC returns success=false. The message includes the jobName and the server's response.getMessage() (the catalog shows the format string 'create schedulerx job failed, jobName={}, message={}'). This means the SchedulerX2 backend rejected job creation, e.g. duplicate name, invalid class, or permission issues.","triggerScenarios":"In createJob, after building CreateJobRequest, client.getAcsResponse(request) returns response.getSuccess()==false at JobSyncService.java:324-329. Reached when task-sync creates a job that the server refuses.","commonSituations":"A job with the same name already exists in the app group and overwrite is false; the className does not resolve to a registered processor on the worker; the timeExpression/timeType is rejected by the server; the AK/RAM role lacks the create-job permission.","solutions":["Inspect the 'message=' portion of the thrown IOException for the server's exact reason and act on it.","If the job already exists, set task-overwrite=true so the sync updates instead of failing, or remove the duplicate declaration.","Verify the job's className points to a class implementing the SchedulerX processor interface and registered on the worker.","Confirm the credentials have permission to call schedulerx2:CreateJob."],"exampleFix":"// before: failure aborts all subsequent job sync\n// after: catch per-job so one bad job does not block the rest\nfor (String name : jobsToSync) {\n    try {\n        jobSyncService.createOrSync(name);\n    } catch (IOException e) {\n        log.warn(\"Skipping job '{}' - server rejected: {}\", name, e.getMessage());\n    }\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check: query existing jobs via GetJobInfo so create is only attempted for absent jobs,\n// and set task-overwrite=true to switch duplicates onto the update path.","typeGuard":null,"tryCatchPattern":"try {\n    // createJob path\n} catch (IOException e) {\n    // message contains \"create schedulerx job failed, jobName=<n>, message=<server reason>\"\n    log.error(\"Job create failed: {}\", e.getMessage());\n    if (e.getMessage().contains(\"already exist\")) {\n        // retry as update, or set task-overwrite=true in config\n    }\n}","preventionTips":["Set spring.cloud.scheduling.schedulerx.task-overwrite=true in environments where job definitions change, to avoid create-vs-existing collisions.","Keep className values aligned with actual worker-side processor registrations.","Run a dry-run sync against a staging app group before production."],"tags":["java","spring-cloud-alibaba","schedulerx","api","server-side"],"backgroundTag":null,"analyzedSha":"115d5901102009492e05d5ec18c3f79cad4077d0","analyzedAt":"2026-08-14T04:47:13.900Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}