alibaba/spring-cloud-alibaba · error · IOException

create schedulerx job failed, jobName={}, message={}

Error message

create schedulerx job failed, jobName={}, message={}

What it means

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.

Source

Thrown at spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/service/JobSyncService.java:329

			request.setTimeType(jobProperty.getTimeType());
			if (StringUtils.isNotEmpty(jobProperty.getTimeExpression())) {
				request.setTimeExpression(jobProperty.getTimeExpression());
			}
		}

		request.setTimeoutEnable(true);
		request.setTimeoutKillEnable(true);
		request.setSendChannel(SchedulerxConstants.JOB_ALARM_CHANNEL_DEFAULT);
		request.setFailEnable(true);
		request.setTimeout(SchedulerxConstants.JOB_TIMEOUT_DEFAULT);
		request.setMaxAttempt(SchedulerxConstants.JOB_RETRY_COUNT_DEFAULT);
		request.setAttemptInterval(SchedulerxConstants.JOB_RETRY_INTERVAL_DEFAULT);
		CreateJobResponse response = client.getAcsResponse(request);
		if (response.getSuccess()) {
			logger.info("create schedulerx job successfully, jobId={}, jobName={}", response.getData().getJobId(), jobName);
		}
		else {
			throw new IOException("create schedulerx job failed, jobName=" + jobName + ", message=" + response.getMessage());
		}
	}

	/**
	 * update job.
	 *
	 * @param client          pop client
	 * @param jobConfigInfo   job config info
	 * @param jobProperty     job property
	 * @param namespaceSource namespace source
	 * @throws Exception update job exception
	 */
	private void updateJob(DefaultAcsClient client, JobConfigInfo jobConfigInfo, JobProperty jobProperty, String namespaceSource) throws Exception {
		String executeMode = jobProperty.getJobModel();
		if (SchedulerxConstants.JOB_MODEL_MAPREDUCE_ALIAS.equals(jobProperty.getJobModel())) {
			executeMode = ExecuteMode.BATCH.getKey();
		}
		int timeType;

View on GitHub (pinned to 115d590110)

Solutions

  1. Inspect the 'message=' portion of the thrown IOException for the server's exact reason and act on it.
  2. If the job already exists, set task-overwrite=true so the sync updates instead of failing, or remove the duplicate declaration.
  3. Verify the job's className points to a class implementing the SchedulerX processor interface and registered on the worker.
  4. Confirm the credentials have permission to call schedulerx2:CreateJob.

Example fix

// before: failure aborts all subsequent job sync
// after: catch per-job so one bad job does not block the rest
for (String name : jobsToSync) {
    try {
        jobSyncService.createOrSync(name);
    } catch (IOException e) {
        log.warn("Skipping job '{}' - server rejected: {}", name, e.getMessage());
    }
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check: query existing jobs via GetJobInfo so create is only attempted for absent jobs,
// and set task-overwrite=true to switch duplicates onto the update path.

Try / catch

try {
    // createJob path
} catch (IOException e) {
    // message contains "create schedulerx job failed, jobName=<n>, message=<server reason>"
    log.error("Job create failed: {}", e.getMessage());
    if (e.getMessage().contains("already exist")) {
        // retry as update, or set task-overwrite=true in config
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of alibaba/spring-cloud-alibaba@115d590110 (2026-08-14). Data as JSON: /api/errors/0562bac618b28d53. Report an issue: GitHub.