alibaba/spring-cloud-alibaba · critical · IOException

please set %s.groupId

Error message

please set %s.groupId

What it means

Thrown by JobSyncService.syncAppGroup(DefaultAcsClient) when SchedulerxProperties.groupId is null or empty. The groupId identifies the SchedulerX2 application group the job belongs to; the CreateAppGroup POP request sets request.setGroupId(properties.getGroupId()), so an empty value is rejected before the call. Aborts with IOException after logging, and because blockAppStart defaults to true the failure stops application startup.

Source

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

	 * @param client pop client
	 * @return sync app group result
	 * @throws IOException     sync app group exception.
	 * @throws ClientException sync app group pop client exception.
	 */
	public boolean syncAppGroup(DefaultAcsClient client) throws IOException, ClientException {
		if (StringUtils.isEmpty(properties.getAppName())) {
			logger.error("please set {}.appName", SchedulerxProperties.CONFIG_PREFIX);
			throw new IOException(String.format("please set %s.appName", SchedulerxProperties.CONFIG_PREFIX));
		}

		if (StringUtils.isEmpty(properties.getAppKey())) {
			logger.error("please set {}.appKey", SchedulerxProperties.CONFIG_PREFIX);
			throw new IOException(String.format("please set %s.appKey", SchedulerxProperties.CONFIG_PREFIX));
		}

		if (StringUtils.isEmpty(properties.getGroupId())) {
			logger.error("please set {}.groupId", SchedulerxProperties.CONFIG_PREFIX);
			throw new IOException(String.format("please set %s.groupId", SchedulerxProperties.CONFIG_PREFIX));
		}

		CreateAppGroupRequest request = new CreateAppGroupRequest();
		request.setNamespace(properties.getNamespace());
		request.setNamespaceSource(getNamespaceSource());
		request.setAppName(properties.getAppName());
		request.setGroupId(properties.getGroupId());
		request.setAppKey(properties.getAppKey());
		if (StringUtils.isNotEmpty(properties.getAlarmChannel())) {
			MonitorConfig monitorConfig = new MonitorConfig();
			monitorConfig.setSendChannel(properties.getAlarmChannel());
			request.setMonitorConfigJson(JsonUtil.toJson(monitorConfig));
		}
		if (!properties.getAlarmUsers().isEmpty()) {
			List<ContactInfo> contactInfos = new ArrayList(properties.getAlarmUsers().values());
			request.setMonitorContactsJson(JsonUtil.toJson(contactInfos));
		}
		CreateAppGroupResponse response = client.getAcsResponse(request);

View on GitHub (pinned to 115d590110)

Solutions

  1. Copy the groupId from the Alibaba SchedulerX2 console and set spring.cloud.scheduling.schedulerx.groupId.
  2. Verify appName, appKey, and groupId are all present and correctly indented together.
  3. If groupId should differ per environment, use a profile-specific application-{profile}.yml and confirm the active profile.

Example fix

# before
spring:
  cloud:
    scheduling:
      schedulerx:
        appName: my-app
        appKey: a1b2c3*******

# after
spring:
  cloud:
    scheduling:
      schedulerx:
        appName: my-app
        appKey: a1b2c3*******
        groupId: app-123
Defensive patterns

Strategy: validation

Validate before calling

Assert.hasText(properties.getGroupId(), "spring.cloud.scheduling.schedulerx.groupId must be set before job sync");

Prevention

When it happens

Trigger: Calling syncAppGroup(client) while properties.getGroupId() returns null or "" (StringUtils.isEmpty check at JobSyncService.java:184-185). Reached during auto job sync when spring.cloud.scheduling.schedulerx.jobs is non-empty and the starter is enabled (default).

Common situations: groupId is mistaken for appName and only appName is set; groupId is provisioned in the SchedulerX2 console but never copied into config; multi-module project where the property is set in a sibling module's YAML that is not on the classpath.

Related errors


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