apache/skywalking · error · IllegalArgumentException

Output type {outputTypeName} has no setter for field '{field

Error message

Output type {outputTypeName} has no setter for field '{fieldType}' (tried: {candidates})

What it means

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).

Source

Thrown at oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALBlockCodegen.java:262

     *
     * <p>Standard fields: service, instance, endpoint, layer, traceId,
     * segmentId, spanId, timestamp.
     */
    private static void generateFieldToOutput(
            final StringBuilder sb,
            final LALScriptModel.FieldAssignment field,
            final LALClassGenerator.GenCtx genCtx) {
        final String[] candidates =
            FIELD_TYPE_SETTER_CANDIDATES[field.getFieldType().ordinal()];
        Method setter = null;
        for (final String candidate : candidates) {
            setter = findSetter(genCtx.outputType, candidate);
            if (setter != null) {
                break;
            }
        }
        if (setter == null) {
            throw new IllegalArgumentException(
                "Output type " + genCtx.outputType.getName()
                + " has no setter for field '" + field.getFieldType().name().toLowerCase()
                + "' (tried: " + String.join(", ", candidates) + ")");
        }

        final Class<?> paramType = setter.getParameterTypes()[0];
        final String effectiveCast = resolveEffectiveCast(paramType, field.getCastType());
        sb.append("  _o.").append(setter.getName()).append("(");
        if (field.getFormatPattern() != null) {
            // Format pattern provided in LAL script (e.g., timestamp ... , "yyyy/MM/dd HH:mm:ss")
            sb.append("h.parseTimestamp(");
            LALValueCodegen.generateCastedValueAccess(sb, field.getValue(), "String", genCtx);
            sb.append(", \"")
              .append(DslJavaSourceText.toLiteral(field.getFormatPattern()))
              .append("\")");
        } else if (paramType.isEnum() || paramType == Layer.class) {
            // `Layer` was historically an enum and is now a registry-backed value type with a
            // matching `valueOf(String)`; both flow through the same `Type.valueOf(string)`

View on GitHub (pinned to 102af09b4a)

Solutions

  1. Only call unregisterDynamic for names your code previously registered via registerDynamic (track them yourself)
  2. If you want the layer gone permanently, remove its declaration from layer-extensions.yml / the MAL/LAL boot file and restart the OAP
  3. If refcount-driven runtime rules are in play, check the RuntimeLayerRegistry refcounts rather than unregistering ad hoc

Example fix

// before
Layer.unregisterDynamic("OS_LINUX"); // built-in, throws
// after — static layers are removed by config + restart, not at runtime
// remove the entry from layer-extensions.yml and restart OAP
Defensive patterns

Strategy: validation

Validate before calling

// only unregister names your code registered dynamically
if (dynamicLayersICreated.remove(name)) Layer.unregisterDynamic(name);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/skywalking@102af09b4a (2026-08-14). Data as JSON: /api/errors/0a0f6c778c516f46. Report an issue: GitHub.