paascloud/paascloud-master · error · UacBizException
UAC10014002
UAC10014002
Error message
UAC10014002
What it means
UAC10014002 is thrown by batchDeleteByIdList when the number of rows deleted (result) is less than the size of deleteIdList, meaning some (or all) permission ids could not be deleted. The message carries the comma-joined id list.
Solutions
- Re-query uac_action to keep only existing ids, then batch delete again
- Compare the deleted count against remaining ids to identify which failed
- Retry the batch transactionally or delete remaining ids one by one with individual error reporting
Example fix
// before
int result = uacActionMapper.batchDeleteByIdList(deleteIdList);
if (result < deleteIdList.size()) {
throw new UacBizException(ErrorCodeEnum.UAC10014002, Joiner.on(",").join(deleteIdList));
}
// after
int result = uacActionMapper.batchDeleteByIdList(deleteIdList);
if (result < deleteIdList.size()) {
logger.warn("partial delete: requested={}, deleted={}", deleteIdList.size(), result);
} Defensive patterns
Strategy: validation
Validate before calling
List<Long> existing = filterExistingIds(deleteIdList); if (existing.isEmpty()) return;
Type guard
null
Try / catch
try { service.batchDeleteByIdList(ids); } catch (UacBizException e) { logger.warn("partial batch delete: {}", e.getMessage()); } Prevention
- Re-check id existence immediately before batch delete
- Handle partial success instead of failing the whole batch
- Use transactions so partial deletes roll back cleanly
When it happens
Trigger: batchDeleteByIdList(deleteIdList) where one or more ids in the list no longer exist in uac_action, or a row is protected/locked so the batch delete statement skips it.
Common situations: Concurrent deletion by another user between listing and batch delete; list contains ids from another environment; partially seeded data.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/d38e709763be094d.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java:87
UacAction uacAction = uacActionMapper.selectByPrimaryKey(actionId);
if (uacAction == null) {
logger.error("找不到权限信息 actionId={}", actionId);
throw new UacBizException(ErrorCodeEnum.UAC10014001, actionId);
}
// 删除角色权限表数据 不查询了 直接删除了
uacRoleActionMapper.deleteByActionId(actionId);
return uacActionMapper.deleteByPrimaryKey(actionId);
}
@Override
public void batchDeleteByIdList(List<Long> deleteIdList) {
logger.info("批量删除角色. deleteIdList={}", deleteIdList);
Preconditions.checkArgument(PublicUtil.isNotEmpty(deleteIdList), "删除权限ID不能为空");
int result = uacActionMapper.batchDeleteByIdList(deleteIdList);
if (result < deleteIdList.size()) {
throw new UacBizException(ErrorCodeEnum.UAC10014002, Joiner.on(GlobalConstant.Symbol.COMMA).join(deleteIdList));
}
}
@Override
public void saveAction(UacAction action, LoginAuthDto loginAuthDto) {
List<Long> menuIdList = action.getMenuIdList();
Long menuId;
Preconditions.checkArgument(PublicUtil.isNotEmpty(menuIdList), "菜单名称不能为空");
menuId = menuIdList.get(menuIdList.size() - 1);
action.setMenuId(menuId);
action.setUpdateInfo(loginAuthDto);
if (action.isNew()) {
Long actionId = super.generateId();
action.setId(actionId);
uacActionMapper.insertSelective(action);
} else {
int result = uacActionMapper.updateByPrimaryKeySelective(action);
if (result < 1) {View on GitHub (pinned to 781281a950)