alibaba/spring-ai-alibaba · error · BizException

UpdateAppError

UpdateAppError

Error message

Failed to update app.

What it means

BizException with code UpdateAgentError thrown by AppServiceImpl.updateApp's catch-all for any non-BizException failure while persisting an app update, including the Redis cache write (redisManager.put). The original exception is attached as the cause.

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/AppServiceImpl.java:226

			if (StringUtils.isNotBlank(application.getName())) {
				entity.setName(application.getName());
			}
			if (StringUtils.isNotBlank(application.getDescription())) {
				entity.setDescription(application.getDescription());
			}

			entity.setGmtModified(new Date());
			entity.setModifier(context.getAccountId());
			this.updateById(entity);

			String key = getApplicationCacheKey(entity.getWorkspaceId(), entity.getAppId());
			redisManager.put(key, entity);
		}
		catch (BizException e) {
			throw e;
		}
		catch (Exception e) {
			throw new BizException(ErrorCode.UPDATE_AGENT_ERROR.toError(), e);
		}
	}

	/**
	 * Deletes an application and its versions
	 * @param appId ID of the application to delete
	 */
	@Override
	public void deleteApp(String appId) {
		RequestContext context = RequestContextHolder.getRequestContext();
		// delete from db
		AppEntity entity = getAppById(context.getWorkspaceId(), appId);
		if (entity == null) {
			return;
		}

		// delete all versions first
		LambdaUpdateWrapper<AppVersionEntity> updateWrapper = new LambdaUpdateWrapper<>();

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Inspect BizException.getCause() to identify whether the failure came from the DB update or the Redis cache write.
  2. Check Redis connectivity/configuration (redisManager) and DB health.
  3. Retry after infra recovery; ensure the DB row and cache are not left inconsistent (re-read the app to verify).

Example fix

// before
catch (BizException e) { throw e; }
// after
try {
    appService.updateApp(application);
} catch (BizException e) {
    log.error("updateApp failed: {}", e.getMessage(), e.getCause());
    throw e;
}
Defensive patterns

Strategy: retry

Validate before calling

// pre-check dependencies
Assert.notNull(application.getAppId(), "appId required");
// verify infra: redis ping and DB select must succeed before update

Try / catch

try { appService.updateApp(application); } catch (BizException e) { log.error("update failed, cause={}", e.getCause()); if (isTransient(e.getCause())) { retryOnce(application); } else throw e; }

Prevention

When it happens

Trigger: Database update fails (connection, constraint violation, optimistic-lock conflict); Redis cache unavailable or serialization error during redisManager.put; unexpected exceptions in the update path.

Common situations: Redis down or misconfigured in the environment; DB schema drift after version upgrade; field values violating column limits on update.

Related errors


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