prestodb/presto · error · IllegalArgumentException

Invalid property description '%s'

Error message

Invalid property description '%s'

What it means

SessionPropertyMetadata validates the property description: it must be non-empty and contain no leading/trailing whitespace. Descriptions are shown verbatim in documentation and EXPLAIN-style output, so canonical text is required.

Source

Thrown at presto-spi/src/main/java/com/facebook/presto/spi/session/SessionPropertyMetadata.java:56

    @JsonCreator
    public SessionPropertyMetadata(
            @JsonProperty("name") String name,
            @JsonProperty("description") String description,
            @JsonProperty("typeSignature") TypeSignature typeSignature,
            @JsonProperty("defaultValue") String defaultValue,
            @JsonProperty("hidden") boolean hidden)
    {
        this.name = requireNonNull(name, "name is null");
        this.description = requireNonNull(description, "description is null");
        this.typeSignature = requireNonNull(typeSignature, "typeSignature is null");
        this.defaultValue = defaultValue;
        this.hidden = hidden;

        if (name.isEmpty() || !name.trim().toLowerCase(ENGLISH).equals(name)) {
            throw new IllegalArgumentException(format("Invalid property name '%s'", name));
        }
        if (description.isEmpty() || !description.trim().equals(description)) {
            throw new IllegalArgumentException(format("Invalid property description '%s'", description));
        }
    }

    /**
     * Name of the property.  This must be a valid identifier.
     */
    @JsonProperty
    public String getName()
    {
        return name;
    }

    /**
     * Description for the end user.
     */
    @JsonProperty
    public String getDescription()
    {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Trim the description string before constructing
  2. Provide a non-empty one-line description
  3. Remove trailing whitespace/newlines from resource strings

Example fix

// before
.description(" Number of splits ")
// after
.description("Number of splits")
Defensive patterns

Strategy: validation

Validate before calling

if (description == null || description.isEmpty() || !description.trim().equals(description)) { throw new IllegalArgumentException("description must be non-empty without outer whitespace"); }

Type guard

boolean isValidDescription(String d) { return d != null && !d.isEmpty() && d.trim().equals(d); }

Prevention

When it happens

Trigger: Constructing SessionPropertyMetadata with an empty description or one with trailing/leading spaces, e.g. description="Max splits per query ".

Common situations: Plugin authors writing descriptions programmatically or pasting strings with trailing whitespace/line breaks.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/2909aca1eef823f6. Report an issue: GitHub.