apache/dolphinscheduler · error · ServiceException
10093
10093
Error message
delete user by id error
What it means
Thrown by UsersServiceImpl.deleteUserById when userDao.deleteById(id) returns false after the access tokens and sessions were already removed. Code DELETE_USER_BY_ID_ERROR (10093) signals the final row deletion did not succeed (zero rows affected or DB failure).
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java:452
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
* @param userId User id
* @param projectIds project id array
* @return
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public void revokeProjectById(User loginUser, int userId, String projectIds) {
// 1. only admin can operate
if (!this.isAdmin(loginUser)) {
throw new ServiceException(Status.USER_NO_OPERATION_PERM);View on GitHub (pinned to 02eac45a1b)
Solutions
- Check API server logs for 'User delete error' and the underlying DB error
- Confirm whether the user was actually deleted (query t_ds_user) and retry only if it still exists
- Inspect foreign-key references (relations, schedules) that may block deletion
- Retry after resolving database connectivity issues; the transaction will roll back token/session deletion
Example fix
// before
userDao.deleteById(id); // unchecked result
// after
if (!userDao.deleteById(id)) {
throw new ServiceException(Status.DELETE_USER_BY_ID_ERROR);
} Defensive patterns
Strategy: try-catch
Validate before calling
if (userDao.queryById(id) == null) { throw new IllegalStateException("user missing before delete"); } Try / catch
try { userService.deleteUserById(loginUser, id); } catch (ServiceException e) { if (e.getCode() == 10093) { investigateDbAndMaybeRetry(e); } } Prevention
- Avoid concurrent deletion of the same user
- Check API/DB logs for the root SQL failure
- Clean up dependent rows (relations, schedules) that may block the delete
When it happens
Trigger: The user row vanished concurrently before deleteById ran; database connectivity/transaction issue; FK constraints causing the delete to fail silently at the DAO layer.
Common situations: Concurrent admin operations deleting the same user; database under duress (locks, timeouts); environments with orphaned references blocking the delete.
Related errors
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/689c0b3f798746cb.
Report an issue: GitHub.