{"record":{"id":"12b182db19940d0b","repo":"apache/skywalking","slug":"cannot-resolve-method-simplename-methodname","errorCode":null,"errorMessage":"Cannot resolve method {simpleName}.{methodName}() in def variable chain","messagePattern":"Cannot resolve method (.+?)\\.(.+?)\\(\\) in def variable chain","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALDefCodegen.java","lineNumber":267,"sourceCode":"\n        String prevExpr = localVar.javaVarName;\n        Class<?> currentType = localVar.resolvedType;\n        boolean canBeNull = true;\n\n        for (int i = 0; i < chain.size(); i++) {\n            final LALScriptModel.ValueAccessSegment seg = chain.get(i);\n            final boolean isLast = i == chain.size() - 1;\n\n            if (seg instanceof LALScriptModel.MethodSegment) {\n                final LALScriptModel.MethodSegment ms =\n                    (LALScriptModel.MethodSegment) seg;\n                final String methodName = ms.getName();\n\n                // Resolve method on currentType via reflection\n                final Method method =\n                    resolveMethod(currentType, methodName, ms.getArguments());\n                if (method == null) {\n                    throw new IllegalArgumentException(\n                        \"Cannot resolve method \" + currentType.getSimpleName()\n                            + \".\" + methodName + \"() in def variable chain\");\n                }\n                final Class<?> returnType = method.getReturnType();\n                final String args =\n                    LALValueCodegen.generateMethodArgs(ms.getArguments(), genCtx);\n\n                if (ms.isSafeNav() && canBeNull) {\n                    if (isLast && returnType.isPrimitive()) {\n                        // Primitive return with null guard\n                        final String boxName =\n                            LALCodegenHelper.boxTypeName(returnType);\n                        prevExpr = \"(\" + prevExpr + \" == null ? null : \"\n                            + boxName + \".valueOf(\" + prevExpr + \".\"\n                            + methodName + \"(\" + args + \")))\";\n                        currentType = returnType;\n                    } else {\n                        prevExpr = \"(\" + prevExpr + \" == null ? null : \"","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALDefCodegen.java#L249-L285","documentation":"Thrown by TimeBucket.retainToDay4MinuteBucket(long) when the argument fails isMinuteBucket — i.e. it is not a 12-digit yyyyMMddHHmm value. The method truncates HHmm to 0000 to get the day-start bucket; feeding it a second/hour/day bucket or an epoch timestamp is a contract violation.","triggerScenarios":"Calling retainToDay4MinuteBucket with a day bucket (yyyyMMdd), a second bucket (yyyyMMddHHmmss), or an epoch-millis value. Typical when a metric pipeline passes the wrong precision tier into a day-retention step.","commonSituations":"Mixing precision tiers across TTL/rollup jobs; refactoring code that used to carry minute buckets into paths that now carry hour buckets; unit tests seeded with fake bucket values that don't respect the digit shape.","solutions":["Guard the call with TimeBucket.isMinuteBucket(bucket) and fix the producer if it isn't minute precision","Convert first: from a day bucket use the value directly; from an epoch use TimeBucket.getTimeBucket(ts, DownSampling.Minute)","Add a unit test asserting the 12-digit shape of buckets entering the rollup path"],"exampleFix":"// before\nlong dayBucket = TimeBucket.retainToDay4MinuteBucket(hourBucket); // throws\n// after\nlong dayBucket;\nif (TimeBucket.isMinuteBucket(hourBucket)) {\n    dayBucket = TimeBucket.retainToDay4MinuteBucket(hourBucket);\n} else {\n    dayBucket = TimeBucket.retainToDay4MinuteBucket(\n        TimeBucket.getTimeBucket(TimeBucket.getTimestamp(hourBucket), DownSampling.Minute));\n}","handlingStrategy":"validation","validationCode":"if (TimeBucket.isMinuteBucket(minuteTimeBucket)) { long day = TimeBucket.retainToDay4MinuteBucket(minuteTimeBucket); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep one bucket-precision convention per pipeline stage","Assert isMinuteBucket in tests for rollup inputs"],"tags":["skywalking","oap","time-bucket","validation"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}