pinpoint-apm/pinpoint · error · IllegalArgumentException

Webhook URL is required

Error message

Webhook URL is required

What it means

WebhookUrlValidator.validateUriSyntax throws IllegalArgumentException when the webhook URL string is null or blank. A webhook target must be a concrete absolute URL before any URI parsing is attempted.

Source

Thrown at commons-server/src/main/java/com/navercorp/pinpoint/common/server/webhook/WebhookUrlValidator.java:89

    ));

    private WebhookUrlValidator() {
    }

    public static String validate(String url) {
        final URI uri = validateUriSyntax(url);
        validateHostWithoutResolving(uri.getHost());

        return uri.toString();
    }

    public static String validateSyntax(String url) {
        return validateUriSyntax(url).toString();
    }

    private static URI validateUriSyntax(String url) {
        if (url == null || url.isBlank()) {
            throw new IllegalArgumentException("Webhook URL is required");
        }

        final URI uri;

        try {
            uri = new URI(url).normalize().parseServerAuthority();
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException("Malformed webhook URL", e);
        }

        validateScheme(uri);
        validateAuthority(uri);

        return uri;
    }

    private static void validateScheme(URI uri) {
        String scheme = uri.getScheme();

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Provide a non-empty webhook URL before calling the validator
  2. Add a required-field check in the form/config layer that surfaces 'URL is required' to the user earlier
  3. Ensure the config property (e.g. webhook.url) is set in the environment or properties file

Example fix

// before
String url = config.get("webhook.url");
WebhookUrlValidator.validateSyntax(url);
// after
String url = config.get("webhook.url");
if (url == null || url.isBlank()) throw new IllegalArgumentException("webhook.url must be configured");
WebhookUrlValidator.validateSyntax(url);
Defensive patterns

Strategy: validation

Validate before calling

if (url == null || url.isBlank()) throw new IllegalArgumentException("webhook URL is required");

Type guard

boolean hasWebhookUrl(String url) { return url != null && !url.isBlank(); }

Try / catch

try { WebhookUrlValidator.validateSyntax(url); } catch (IllegalArgumentException e) { form.reject("url", "Webhook URL is required"); }

Prevention

When it happens

Trigger: Calling WebhookUrlValidator.validateSyntax(url) or uri(url) with null, "", or whitespace-only string; saving a webhook config without a URL field populated.

Common situations: Webhook configuration form submitted with the URL field empty; environment variable or config property for the webhook endpoint unset; JSON payload missing the url key.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/1dfbe28976a6d1b2. Report an issue: GitHub.