paascloud/paascloud-master · error · UacBizException

UAC10011001

UAC10011001

Error message

UAC10011001

What it means

UAC10011001 is thrown by getOwnActionListByUserId when userId is null (UAC10011xxx = user/permission group). It guards the per-user action listing which would otherwise behave ambiguously for a null user.

Solutions

  1. Ensure the authenticated userId is resolved and passed in (from LoginAuthDto/session)
  2. Fix auth/session handling so userId is never null for this path
  3. Validate userId != null before the call

Example fix

// before
List<UacAction> actions = uacActionService.getOwnActionListByUserId(loginAuthDto.getId());
// after
Preconditions.checkNotNull(loginAuthDto, "login user required");
Preconditions.checkNotNull(loginAuthDto.getId(), "userId required");
List<UacAction> actions = uacActionService.getOwnActionListByUserId(loginAuthDto.getId());
Defensive patterns

Strategy: validation

Validate before calling

if (userId == null) { throw new IllegalStateException("user not authenticated"); }

Type guard

null

Try / catch

try { return service.getOwnActionListByUserId(userId); } catch (UacBizException e) { return Collections.emptyList(); }

Prevention

When it happens

Trigger: getOwnActionListByUserId(null), typically when session/user context was lost, anonymous access, or the userId was not copied from the auth header/token.

Common situations: Expired session leaving userId null; internal service call forgetting to forward the user id; misconfigured auth filter not populating the header.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java:145

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public List<MenuVo> getOwnAuthList(Long userId) {
		return uacActionMapper.getOwnAuthList(userId);
	}

	@Override
	@Transactional(readOnly = true, rollbackFor = Exception.class)
	public List<Long> getCheckedMenuList(Long roleId) {
		if (roleId == null) {
			throw new UacBizException(ErrorCodeEnum.UAC10012001);
		}
		return uacActionMapper.getCheckedMenuList(roleId);
	}

	@Override
	public List<UacAction> getOwnActionListByUserId(Long userId) {
		if (userId == null) {
			throw new UacBizException(ErrorCodeEnum.UAC10011001);
		}
		List<UacAction> uacActionList;
		if (Objects.equals(userId, GlobalConstant.Sys.SUPER_MANAGER_USER_ID)) {
			// 获取全部权限信息
			uacActionList = uacActionMapper.selectAll();
		} else {
			uacActionList = uacActionMapper.getOwnUacActionListByUserId(userId);
		}
		return uacActionList;
	}

	@Override
	public List<UacAction> listActionListByRoleId(Long roleId) {
		return uacActionMapper.listActionListByRoleId(roleId);
	}

	@Override
	public List<UacAction> listActionList(List<UacMenu> uacMenus) {

View on GitHub (pinned to 781281a950)