apache/dolphinscheduler · error · ServiceException

10010

10010

Error message

user {userId} not exists

What it means

Thrown by UsersServiceImpl.updateUser when the User argument is null or its id is null. The method needs a primary key to run userDao.updateById; without an id there is no row to update. It signals a programming/caller bug rather than a missing database row (that case is error 334 with the userId argument).

Source

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

        Page<User> page = new Page<>(pageNo, pageSize);

        IPage<User> scheduleList = userDao.queryUserPaging(page, searchVal);

        PageInfo<User> pageInfo = new PageInfo<>(pageNo, pageSize);
        pageInfo.setTotal((int) scheduleList.getTotal());
        pageInfo.setTotalList(scheduleList.getRecords());
        result.setData(pageInfo);
        putMsg(result, Status.SUCCESS);

        return result;
    }

    @Override
    @Transactional
    public User updateUser(User user) {
        if (user == null || user.getId() == null) {
            throw new ServiceException(Status.USER_NOT_EXIST);
        }
        // Ensure the update time is set
        user.setUpdateTime(new Date());
        boolean updated = userDao.updateById(user);

        if (!updated) {
            throw new ServiceException(Status.UPDATE_USER_ERROR);
        }
        return user;
    }

    @Override
    @Transactional
    public User updateUser(User loginUser,
                           Integer userId,
                           String userName,
                           String userPassword,
                           String email,

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Ensure the User object passed to updateUser has a non-null id (fetch it via queryByUserName first if needed)
  2. In the REST layer, validate that the request body contains a numeric id before invoking the service
  3. Return a 400-level param error to the caller instead of a 500 when id is absent

Example fix

// before
User u = new User(); u.setUserName("bob");
usersService.updateUser(u); // NPE path -> USER_NOT_EXIST
// after
User u = userDao.queryByUserNameAccurately("bob");
if (u == null) throw new IllegalArgumentException("user 'bob' not found");
u.setUserName("bobby");
usersService.updateUser(u);
Defensive patterns

Strategy: validation

Validate before calling

// before calling updateUser
if (user == null || user.getId() == null) {
    throw new IllegalArgumentException("updateUser requires a User with a non-null id");
}

Type guard

boolean isUpdatable(User u) { return u != null && u.getId() != null; }

Try / catch

try {
    usersService.updateUser(user);
} catch (ServiceException e) {
    if (e.getCode() == Status.USER_NOT_EXIST.getCode()) {
        throw new BadRequestException("user id missing in update payload");
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling updateUser(user) with a null User object, or with a User constructed client-side (e.g. new User()) whose id was never set; deserialization dropping the id field.

Common situations: API consumers building a partial update payload and forgetting to echo back the id; mapping code that copies request fields into a new User instead of fetching the existing one; JSON body missing the id key.

Understand the failure class

Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.

Related errors


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