spinnaker/spinnaker · error · IllegalArgumentException

found field but rejected due to unsupported type

Error message

found field %s but rejected due to unsupported type %s

What it means

FilteredPropertyAccessor.findField found the requested Java field on the type, but the configured returnTypeRestrictor does not allow the field's type, so evaluation is rejected. This is the allowlist doing its job: expressions may only read properties whose return types are permitted.

Solutions

  1. Rewrite the expression to use a property whose type is allowed
  2. Extend the returnTypeRestrictor configuration to allow the needed type if it is safe to expose
  3. Expose a dedicated safe getter/method returning an allowed type

Example fix

// before
${ #target.rawConfig }
// after
${ #target.configJson }
Defensive patterns

Strategy: validation

Validate before calling

// check the field's type is supported before building the expression
Field f = target.getClass().getDeclaredField("rawConfig");
if (!Set.of(String.class, Integer.class, Boolean.class, List.class).contains(f.getType())) {
  throw new IllegalArgumentException("field type not allowlisted: " + f.getType());
}

Type guard

boolean isAllowedReturnType(Class<?> type) {
  return returnTypeRestrictor.supports(type);
}

Prevention

When it happens

Trigger: SpEL expression accesses a field that exists, but whose declared type is not in the allowlist's supported return types (e.g. accessing a raw object/heterogeneous type when only primitives and strings are supported).

Common situations: Expressions reading fields recently typed to an unallowed class; overly restrictive expression allowlist configuration in services like clouddriver/orca; authors trying to traverse into nested objects the allowlist deliberately blocks.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


AI-assisted analysis of spinnaker/spinnaker@1d4a5d0f6d (2026-09-10). Data as JSON: /api/errors/c62fe4485a397476. Report an issue: GitHub.

Appendix: source

Thrown at kork/kork-expressions/src/main/java/com/netflix/spinnaker/kork/expressions/allowlist/FilteredPropertyAccessor.java:55

      throw new IllegalArgumentException(
          format("requested getter %s not found on type %s", propertyName, clazz));
    } else if (!returnTypeRestrictor.supports(getter.getReturnType())) {
      throw new IllegalArgumentException(
          format(
              "found getter for requested %s but rejected due to return type %s",
              propertyName, getter.getReturnType()));
    }
    return getter;
  }

  @Override
  protected Field findField(String name, Class<?> clazz, boolean mustBeStatic) {
    Field field = super.findField(name, clazz, mustBeStatic);
    if (field == null) {
      throw new IllegalArgumentException(
          format("requested field %s not found on type %s", name, clazz));
    } else if (!returnTypeRestrictor.supports(field.getType())) {
      throw new IllegalArgumentException(
          format("found field %s but rejected due to unsupported type %s", name, clazz));
    }
    return field;
  }
}

View on GitHub (pinned to 1d4a5d0f6d)