{"record":{"id":"204264294afdae92","repo":"apache/dolphinscheduler","slug":"130031","errorCode":"130031","errorMessage":"time zone [{0}] is illegal","messagePattern":"time zone \\[(.+?)\\] is illegal","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java","lineNumber":396,"sourceCode":"\n        if (StringUtils.isNotEmpty(email)) {\n            if (!CheckUtils.checkEmail(email)) {\n                throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, email);\n            }\n            user.setEmail(email);\n        }\n\n        if (StringUtils.isNotEmpty(phone) && !CheckUtils.checkPhone(phone)) {\n            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, phone);\n        }\n\n        if (state == 0 && user.getState() != state && Objects.equals(loginUser.getId(), user.getId())) {\n            throw new ServiceException(Status.NOT_ALLOW_TO_DISABLE_OWN_ACCOUNT);\n        }\n\n        if (StringUtils.isNotEmpty(timeZone)) {\n            if (!CheckUtils.checkTimeZone(timeZone)) {\n                throw new ServiceException(Status.TIME_ZONE_ILLEGAL, timeZone);\n            }\n            user.setTimeZone(timeZone);\n        }\n\n        user.setPhone(phone);\n        user.setQueue(queue);\n        user.setState(state);\n        user.setUpdateTime(new Date());\n        user.setTenantId(tenantId);\n        // updateWorkflowInstance user\n        if (!userDao.updateById(user)) {\n            throw new ServiceException(Status.UPDATE_USER_ERROR);\n        }\n        return user;\n    }\n\n    /**\n     * delete user","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java#L378-L414","documentation":"Thrown by UsersServiceImpl.updateUser when the timeZone parameter is non-empty but CheckUtils.checkTimeZone cannot resolve it to a valid Java time zone ID. The update aborts with TIME_ZONE_ILLEGAL (code 130031) and the offending value is reported in the message.","triggerScenarios":"Calling users/update with timeZone values like 'UTC+8', 'CST', 'gmt', or a misspelled zone; only non-empty values are validated, so empty string skips the check.","commonSituations":"Frontend sending GMT offsets instead of IANA zone IDs; users typing abbreviations ('PST') rather than 'America/Los_Angeles'; locale differences after upgrades changing accepted formats.","solutions":["Use a valid IANA time zone ID such as 'Asia/Shanghai' or 'America/New_York'","Verify with java.util.TimeZone.getTimeZone(value) and check it is not GMT fallback","Pass empty string/omit the parameter to leave the time zone unchanged"],"exampleFix":"// before\nupdateUser(..., timeZone=\"UTC+8\", ...);\n// after\nupdateUser(..., timeZone=\"Asia/Shanghai\", ...);","handlingStrategy":"validation","validationCode":"if (timeZone != null && !timeZone.isEmpty()\n        && java.util.TimeZone.getTimeZone(timeZone).getID().equals(\"GMT\") && !timeZone.equals(\"GMT\")) {\n    throw new IllegalArgumentException(\"illegal time zone: \" + timeZone);\n}","typeGuard":null,"tryCatchPattern":"try { userService.updateUser(...); } catch (ServiceException e) { if (e.getCode() == 130031) { showFieldError(\"timeZone\", \"Use IANA zone IDs like Asia/Shanghai\"); } }","preventionTips":["Use a timezone picker listing IANA IDs only","Validate with TimeZone.getTimeZone and check the resolved ID","Avoid GMT-offset strings and abbreviations"],"tags":["validation","timezone","user-management"],"backgroundTag":"invalid-config-value","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}