apache/dolphinscheduler · error · ServiceException

10088

10088

Error message

delete tenant by id error

What it means

Thrown in TenantServiceImpl.deleteTenantById when the final tenantDao.deleteTenantById operation fails or throws after all reference checks passed. This is a persistence failure (database error/constraint), not a usage conflict — the tenant row could not actually be removed.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java:244

        }

        List<WorkflowInstanceSummaryDto> workflowInstances = getWorkflowInstancesByTenant(tenant);
        if (CollectionUtils.isNotEmpty(workflowInstances)) {
            throw new ServiceException(Status.DELETE_TENANT_BY_ID_FAIL, workflowInstances.size());
        }

        List<Schedule> schedules = scheduleDao.queryScheduleListByTenant(tenant.getTenantCode());
        if (CollectionUtils.isNotEmpty(schedules)) {
            throw new ServiceException(Status.DELETE_TENANT_BY_ID_FAIL_DEFINES, schedules.size());
        }

        List<User> userList = userDao.queryUserListByTenant(tenant.getId());
        if (CollectionUtils.isNotEmpty(userList)) {
            throw new ServiceException(Status.DELETE_TENANT_BY_ID_FAIL_USERS, userList.size());
        }

        if (!tenantDao.deleteById(id)) {
            throw new ServiceException(Status.DELETE_TENANT_BY_ID_ERROR);
        }

        workflowInstanceDao.updateWorkflowInstanceByTenantCode(tenant.getTenantCode(), Constants.DEFAULT);
    }

    private List<WorkflowInstanceSummaryDto> getWorkflowInstancesByTenant(Tenant tenant) {
        return workflowInstanceDao.queryByTenantCodeAndStatus(
                tenant.getTenantCode(),
                WorkflowExecutionStatus.NOT_TERMINAL_STATES);
    }

    /**
     * query tenant list
     *
     * @param loginUser login user
     * @return tenant list
     */
    @Override

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Inspect server logs and database health for the root delete failure.
  2. Retry the deletion once the database issue is resolved.
  3. Verify no race condition re-added references between the checks and the delete.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java:244 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/be0ca046ca1b19c0. Report an issue: GitHub.