apache/dolphinscheduler · error · ServiceException

10179

10179

Error message

Please transform project ownership [{0}]

What it means

Thrown by UsersServiceImpl.deleteUserById when the target user owns one or more projects. DolphinScheduler refuses to delete a project owner and raises TRANSFORM_PROJECT_OWNERSHIP (code 10179) listing the project names; ownership must be transferred first.

Source

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

        // only admin can operate
        if (!isAdmin(loginUser)) {
            log.warn("User does not have permission for this feature, userId:{}, userName:{}.", loginUser.getId(),
                    loginUser.getUserName());
            throw new ServiceException(Status.USER_NO_OPERATION_PERM, id);
        }
        // check exist
        User tempUser = userDao.queryById(id);
        if (tempUser == null) {
            log.error("User does not exist, userId:{}.", id);
            throw new ServiceException(Status.USER_NOT_EXIST, id);
        }
        // check if is a project owner
        List<Project> projects = projectDao.queryProjectCreatedByUser(id);
        if (CollectionUtils.isNotEmpty(projects)) {
            String projectNames = projects.stream().map(Project::getName).collect(Collectors.joining(","));
            log.warn("Please transfer the project ownership before deleting the user, userId:{}, projects:{}.", id,
                    projectNames);
            throw new ServiceException(Status.TRANSFORM_PROJECT_OWNERSHIP, projectNames);
        }
        // delete user
        userDao.queryTenantCodeByUserId(id);

        accessTokenDao.deleteByUserId(id);
        sessionService.expireSession(id);

        if (!userDao.deleteById(id)) {
            log.error("User delete error, userId:{}.", id);
            throw new ServiceException(Status.DELETE_USER_BY_ID_ERROR);
        }
        log.info("User is deleted and id is :{}.", id);
    }

    /**
     * revoke the project permission for specified user by id
     *
     * @param loginUser  Login user

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Transfer each listed project to another user (edit the project and change owner) then retry deletion
  2. Delete the projects if they are no longer needed
  3. Reassign ownership via the projects API before running bulk user deletions

Example fix

// before
deleteUserById(loginUser, userId); // fails: user owns projects A,B
// after
transferProjectOwnership("A", newOwner);
transferProjectOwnership("B", newOwner);
deleteUserById(loginUser, userId);
Defensive patterns

Strategy: validation

Validate before calling

List<Project> owned = projectDao.queryProjectCreatedByUser(id);
if (!owned.isEmpty()) {
    throw new IllegalStateException("transfer ownership of: " + owned.stream().map(Project::getName).collect(Collectors.joining(",")));
}

Try / catch

try { userService.deleteUserById(loginUser, id); } catch (ServiceException e) { if (e.getCode() == 10179) { transferProjectsThenRetry(e.getMessage()); } }

Prevention

When it happens

Trigger: DELETE users/{id} where projectDao.queryProjectCreatedByUser(id) returns a non-empty list; message contains the comma-joined project names.

Common situations: Offboarding employees who created projects; cleanup scripts that delete users without checking project ownership; environments where project ownership was never reassigned.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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