apache/dolphinscheduler · warning · ServiceException
1400004
1400004
Error message
description is too long error
What it means
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.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java:99
private static final String TABLE = "TABLE";
private static final String VIEW = "VIEW";
private static final String[] TABLE_TYPES = new String[]{TABLE, VIEW};
private static final String TABLE_NAME = "TABLE_NAME";
private static final String COLUMN_NAME = "COLUMN_NAME";
@Override
public DataSource createDataSource(User loginUser, BaseDataSourceParamDTO datasourceParam) {
DataSourceUtils.checkDatasourceParam(datasourceParam);
if (!canOperatorPermissions(loginUser, null, AuthorizationType.DATASOURCE,
ApiFuncIdentificationConstant.DATASOURCE_CREATE_DATASOURCE)) {
throw new ServiceException(Status.USER_NO_OPERATION_PERM);
}
// check name can use or not
if (checkName(datasourceParam.getName())) {
throw new ServiceException(Status.DATASOURCE_EXIST);
}
if (checkDescriptionLength(datasourceParam.getNote())) {
throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);
}
ConnectionParam connectionParam = DataSourceUtils.buildConnectionParams(datasourceParam);
// build datasource
DataSource dataSource = new DataSource();
Date now = new Date();
dataSource.setName(datasourceParam.getName().trim());
dataSource.setNote(datasourceParam.getNote());
dataSource.setUserId(loginUser.getId());
dataSource.setUserName(loginUser.getUserName());
dataSource.setType(datasourceParam.getType());
dataSource.setConnectionParams(JSONUtils.toJsonString(connectionParam));
dataSource.setCreateTime(now);
dataSource.setUpdateTime(now);
try {
dataSourceDao.insert(dataSource);
return dataSource;View on GitHub (pinned to 02eac45a1b)
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.
Example fix
// before param.setNote(longMarkdownDoc); // after param.setNote(longMarkdownDoc.length() <= 255 ? longMarkdownDoc : longMarkdownDoc.substring(0, 252) + "...");
Defensive patterns
Strategy: validation
Validate before calling
if (note != null && note.length() > 255) { note = note.substring(0, 252) + "..."; } Prevention
- Keep descriptions short; link to docs instead
- Truncate notes programmatically before API calls
- Review templates that copy long text into note
When it happens
Trigger: POST /datasources where the 'note' field exceeds the maximum allowed description length (checkDescriptionLength returns true).
Common situations: Pasting a full connection doc or generated JSON into the description; automation copying long config comments into note.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/b3357c5ae9cd7033.
Report an issue: GitHub.