quarkusio/quarkus · error · IllegalArgumentException

Description for job '{identity}' is too long: {length} chara

Error message

Description for job '{identity}' is too long: {length} characters (max 250)

What it means

Quarkus validates that a job's description does not exceed Scheduled.DESCRIPTION_MAX_LENGTH (250 characters) and throws this IllegalArgumentException from validateDescriptionLength when it does. The validation runs when creating job definitions/triggers (both static @Scheduled descriptions and programmatic newJob().setDescription()), keeping Quartz metadata within limits imposed by the Scheduler API contract.

Source

Thrown at extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java:677

    }

    private void putExtensionConfigurationProperties(Properties props, String prefix,
            Map<String, QuartzExtensionPointConfig> configs) {
        configs.forEach((configKey, config) -> {
            putExtensionConfigurationProperties(props, String.format("%s.%s", prefix, configKey), config);
        });
    }

    private void putExtensionConfigurationProperties(Properties props, String prefix, QuartzExtensionPointConfig config) {
        props.put(String.format("%s.class", prefix), config.clazz());
        config.properties().forEach((propName, propValue) -> {
            props.put(String.format("%s.%s", prefix, propName), propValue);
        });
    }

    private static void validateDescriptionLength(String identity, String description) {
        if (description != null && description.length() > Scheduled.DESCRIPTION_MAX_LENGTH) {
            throw new IllegalArgumentException(
                    "Description for job '" + identity + "' is too long: " + description.length()
                            + " characters (max " + Scheduled.DESCRIPTION_MAX_LENGTH + ")");
        }
    }

    private JobBuilder createJobBuilder(String identity, String invokerClassName, boolean noncurrent, String description) {
        Class<? extends Job> jobClass = noncurrent ? NonconcurrentInvokerJob.class
                : InvokerJob.class;
        JobBuilder jobBuilder = JobBuilder.newJob(jobClass)
                // new JobKey(identity, "io.quarkus.scheduler.Scheduler")
                .withIdentity(identity, Scheduler.class.getName())
                // this info is redundant but keep it for backward compatibility
                .usingJobData(INVOKER_KEY, invokerClassName)
                .requestRecovery();
        if (description != null) {
            jobBuilder.withDescription(description);
        }
        return jobBuilder;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Shorten the description to 250 characters or fewer
  2. Truncate programmatically before setting: description.length() > 250 ? description.substring(0, 250) : description
  3. Move long documentation into a doc comment or external docs; keep the description as a short summary
  4. Add a startup/config validation for description sources (config properties, DB) that feed descriptions

Example fix

// before
jobDef.setDescription(longMarkdownDocs); // IllegalArgumentException
// after
String desc = longMarkdownDocs;
if (desc != null && desc.length() > 250) {
    desc = desc.substring(0, 250);
}
jobDef.setDescription(desc);
Defensive patterns

Strategy: validation

Validate before calling

static String safeDescription(String d) {
    return (d == null || d.length() <= 250) ? d : d.substring(0, 250);
}

Type guard

boolean isValidDescription(String d) {
    return d == null || d.length() <= 250;
}

Try / catch

try {
    jobDef.setDescription(description);
} catch (IllegalArgumentException e) {
    jobDef.setDescription(description.substring(0, 250));
}

Prevention

When it happens

Trigger: Declaring a @Scheduled job with a description longer than 250 characters, or calling QuartzJobDefinition.setDescription(...) with a string over 250 characters during programmatic job creation.

Common situations: Using a full documentation paragraph as the job description; loading descriptions from config or i18n bundles without length checks; descriptions copied from Javadoc.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/63f7ae950eedd3bb. Report an issue: GitHub.