apache/skywalking · error · IllegalArgumentException
Cannot resolve field/getter {simpleName}.{fieldName} in def
Error message
Cannot resolve field/getter {simpleName}.{fieldName} in def variable chain What it means
Thrown by TimeBucket.retainToDayLastMin4MinuteBucket(long) when the argument fails isMinuteBucket — not a 12-digit yyyyMMddHHmm value. This variant pins HHmm to 2359 (last minute of the day) for end-of-day rollups; like its sibling it accepts minute buckets only.
Source
Thrown at oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALDefCodegen.java:311
canBeNull = !returnType.isPrimitive();
}
} else if (seg instanceof LALScriptModel.FieldSegment) {
final LALScriptModel.FieldSegment fs =
(LALScriptModel.FieldSegment) seg;
final String fieldName = fs.getName();
// Try getter first
final String getterName = "get"
+ Character.toUpperCase(fieldName.charAt(0))
+ fieldName.substring(1);
Method getter = null;
try {
getter = currentType.getMethod(getterName);
} catch (NoSuchMethodException e) {
// Try direct field access name
try {
getter = currentType.getMethod(fieldName);
} catch (NoSuchMethodException e2) {
throw new IllegalArgumentException(
"Cannot resolve field/getter "
+ currentType.getSimpleName()
+ "." + fieldName + " in def variable chain");
}
}
final Class<?> returnType = getter.getReturnType();
if (fs.isSafeNav() && canBeNull) {
if (isLast && returnType.isPrimitive()) {
final String boxName =
LALCodegenHelper.boxTypeName(returnType);
prevExpr = "(" + prevExpr + " == null ? null : "
+ boxName + ".valueOf(" + prevExpr + "."
+ getter.getName() + "()))";
currentType = returnType;
} else {
prevExpr = "(" + prevExpr + " == null ? null : "
+ prevExpr + "." + getter.getName() + "())";View on GitHub (pinned to 102af09b4a)
Solutions
- Pre-validate with TimeBucket.isMinuteBucket and reject/convert non-minute inputs before the call
- Regenerate the correct precision with TimeBucket.getTimeBucket(timestamp, DownSampling.Minute) when starting from a raw timestamp
- Check the upstream producer of the bucket (storage column, metric stream) for precision mismatches
Example fix
// before
long endOfDay = TimeBucket.retainToDayLastMin4MinuteBucket(bucket); // throws if not minute
// after
long endOfDay = TimeBucket.isMinuteBucket(bucket)
? TimeBucket.retainToDayLastMin4MinuteBucket(bucket)
: TimeBucket.retainToDayLastMin4MinuteBucket(
TimeBucket.getTimeBucket(System.currentTimeMillis(), DownSampling.Minute)); Defensive patterns
Strategy: validation
Validate before calling
if (TimeBucket.isMinuteBucket(minuteTimeBucket)) { long lastMin = TimeBucket.retainToDayLastMin4MinuteBucket(minuteTimeBucket); } Prevention
- Validate precision before end-of-day rollup conversions
- When refactoring bucket precision, grep all TimeBucket.retain* call sites
When it happens
Trigger: Calling retainToDayLastMin4MinuteBucket with a day/second bucket or an epoch timestamp instead of a minute bucket; commonly hit in TTL or aggregation code that switched bucket precision between versions.
Common situations: Rollup/TTL pipelines fed with hour-precision buckets after a refactor; test fixtures with plausible-looking but wrong-digit longs; data replays from systems that store buckets as epoch millis.
Related errors
- {funcName}() requires exactly 1 argument, got {argCount}
- Cannot resolve method {simpleName}.{methodName}() in def var
- Failed to load GenAI configuration file.
- Output type {outputTypeName} has no setter {setterName}() fo
- def cast type not found on classpath: {castType}
AI-assisted analysis of apache/skywalking@102af09b4a (2026-08-14).
Data as JSON: /api/errors/2b3066a24f42bb27.
Report an issue: GitHub.