paascloud/paascloud-master · error · UacBizException

UAC10013005

UAC10013005

Error message

禁用菜单失败,menuId=%s

What it means

UacBizException UAC10013005 thrown by disableMenuList when a batch update setting a menu's status to DISABLE affects 0 rows (mapper.updateByPrimaryKeySelective returned 0) for one of the menus in the collected list. Called from updateUacMenuStatusById when disabling a menu with its child menus. Message contains the offending menuId.

Solutions

  1. Refresh the menu tree and retry the disable operation so deleted sub-menus are excluded.
  2. Verify each menuId in the batch exists before disabling (selectByPrimaryKey check).
  3. Avoid concurrent delete/disable operations on the same subtree across admin sessions.
  4. Inspect the reported menuId in uac_menu to confirm whether it was removed mid-transaction.

Example fix

// before: disable every collected menu unconditionally
int result = mapper.updateByPrimaryKeySelective(uacMenuUpdate);
if (result < 1) { throw new UacBizException(ErrorCodeEnum.UAC10013005, menu.getId()); }
// after: skip menus that vanished
if (mapper.selectByPrimaryKey(menu.getId()) == null) { continue; }
mapper.updateByPrimaryKeySelective(uacMenuUpdate);
Defensive patterns

Strategy: retry

Validate before calling

List<Long> missing = menuList.stream()
    .map(UacMenu::getId)
    .filter(mid -> uacMenuMapper.selectByPrimaryKey(mid) == null)
    .collect(Collectors.toList());
if (!missing.isEmpty()) { /* re-fetch tree and rebuild menuList */ }

Type guard

boolean allMenusExist(List<UacMenu> menus) {
  return menus.stream().allMatch(m -> uacMenuMapper.selectByPrimaryKey(m.getId()) != null);
}

Try / catch

try {
  uacMenuService.updateUacMenuStatusById(statusDto, loginAuthDto);
} catch (UacBizException e) {
  if ("UAC10013005".equals(e.getCode())) { /* re-fetch tree, retry once */ }
  throw e;
}

Prevention

When it happens

Trigger: Calling updateUacMenuStatusById with status=DISABLE where a menu in the computed menuList (target plus descendants) was deleted or modified concurrently so its selective update matches no row.

Common situations: A child menu removed by another admin while the parent is being disabled; stale UI tree listing already-deleted menus; concurrent status updates overwriting each other.

Related errors


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

Appendix: source

Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacMenuServiceImpl.java:267

		return uacMenuList;
	}

	@Override
	public int disableMenuList(List<UacMenu> menuList, LoginAuthDto loginAuthDto) {
		UacMenu uacMenuUpdate = new UacMenu();
		int sum = 0;
		for (UacMenu menu : menuList) {
			uacMenuUpdate.setId(menu.getId());
			uacMenuUpdate.setVersion(menu.getVersion() + 1);
			uacMenuUpdate.setStatus(UacMenuStatusEnum.DISABLE.getType());
			uacMenuUpdate.setLastOperator(loginAuthDto.getLoginName());
			uacMenuUpdate.setLastOperatorId(loginAuthDto.getUserId());
			uacMenuUpdate.setUpdateTime(new Date());
			int result = mapper.updateByPrimaryKeySelective(uacMenuUpdate);
			if (result > 0) {
				sum += 1;
			} else {
				throw new UacBizException(ErrorCodeEnum.UAC10013005, menu.getId());
			}
		}
		return sum;
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public List<UacMenu> selectMenuList(UacMenu uacMenu) {
		return uacMenuMapper.selectMenuList(uacMenu);
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public List<MenuVo> findAllMenuListByAuthResDto(LoginAuthDto authResDto) {
		List<MenuVo> voList = Lists.newArrayList();
		Preconditions.checkArgument(authResDto != null, "无权访问");

		if (!GlobalConstant.Sys.SUPER_MANAGER_LOGIN_NAME.equals(authResDto.getLoginName())) {

View on GitHub (pinned to 781281a950)