paascloud/paascloud-master · error · UacBizException
UAC10014003
UAC10014003
Error message
UAC10014003
What it means
UAC10014003 is thrown by saveAction when updating an existing action (updateByPrimaryKeySelective) affects zero rows. It means the update targeted an action id that does not exist or was concurrently deleted.
Solutions
- Verify action.id exists before updating; treat 0-updated-rows as record-not-found on the client
- Refresh the permission list and re-apply the edit with a valid id
- Consider falling back to insert when the row is missing if that matches business intent
Example fix
// before
int result = uacActionMapper.updateByPrimaryKeySelective(action);
if (result < 1) {
throw new UacBizException(ErrorCodeEnum.UAC10014003);
}
// after
if (uacActionMapper.selectByPrimaryKey(action.getId()) == null) {
throw new UacBizException(ErrorCodeEnum.UAC10014001, action.getId());
}
uacActionMapper.updateByPrimaryKeySelective(action); Defensive patterns
Strategy: validation
Validate before calling
if (action.getId() != null && uacActionMapper.selectByPrimaryKey(action.getId()) == null) { treat as not found; } Type guard
null
Try / catch
try { service.saveAction(action, loginAuthDto); } catch (UacBizException e) { if ("UAC10014003".equals(e.getCode())) { alertStaleRecord(); } } Prevention
- Detect stale edits and prompt the user to reload
- Include a version/updatedAt check for concurrent edits
- Verify ids against the correct environment
When it happens
Trigger: saveAction(action, loginAuthDto) with action.id non-null but not present in uac_action; optimistic-concurrency style failure where the row vanished before the update.
Common situations: User edits a permission row in a stale browser tab after another admin deleted it; wrong environment DB; client sent a bogus id with the update payload.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/d3705076fe4f6415.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java:106
}
}
@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) {
throw new UacBizException(ErrorCodeEnum.UAC10014003);
}
}
}
@Override
public int deleteByMenuId(Long id) {
Preconditions.checkArgument(id != null, "菜单ID不能为空");
return uacActionMapper.deleteByMenuId(id);
}
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public List<Long> getCheckedActionList(Long roleId) {
if (roleId == null) {
throw new UacBizException(ErrorCodeEnum.UAC10012001);
}
return uacActionMapper.getCheckedActionList(roleId);View on GitHub (pinned to 781281a950)