apache/skywalking · error · IllegalArgumentException
Output type {outputTypeName} has no setter {setterName}() fo
Error message
Output type {outputTypeName} has no setter {setterName}() for output field '{fieldName}' What it means
Thrown by Layer.valueOf(String) when no registered layer carries that name — the strict name lookup matching the old enum-generated valueOf(String). The lenient sibling nameOf(String) returns Layer.UNDEFINED instead of throwing, and is the right choice for untrusted input.
Source
Thrown at oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/v2/compiler/LALBlockCodegen.java:488
*/
static void generateOutputFieldAssignment(
final StringBuilder sb,
final LALScriptModel.OutputFieldAssignment field,
final LALClassGenerator.GenCtx genCtx) {
final String fieldName = field.getFieldName();
final String setterName = "set"
+ Character.toUpperCase(fieldName.charAt(0))
+ fieldName.substring(1);
if (genCtx.outputType == null) {
throw new IllegalArgumentException(
"Output field '" + fieldName + "' requires outputType to be set in the LAL rule config");
}
// Compile-time validation: verify the setter exists on the output type
final Method setter = findSetter(genCtx.outputType, setterName);
if (setter == null) {
throw new IllegalArgumentException(
"Output type " + genCtx.outputType.getName()
+ " has no setter " + setterName
+ "() for output field '" + fieldName + "'");
}
// Generate direct setter call: _o.setXxx(value)
// _o is declared once at the top of the extractor method
final Class<?> paramType = setter.getParameterTypes()[0];
sb.append(" _o.").append(setterName).append("(");
final String effectiveCast = resolveEffectiveCast(paramType, field.getCastType());
if (paramType.isEnum()) {
// Auto-convert String to enum: EnumType.valueOf(stringValue.toUpperCase())
// toUpperCase() handles case-insensitive matching (e.g., "slow" → "SLOW")
sb.append(paramType.getName()).append(".valueOf(((String) ");
LALValueCodegen.generateCastedValueAccess(sb, field.getValue(), "String", genCtx);
sb.append(").toUpperCase())");
} else {
LALValueCodegen.generateCastedValueAccess(sb, field.getValue(), effectiveCast, genCtx);View on GitHub (pinned to 102af09b4a)
Solutions
- Use Layer.nameOf(name) if a missing layer should degrade to UNDEFINED instead of failing
- Fix the name string to exactly match a registered layer name (check Layer.values())
- Declare the expected layer in layer-extensions.yml if it should exist in this deployment
Example fix
// before Layer layer = Layer.valueOf(layerName); // throws on unknown // after Layer layer = Layer.nameOf(layerName); // returns Layer.UNDEFINED on miss
Defensive patterns
Strategy: fallback
Validate before calling
Layer layer = Layer.nameOf(name); // returns UNDEFINED instead of throwing
Try / catch
try { layer = Layer.valueOf(name); } catch (IllegalArgumentException e) { layer = Layer.UNDEFINED; } Prevention
- Use nameOf(String) for any untrusted or user-supplied name
- Validate names against Layer.values() at API boundaries
When it happens
Trigger: Calling Layer.valueOf("MYSQL") when no such layer is registered (typo, lowercase name, or a layer defined only on another OAP deployment). Common at query/GraphQL boundaries or when parsing configuration strings.
Common situations: A typo'd layer name in a query or config; referencing an extension layer that is declared in layer-extensions.yml on one environment but not another; names that don't match the [A-Z][A-Z0-9_]* registry keys.
Related errors
- Failed to load GenAI configuration file.
- Output field '{fieldName}' requires outputType to be set in
- Load meter analyzer configs failed
- Failed to compile hierarchy rule: {name}, expression: {expre
- Hierarchy rule parsing failed: {errors} in expression: {expr
AI-assisted analysis of apache/skywalking@102af09b4a (2026-08-14).
Data as JSON: /api/errors/8dd3471328a67795.
Report an issue: GitHub.