{"record":{"id":"4f713967326961da","repo":"apache/dolphinscheduler","slug":"1300016","errorCode":"1300016","errorMessage":"tenant's fullname is too long error","messagePattern":"tenant's fullname is too long error","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java","lineNumber":90,"sourceCode":"    @Autowired\n    private ScheduleDao scheduleDao;\n\n    @Autowired\n    private UserDao userDao;\n\n    @Autowired\n    private QueueService queueService;\n\n    /**\n     * Check the tenant new object valid or not\n     *\n     * @param tenant The tenant object want to create\n     */\n    private void createTenantValid(Tenant tenant) throws ServiceException {\n        if (StringUtils.isEmpty(tenant.getTenantCode())) {\n            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, tenant.getTenantCode());\n        } else if (StringUtils.length(tenant.getTenantCode()) > TENANT_FULL_NAME_MAX_LENGTH) {\n            throw new ServiceException(Status.TENANT_FULL_NAME_TOO_LONG_ERROR);\n        } else if (!RegexUtils.isValidLinuxUserName(tenant.getTenantCode())) {\n            throw new ServiceException(Status.CHECK_OS_TENANT_CODE_ERROR);\n        } else if (checkTenantExists(tenant.getTenantCode())) {\n            throw new ServiceException(Status.OS_TENANT_CODE_EXIST, tenant.getTenantCode());\n        }\n    }\n\n    /**\n     * Check tenant update object valid or not\n     *\n     * @param existsTenant The exists queue object\n     * @param updateTenant The queue object want to update\n     */\n    private void updateTenantValid(Tenant existsTenant, Tenant updateTenant) throws ServiceException {\n        // Check the exists tenant\n        if (Objects.isNull(existsTenant)) {\n            log.error(\"Tenant does not exist.\");\n            throw new ServiceException(Status.TENANT_NOT_EXIST);","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java#L72-L108","documentation":"Status.TENANT_FULL_NAME_TOO_LONG_ERROR from createTenantValid: the tenantCode exceeds TENANT_FULL_NAME_MAX_LENGTH (64 characters). Since tenant codes become Linux user names, overly long values cannot be created on the OS and are rejected up front.","triggerScenarios":"POST /tenants (or createTenantIfNotExists during user creation flows) with tenantCode longer than the 64-char limit.","commonSituations":"Auto-generating tenant codes from long org/domain names (e.g. 'company-division-longteamname-env' concatenated); LDAP/SSO sync that derives tenant codes from long distinguished names.","solutions":["Shorten the tenantCode to <= 64 characters before creating the tenant.","Apply a truncation/hash scheme in automation: e.g. first 40 chars + short hash.","Normalize SSO/LDAP-derived names to a compact tenant code mapping.","Check for accidental duplication from repeated concatenation in your generator."],"exampleFix":"// before\nString tenantCode = org + \"-\" + division + \"-\" + team + \"-\" + env; // may exceed 64\n// after\nString tenantCode = (org + \"-\" + team).substring(0, Math.min(50, org.length() + team.length() + 1)) + \"-\" + env;","handlingStrategy":"validation","validationCode":"if (tenantCode != null && tenantCode.length() > 64) {\n    throw new IllegalArgumentException(\"tenantCode must be <= 64 chars, got \" + tenantCode.length());\n}","typeGuard":null,"tryCatchPattern":"try {\n    tenantService.createTenant(loginUser, tenantCode, desc, queueId);\n} catch (ServiceException e) {\n    if (e.getCode() == 1300016) { /* shorten tenantCode and retry */ }\n}","preventionTips":["Cap generated tenant codes at 64 chars","Truncate + hash long org-derived names","Normalize SSO/LDAP names to compact codes","Test your generator with worst-case long inputs"],"tags":["validation","tenant","length-limit","naming"],"backgroundTag":"value-out-of-range","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}