{"record":{"id":"b3357c5ae9cd7033","repo":"apache/dolphinscheduler","slug":"1400004-b3357c","errorCode":"1400004","errorMessage":"description is too long error","messagePattern":"description is too long error","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java","lineNumber":99,"sourceCode":"    private static final String TABLE = \"TABLE\";\n    private static final String VIEW = \"VIEW\";\n    private static final String[] TABLE_TYPES = new String[]{TABLE, VIEW};\n    private static final String TABLE_NAME = \"TABLE_NAME\";\n    private static final String COLUMN_NAME = \"COLUMN_NAME\";\n\n    @Override\n    public DataSource createDataSource(User loginUser, BaseDataSourceParamDTO datasourceParam) {\n        DataSourceUtils.checkDatasourceParam(datasourceParam);\n        if (!canOperatorPermissions(loginUser, null, AuthorizationType.DATASOURCE,\n                ApiFuncIdentificationConstant.DATASOURCE_CREATE_DATASOURCE)) {\n            throw new ServiceException(Status.USER_NO_OPERATION_PERM);\n        }\n        // check name can use or not\n        if (checkName(datasourceParam.getName())) {\n            throw new ServiceException(Status.DATASOURCE_EXIST);\n        }\n        if (checkDescriptionLength(datasourceParam.getNote())) {\n            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);\n        }\n        ConnectionParam connectionParam = DataSourceUtils.buildConnectionParams(datasourceParam);\n\n        // build datasource\n        DataSource dataSource = new DataSource();\n        Date now = new Date();\n\n        dataSource.setName(datasourceParam.getName().trim());\n        dataSource.setNote(datasourceParam.getNote());\n        dataSource.setUserId(loginUser.getId());\n        dataSource.setUserName(loginUser.getUserName());\n        dataSource.setType(datasourceParam.getType());\n        dataSource.setConnectionParams(JSONUtils.toJsonString(connectionParam));\n        dataSource.setCreateTime(now);\n        dataSource.setUpdateTime(now);\n        try {\n            dataSourceDao.insert(dataSource);\n            return dataSource;","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java#L81-L117","documentation":"createDataSource validates the datasource note/description length with checkDescriptionLength; a too-long note throws Status.DESCRIPTION_TOO_LONG_ERROR (code 1400004). The limit matches the DB column size for the description field.","triggerScenarios":"POST /datasources where the 'note' field exceeds the maximum allowed description length (checkDescriptionLength returns true).","commonSituations":"Pasting a full connection doc or generated JSON into the description; automation copying long config comments into note.","solutions":["Shorten the note to within the allowed length (keep it a brief description).","Move long content into external documentation and keep a short pointer in note.","Truncate programmatically before the API call, e.g. note.length() <= 255."],"exampleFix":"// before\nparam.setNote(longMarkdownDoc);\n// after\nparam.setNote(longMarkdownDoc.length() <= 255 ? longMarkdownDoc : longMarkdownDoc.substring(0, 252) + \"...\");","handlingStrategy":"validation","validationCode":"if (note != null && note.length() > 255) { note = note.substring(0, 252) + \"...\"; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep descriptions short; link to docs instead","Truncate notes programmatically before API calls","Review templates that copy long text into note"],"tags":["datasource","validation","length-limit"],"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-14T00:17:10.932Z"}