paascloud/paascloud-master · error · UacBizException

UAC10013006

UAC10013006

Error message

更新菜单状态失败,menuId=%s

What it means

UacBizException UAC10013006 thrown by updateUacMenuStatusById when neither the disable nor enable batch path updates at least one row (result < 1). The method dispatches to disableMenuList or enableMenuList for the target menu with its children/parents and throws this generic 'update menu status failed' error if nothing was updated. Message contains the requested menuId.

Solutions

  1. Re-fetch the menu and retry the status change; if it no longer exists, treat as a no-op.
  2. Verify the status value is exactly UacMenuStatusEnum.ENABLE.getType() or DISABLE.getType() — anything else yields an empty batch.
  3. Check the target menuId still exists via selectByKey before updating status.
  4. Inspect DB transaction logs for conflicting concurrent updates on the same rows.

Example fix

// before: assume a valid status populates menuList
uacMenuService.updateUacMenuStatusById(id, statusDto.getStatus());
// after: validate status first
String status = statusDto.getStatus();
if (!UacMenuStatusEnum.ENABLE.getType().equals(status)
    && !UacMenuStatusEnum.DISABLE.getType().equals(status)) {
  throw new IllegalArgumentException("invalid status: " + status);
}
uacMenuService.updateUacMenuStatusById(id, status);
Defensive patterns

Strategy: validation

Validate before calling

String status = statusDto.getStatus();
if (!UacMenuStatusEnum.ENABLE.getType().equals(status)
    && !UacMenuStatusEnum.DISABLE.getType().equals(status)) {
  throw new IllegalArgumentException("invalid status: " + status);
}
if (uacMenuService.selectByKey(statusDto.getId()) == null) {
  // menu gone; no-op
}

Type guard

boolean isValidMenuStatus(String s) {
  return UacMenuStatusEnum.ENABLE.getType().equals(s) || UacMenuStatusEnum.DISABLE.getType().equals(s);
}

Try / catch

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

Prevention

When it happens

Trigger: Calling updateUacMenuStatusById(id, status) where every update in the batch matched 0 rows — typically because the target menu and all its related menus were deleted between selectByKey and the batch update, or the status value produced an empty menuList.

Common situations: Concurrent deletion wiping the subtree during the status change; a status string that is neither ENABLE nor DISABLE leaving menuList empty; stale UI performing the update on already-removed menus.

Related errors


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

Appendix: source

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

			// 获取菜单、其子菜单以及父菜单
			UacMenu uacMenu = new UacMenu();
			uacMenu.setPid(id);
			result = this.selectCount(uacMenu);
			// 此菜单含有子菜单
			if (result > 0) {
				menuList = this.getAllChildMenuByMenuId(id, UacMenuStatusEnum.DISABLE.getType());
			}
			List<UacMenu> menuListTemp = this.getAllParentMenuByMenuId(id);
			for (UacMenu menu : menuListTemp) {
				if (!menuList.contains(menu)) {
					menuList.add(menu);
				}
			}
			// 启用菜单、其子菜单以及父菜单
			result = this.enableMenuList(menuList, loginAuthDto);
		}
		if (result < 1) {
			throw new UacBizException(ErrorCodeEnum.UAC10013006, id);
		}
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public boolean checkMenuHasChildMenu(Long pid) {
		Preconditions.checkArgument(pid != null, "菜单pid不能为空");

		UacMenu uacMenu = new UacMenu();
		uacMenu.setStatus(UacMenuStatusEnum.ENABLE.getType());
		uacMenu.setPid(pid);

		return mapper.selectCount(uacMenu) > 0;
	}

	@Override
	public List<UacMenu> listMenuListByRoleId(Long roleId) {
		List<UacMenu> menuList = uacMenuMapper.listMenuListByRoleId(roleId);

View on GitHub (pinned to 781281a950)