{"record":{"id":"0a0f6c778c516f46","repo":"apache/skywalking","slug":"output-type-outputtypename-has-no-setter-for-fie","errorCode":null,"errorMessage":"Output type {outputTypeName} has no setter for field '{fieldType}' (tried: {candidates})","messagePattern":"Output type (.+?) has no setter for field '(.+?)' \\(tried: (.+?)\\)","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/LALBlockCodegen.java","lineNumber":262,"sourceCode":"     *\n     * <p>Standard fields: service, instance, endpoint, layer, traceId,\n     * segmentId, spanId, timestamp.\n     */\n    private static void generateFieldToOutput(\n            final StringBuilder sb,\n            final LALScriptModel.FieldAssignment field,\n            final LALClassGenerator.GenCtx genCtx) {\n        final String[] candidates =\n            FIELD_TYPE_SETTER_CANDIDATES[field.getFieldType().ordinal()];\n        Method setter = null;\n        for (final String candidate : candidates) {\n            setter = findSetter(genCtx.outputType, candidate);\n            if (setter != null) {\n                break;\n            }\n        }\n        if (setter == null) {\n            throw new IllegalArgumentException(\n                \"Output type \" + genCtx.outputType.getName()\n                + \" has no setter for field '\" + field.getFieldType().name().toLowerCase()\n                + \"' (tried: \" + String.join(\", \", candidates) + \")\");\n        }\n\n        final Class<?> paramType = setter.getParameterTypes()[0];\n        final String effectiveCast = resolveEffectiveCast(paramType, field.getCastType());\n        sb.append(\"  _o.\").append(setter.getName()).append(\"(\");\n        if (field.getFormatPattern() != null) {\n            // Format pattern provided in LAL script (e.g., timestamp ... , \"yyyy/MM/dd HH:mm:ss\")\n            sb.append(\"h.parseTimestamp(\");\n            LALValueCodegen.generateCastedValueAccess(sb, field.getValue(), \"String\", genCtx);\n            sb.append(\", \\\"\")\n              .append(DslJavaSourceText.toLiteral(field.getFormatPattern()))\n              .append(\"\\\")\");\n        } else if (paramType.isEnum() || paramType == Layer.class) {\n            // `Layer` was historically an enum and is now a registry-backed value type with a\n            // matching `valueOf(String)`; both flow through the same `Type.valueOf(string)`","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALBlockCodegen.java#L244-L280","documentation":"Thrown by Layer.unregisterDynamic when asked to remove a layer that was not registered through registerDynamic. The DYNAMIC_NAMES ownership set records exactly which names came from the runtime-dynamic channel; built-in Layer constants, layer-extensions.yml entries, SPI extensions, and bundled MAL/LAL definitions arrived via boot-time register() and are permanently non-removable. Distinguishing by ordinal range alone was tried and was unsafe (boot-time extensions can legitimately sit >= 100_000).","triggerScenarios":"Calling Layer.unregisterDynamic(\"K8S\") or Layer.unregisterDynamic(\"MY_STATIC_EXT\") where the name exists but was registered via Layer.register at boot. No-op if the name is unknown; throws only for known-but-static layers.","commonSituations":"Custom tooling that walks the registry and unregisters everything on shutdown; a runtime-rule loader bug that drops refcounts for layers it never owned; attempting to remove a built-in layer to 'clean up' the UI.","solutions":["Only call unregisterDynamic for names your code previously registered via registerDynamic (track them yourself)","If you want the layer gone permanently, remove its declaration from layer-extensions.yml / the MAL/LAL boot file and restart the OAP","If refcount-driven runtime rules are in play, check the RuntimeLayerRegistry refcounts rather than unregistering ad hoc"],"exampleFix":"// before\nLayer.unregisterDynamic(\"OS_LINUX\"); // built-in, throws\n// after — static layers are removed by config + restart, not at runtime\n// remove the entry from layer-extensions.yml and restart OAP","handlingStrategy":"validation","validationCode":"// only unregister names your code registered dynamically\nif (dynamicLayersICreated.remove(name)) Layer.unregisterDynamic(name);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Track which layers your module created via registerDynamic","Never assume 'high ordinal' means 'removable' — ownership is by registration channel"],"tags":["skywalking","oap","layer","lifecycle","misuse"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}