apache/dolphinscheduler · error · IllegalArgumentException
not support showType: %s in DefaultHTMLTemplate
Error message
not support showType: %s in DefaultHTMLTemplate
What it means
Fires in DefaultHTMLTemplate.getMessageFromTemplate when the alert content's showType is neither TABLE nor TEXT. It means the alert JSON contained an unsupported showType value, so no HTML rendering strategy exists for it; the template aborts instead of producing malformed alert HTML.
Source
Thrown at dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/template/DefaultHTMLTemplate.java:57
import org.springframework.boot.configurationprocessor.json.JSONTokener;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
@Slf4j
public class DefaultHTMLTemplate implements AlertTemplate {
@Override
public String getMessageFromTemplate(String content, ShowType showType, boolean showAll) {
switch (showType) {
case TABLE:
return getTableTypeMessage(content, showAll);
case TEXT:
return getTextTypeMessage(content);
default:
throw new IllegalArgumentException(
String.format("not support showType: %s in DefaultHTMLTemplate", showType));
}
}
/**
* get alert message which type is TABLE
*
* @param content message content
* @param showAll weather to show all
* @return alert message
*/
private String getTableTypeMessage(String content, boolean showAll) {
if (StringUtils.isNotEmpty(content)) {
List<LinkedHashMap> mapItemsList = JSONUtils.toList(content, LinkedHashMap.class);
if (!showAll && mapItemsList.size() > EmailConstants.NUMBER_1000) {
mapItemsList = mapItemsList.subList(0, EmailConstants.NUMBER_1000);View on GitHub (pinned to 02eac45a1b)
Solutions
- Set showType to 'TABLE' or 'TEXT' (uppercase) in the task/alert output configuration.
- If a different rendering style is needed, implement a custom HTMLTemplate and register it instead of DefaultHTMLTemplate.
- Log/print the incoming showType to find which component emits the bad value.
Example fix
// before showType=table // after showType=TABLE
Defensive patterns
Strategy: validation
Validate before calling
String showType = ...;
if (!"TABLE".equals(showType) && !"TEXT".equals(showType)) throw new IllegalArgumentException("unsupported showType: " + showType); Try / catch
try { template.getMessageFromTemplate(content, showType, showAll); } catch (IllegalArgumentException e) { log.error("bad showType", e); } Prevention
- Use exact uppercase TABLE/TEXT values
- Check showType emitted by custom tasks
- Fall back to TEXT template for unknown show types
When it happens
Trigger: An alert is rendered with a showType string other than 'TABLE' or 'TEXT' (case-sensitive), or showType is null/missing from the alert content.
Common situations: Typo in showType ('table' lowercase) in task alert output parameters; a custom task emits an unsupported showType like 'ATTACHMENT' or 'MARKDOWN' that the default HTML template cannot render.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/b6ac40c4e96fe997.
Report an issue: GitHub.