paascloud/paascloud-master · error · UacBizException

UAC10011023

UAC10011023

Error message

UAC10011023

What it means

UAC10011023 is thrown when attempting to disable a group that is not allowed to be disabled: either the group appears in the computed 'cannot-disable' list (all groups minus disabled child nodes) or the current user's own bound group would be affected while enabled. It protects group hierarchy and user binding invariants.

Solutions

  1. Disable child groups first, bottom-up, before disabling the parent
  2. If the intent is to disable the current user's own group, operate with a different account or explicitly handle this restriction
  3. Catch UacBizException UAC10011023 and show 'disable child nodes first' guidance in the UI

Example fix

// before
uacGroupService.updateUacGroupStatusById(parentGroupId, UacGroupStatusEnum.DISABLE.getStatus());
// after
for (Long childId : getAllChildGroupIds(parentGroupId)) { // disable leaves first
    uacGroupService.updateUacGroupStatusById(childId, UacGroupStatusEnum.DISABLE.getStatus());
}
uacGroupService.updateUacGroupStatusById(parentGroupId, UacGroupStatusEnum.DISABLE.getStatus());
Defensive patterns

Strategy: try-catch

Validate before calling

// before disabling, ensure no enabled children remain
List<UacGroup> children = uacGroupMapper.select(new UacGroup().setPid(groupId));
boolean anyEnabled = children.stream().anyMatch(c -> c.getStatus() == UacGroupStatusEnum.ENABLE.getStatus());
if (anyEnabled) { throw new IllegalStateException("Disable children first"); }

Try / catch

try {
    uacGroupService.updateUacGroupStatusById(groupId, UacGroupStatusEnum.DISABLE.getStatus());
} catch (UacBizException e) {
    if (ErrorCodeEnum.UAC10011023.getCode().equals(e.getCode())) { /* prompt: disable children / use another account */ }
    else throw e;
}

Prevention

When it happens

Trigger: Calling updateUacGroupStatusById(groupId, DISABLE) where the group is an ancestor whose subtree is not fully disabled, or where groupUser.getGroupId() equals the target uacGroup id and the group is currently ENABLE.

Common situations: Admin tries to disable a parent organization while its children (and thus descendants) are still enabled; an admin tries to disable the organization they themselves belong to; UI allows selecting parent nodes without checking subtree status.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10). Data as JSON: /api/errors/800ce2ad5fbc14fd. Report an issue: GitHub.

Appendix: source

Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java:112

			zTreeVo = new GroupZtreeVo();
			zTreeVo.setId(vo.getId());
			totalList.add(zTreeVo);
		}

		UacGroupUser uacGroupUser = new UacGroupUser();
		uacGroupUser.setUserId(loginAuthDto.getUserId());
		UacGroupUser groupUser = uacGroupUserMapper.selectOne(uacGroupUser);
		// 查询当前登陆人所在的组织信息
		UacGroup currentUserUacGroup = uacGroupMapper.selectByPrimaryKey(groupUser.getGroupId());
		// 查询当前登陆人能禁用的所有子节点
		List<GroupZtreeVo> childGroupList = this.getGroupTree(currentUserUacGroup.getId());
		// 计算不能禁用的组织= 所有的组织 - 禁用的所有子节点
		totalList.removeAll(childGroupList);
		// 判断所选的组织是否在不能禁用的列表里
		GroupZtreeVo zTreeVo1 = new GroupZtreeVo();
		zTreeVo1.setId(group.getId());
		if (totalList.contains(zTreeVo1)) {
			throw new UacBizException(ErrorCodeEnum.UAC10011023);
		}
		if (groupUser.getGroupId().equals(uacGroup.getId()) && UacGroupStatusEnum.ENABLE.getStatus() == group.getStatus()) {
			throw new UacBizException(ErrorCodeEnum.UAC10011023);
		}
		uacGroup.setGroupName(group.getGroupName());
		uacGroup.setGroupCode(group.getGroupCode());
		uacGroup.setVersion(group.getVersion() + 1);
		int result = uacGroupMapper.updateByPrimaryKeySelective(uacGroup);
		// 获取当前所选组织的所有子节点
		List<GroupZtreeVo> childUacGroupList = this.getGroupTree(uacGroup.getId());
		// 批量修改组织状态
		if (PublicUtil.isNotEmpty(childUacGroupList)) {
			UacGroup childGroup;
			for (GroupZtreeVo uacGroup1 : childUacGroupList) {
				if (UacGroupStatusEnum.ENABLE.getStatus() == status) {
					UacGroup parentGroup = uacGroupMapper.selectByPrimaryKey(uacGroup1.getpId());
					if (parentGroup.getStatus() == UacGroupStatusEnum.DISABLE.getStatus()) {
						throw new UacBizException(ErrorCodeEnum.UAC10015003);

View on GitHub (pinned to 781281a950)