alibaba/spring-ai-alibaba · error · BizException

APP_COMPONENT_QUERYCONFIG_ERROR

APP_COMPONENT_QUERYCONFIG_ERROR

Error message

Failed to query config of component.

What it means

Thrown by queryConfig when getApplicationInputConfig returns null for an existing application: the app exists but has no resolvable component configuration, so the endpoint fails with ErrorCode.APP_COMPONENT_QUERYCONFIG_ERROR instead of returning an empty config.

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/AppComponentController.java:397

		if (StringUtils.isBlank(appId)) {
			throw new BizException(ErrorCode.MISSING_PARAMS.toError("appId"));
		}
		try {
			Application application = appService.getApp(appId);
			if (application == null) {
				throw new BizException(ErrorCode.APP_NOT_FOUND.toError());
			}
			AppComponentConfig applicationInputConfig = appComponentManager.getApplicationInputConfig(application,
					true);
			if (applicationInputConfig != null) {
				AppComponent appComponentDTO = new AppComponent();
				appComponentDTO.setConfig(JsonUtils.toJson(applicationInputConfig));
				appComponentDTO.setAppName(application.getName());
				appComponentDTO.setAppId(application.getAppId());
				return Result.success(context.getRequestId(), appComponentDTO);
			}
			else {
				throw new BizException(ErrorCode.APP_COMPONENT_QUERYCONFIG_ERROR.toError());
			}
		}
		catch (Exception exception) {
			throw new BizException(ErrorCode.APP_COMPONENT_QUERYCONFIG_ERROR.toError());
		}

	}

	/**
	 * Retrieves a list of components by their unique codes.
	 * @param request Query containing a list of component codes to retrieve
	 * @return Result containing a list of matching AppComponent objects
	 */
	@PostMapping("/query-by-codes")
	public Result<List<AppComponent>> listByCodes(@RequestBody AppComponentQuery request) {
		RequestContext context = RequestContextHolder.getRequestContext();
		if (CollectionUtils.isEmpty(request.getCodes())) {
			throw new BizException(ErrorCode.MISSING_PARAMS.toError("codes"));

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Publish or save the application so an input config is generated
  2. Check the app's stored config/input-schema records for the appId
  3. Return an explicit not-found/empty result for null configs instead of a generic error (code fix)
  4. Retry after re-publishing the application

Example fix

// before
else {
    throw new BizException(ErrorCode.APP_COMPONENT_QUERYCONFIG_ERROR.toError());
}
// after
else {
    return Result.success(context.getRequestId(), new AppComponent()); // no config yet
}
Defensive patterns

Strategy: try-catch

Validate before calling

const app = await appApi.getApp(appId); if (!app || !app.published) throw new Error('app has no published config');

Type guard

const hasConfig = (dto) => dto !== null && typeof dto.config === 'string' && dto.config.length > 0;

Try / catch

try { ... } catch (e) { if (e.code === 'APP_COMPONENT_QUERYCONFIG_ERROR') { /* treat as missing config: republish app */ } else throw e; }

Prevention

When it happens

Trigger: GET /appComponent/{appId}/query-config where the application exists but getApplicationInputConfig(application, true) yields null (no published config / no input schema).

Common situations: Application never published or its config was never generated; app created from a template lacking an input schema; config records purged or corrupted.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09). Data as JSON: /api/errors/b01d82d3dccd429d. Report an issue: GitHub.