alibaba/Sentinel · error · IllegalArgumentException
${name} is null or empty
Error message
${name} is null or empty What it means
EagleEyeCoreUtils.checkNotNullEmpty(value, name) is the eagleeye core precondition helper: it throws IllegalArgumentException('<name> is null or empty') when the value is null, empty, or whitespace-only. All eagleeye logger builders (file paths, logger names, etc.) funnel through it, so this error marks a required string argument missing or blank.
Source
Thrown at sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:48
public static final String[] EMPTY_STRING_ARRAY = new String[0];
public static boolean isBlank(String str) {
int strLen;
if (str == null || (strLen = str.length()) == 0) {
return true;
}
for (int i = 0; i < strLen; i++) {
if ((!Character.isWhitespace(str.charAt(i)))) {
return false;
}
}
return true;
}
public static String checkNotNullEmpty(String value, String name) throws IllegalArgumentException {
if (isBlank(value)) {
throw new IllegalArgumentException(name + " is null or empty");
}
return value;
}
public static <T> T checkNotNull(T value, String name) throws IllegalArgumentException {
if (value == null) {
throw new IllegalArgumentException(name + " is null");
}
return value;
}
public static <T> T defaultIfNull(T value, T defaultValue) {
return (value == null) ? defaultValue : value;
}
public static boolean isNotBlank(String str) {
return !isBlank(str);
}View on GitHub (pinned to a3f40ba8e9)
Solutions
- Supply a non-blank value, e.g. a concrete path under a known log dir
- Default the variable first: String p = (path == null || path.trim().isEmpty()) ? "/var/log/app" : path;
- Check for misspelled/unloaded config keys feeding the argument at initialization time
Example fix
// before
builder.configLogFilePath(System.getProperty("eagleeye.log.dir")); // null if unset
// after
String dir = System.getProperty("eagleeye.log.dir", "/tmp");
builder.configLogFilePath(dir + "/eagleeye.log"); Defensive patterns
Strategy: validation
Validate before calling
String value = Objects.requireNonNullElse(source, "").trim();
if (value.isEmpty()) {
value = "/default/path"; // or reject explicitly
}
EagleEyeCoreUtils.checkNotNullEmpty(value, "filePath"); Prevention
- Default config-derived strings before passing them to eagleeye builders
- Fail fast at startup with a clear message when required log config is missing, instead of letting the utility throw deep in initialization
When it happens
Trigger: Calling checkNotNullEmpty("", "filePath") or checkNotNullEmpty(null, "loggerName"); indirectly via BaseLoggerBuilder.configLogFilePath("") or other builder methods that validate their arguments with this helper.
Common situations: Building an eagleeye/Sentinel log path from a variable that is null because a config key was misspelled or not yet loaded at static-init time; tests passing empty strings; path properties with only whitespace.
Related errors
- Invalid maxFileSizeMB
- ${name} is null
- keys empty or null: ${keys}
- keys empty or null
- Max entry count should be at least 1:
AI-assisted analysis of alibaba/Sentinel@a3f40ba8e9 (2026-08-14).
Data as JSON: /api/errors/b9669109bdb3e79a.
Report an issue: GitHub.