quarkusio/quarkus · error · IllegalArgumentException
The specified attribute name "${attributeName}" is not speci
Error message
The specified attribute name "${attributeName}" is not specified in version v1. What it means
CloudEventV1.getAttribute validates the requested attribute name against the CloudEvents spec v1.0 attributes (id, source, type, specversion, datacontenttype, dataschema, subject, time). Any other name results in IllegalArgumentException.
Source
Thrown at extensions/funqy/funqy-amazon-lambda/runtime/src/main/java/io/quarkus/funqy/lambda/model/cloudevents/CloudEventV1.java:155
}
@Override
public OffsetDateTime getTime() {
return this.time;
}
@Override
public Object getAttribute(final String attributeName) throws IllegalArgumentException {
return switch (attributeName) {
case "specversion" -> getSpecVersion();
case "id" -> getId();
case "source" -> getSource();
case "type" -> getType();
case "datacontenttype" -> getDataContentType();
case "dataschema" -> getDataSchema();
case "subject" -> getSubject();
case "time" -> getTime();
default -> throw new IllegalArgumentException(
"The specified attribute name \"" + attributeName + "\" is not specified in version v1.");
};
}
@Override
public Object getExtension(final String s) {
if (s == null) {
throw new IllegalArgumentException("Extension name cannot be null");
}
return this.extensions.get(s);
}
@Override
public Set<String> getExtensionNames() {
return this.extensions.keySet();
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Use only v1 spec attribute names: id, source, type, specversion, datacontenttype, dataschema, subject, time
- Use getExtension(s) for extension attributes
- Check case-sensitivity of the attribute name
Example fix
// before
Object v = event.getAttribute("eventtype");
// after
Object v = event.getAttribute("type"); Defensive patterns
Strategy: validation
Validate before calling
private static final Set<String> V1_ATTRS = Set.of("id","source","type","specversion","datacontenttype","dataschema","subject","time");
if (!V1_ATTRS.contains(attrName)) { /* route to getExtension or reject */ } Type guard
boolean isV1Attribute(String name) {
return name != null && Set.of("id","source","type","specversion","datacontenttype","dataschema","subject","time").contains(name);
} Try / catch
try {
value = event.getAttribute(name);
} catch (IllegalArgumentException e) {
value = event.getExtension(name);
} Prevention
- Use spec v1 attribute names, case-sensitive
- Route extension lookups to getExtension
- Centralize attribute-name constants
When it happens
Trigger: Calling getAttribute(String) with a name not handled by the v1 switch — a typo (e.g. 'eventtype'), wrong case, or an extension name passed to getAttribute instead of getExtension.
Common situations: Generic CloudEvent forwarding code assuming v0.3 attribute names; looking up extension attributes via getAttribute; typos in hardcoded attribute strings.
Related errors
- Extension name cannot be null
- Extra steps left over
- Unknown start character for json value: %s
- name cannot be null
- Either location or predicate must be set
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/94c49c8e03330fe3.
Report an issue: GitHub.