apache/dolphinscheduler · error · ServiceException

30001

30001

Error message

user has no operation privilege

What it means

Thrown at the top of UsersServiceImpl.createUser when isAdmin(loginUser) is false: only users with the ADMIN role may create other users. It is an authorization guard firing because the caller's session user lacks admin privilege, not a data problem.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java:126

     * @param email        email
     * @param tenantId     tenant id
     * @param phone        phone
     * @param queue        queue
     * @return create result code
     * @throws Exception exception
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public User createUser(User loginUser,
                           String userName,
                           String userPassword,
                           String email,
                           int tenantId,
                           String phone,
                           String queue,
                           int state) throws Exception {
        if (!isAdmin(loginUser)) {
            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }

        // check all user params
        String msg = this.checkUserParams(userName, userPassword, email, phone);
        if (!StringUtils.isEmpty(msg)) {
            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, msg);
        }

        if (!checkTenantExists(tenantId)) {
            log.warn("Tenant does not exist, tenantId:{}.", tenantId);
            throw new ServiceException(Status.TENANT_NOT_EXIST);
        }

        User user = createUser(userName, userPassword, email, tenantId, phone, queue, state);
        log.info("User is created and id is {}.", user.getId());
        return user;
    }

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Log in with an account that has the ADMIN role before calling the create-user API
  2. Grant the required admin role to the calling user via the security center if it legitimately needs user-management rights
  3. Check that the correct session/token of the admin user is being sent, not a lower-privileged account
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java:126 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/36477ed119b797e1. Report an issue: GitHub.