apache/dolphinscheduler · error · ServiceException

10087

10087

Error message

update tenant error

What it means

After validation, updateTenant calls tenantDao.updateById(updateTenant); if the DAO reports no row updated, it throws UPDATE_TENANT_ERROR (code 10087). This indicates the DB update failed or affected zero rows despite passing earlier checks.

Source

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

    public void updateTenant(User loginUser,
                             int id,
                             String tenantCode,
                             int queueId,
                             String desc) throws Exception {

        if (!canOperatorPermissions(loginUser, null, AuthorizationType.TENANT, TENANT_UPDATE)) {
            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }
        if (checkDescriptionLength(desc)) {
            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);
        }
        Tenant updateTenant = new Tenant(id, tenantCode, desc, queueId);
        Tenant existsTenant = tenantDao.queryDetailById(id);
        updateTenantValid(existsTenant, updateTenant);

        updateTenant.setCreateTime(existsTenant.getCreateTime());
        if (!tenantDao.updateById(updateTenant)) {
            throw new ServiceException(Status.UPDATE_TENANT_ERROR);
        }
    }

    /**
     * delete tenant
     *
     * @param loginUser login user
     * @param id        tenant id
     * @return delete result code
     * @throws Exception exception
     */
    @Override
    @Transactional()
    public void deleteTenantById(User loginUser, int id) throws Exception {

        if (!canOperatorPermissions(loginUser, null, AuthorizationType.TENANT, TENANT_DELETE)) {
            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Retry the update after re-checking the tenant still exists
  2. Check API-server logs for the underlying SQL/DB exception
  3. Verify DB health and that the tenant row with the given id exists

Example fix

// caller-side retry
if (!tenantDao.updateById(updateTenant)) {
    // re-query and retry once before failing
    Tenant fresh = tenantDao.queryDetailById(updateTenant.getId());
    if (fresh != null && tenantDao.updateById(updateTenant)) { return; }
    throw new ServiceException(Status.UPDATE_TENANT_ERROR);
}
Defensive patterns

Strategy: retry

Validate before calling

Tenant exists = tenantServiceList.queryTenantList(user, code).getData().stream().filter(t -> t.getId() == id).findFirst().orElse(null); if (exists == null) return; // nothing to update

Try / catch

try { tenantService.updateTenant(user, id, code, queueId, desc); } catch (ServiceException e) { if (e.getCode() == 10087) { /* re-query and retry once; else inspect server logs */ } }

Prevention

When it happens

Trigger: tenantDao.updateById returns false during PUT /tenants/update — e.g. the tenant row was deleted concurrently between queryDetailById and updateById, or a DB error caused the update to fail.

Common situations: Concurrent deletion of the tenant by another admin; database connectivity/constraint problems; transaction rollback leaving the row missing.

Related errors


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