pinpoint-apm/pinpoint · warning · ResponseStatusException

Missing arguments: webhook.id, webhook.url, applicationId/se

Error message

Missing arguments: webhook.id, webhook.url, applicationId/serviceName

What it means

WebhookController.updateWebhook validates that the PUT body supplies a webhookId, a url, and an application identity (applicationName or serviceName). If any of these is missing/empty, it throws HTTP 400 before performing URL validation or the update, since an update without the id cannot target a row and without url/application binding would be meaningless.

Source

Thrown at webhook/src/main/java/com/navercorp/pinpoint/web/webhook/controller/WebhookController.java:101

        if (StringUtils.hasText(ruleId)) {
            return webhookService.selectWebhookByRuleId(ruleId);
        }

        if (StringUtils.hasText(applicationName)) {
            return webhookService.selectWebhookByApplicationName(applicationName);
        }

        return webhookService.selectWebhookByServiceName(serviceName);
    }

    @PutMapping()
    public Response updateWebhook(@RequestBody Webhook webhook) {

        if (!StringUtils.hasText(webhook.getWebhookId()) || !StringUtils.hasText(webhook.getUrl()) ||
                !(StringUtils.hasText(webhook.getApplicationName()) || StringUtils.hasText(webhook.getServiceName()))) {
            logger.info("Missing arguments: webhook.id, webhook.url, applicationId/serviceName");
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Missing arguments: webhook.id, webhook.url, applicationId/serviceName");
        }

        try {
            validateURL(webhook);
        } catch (IllegalArgumentException e) {
            logger.info("Invalid argument: webhook.url");
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid argument: webhook.url");
        }

        webhookService.updateWebhook(webhook);
        return SimpleResponse.ok();
    }

    private void validateURL(Webhook webhook) {
        webhook.setUrl(WebhookUrlValidator.validate(webhook.getUrl()));
    }
}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Send the complete Webhook object: webhookId, url, and either applicationName or serviceName all non-empty
  2. Fetch the current webhook via GET /webhook and merge your change before PUTting it back
  3. Verify URL starts with a valid scheme since validateURL runs immediately after this check
  4. Confirm JSON key names/casing match the Webhook DTO fields

Example fix

// before
{"webhookId":"abc123","url":"https://hooks.example.com/x"}
// after
{"webhookId":"abc123","url":"https://hooks.example.com/x","serviceName":"myService"}
Defensive patterns

Strategy: validation

Validate before calling

function canUpdateWebhook(w) { return Boolean(w && w.webhookId?.trim() && w.url?.trim() && (w.applicationName?.trim() || w.serviceName?.trim())); }

Type guard

function isCompleteWebhook(w) { return typeof w.webhookId === 'string' && w.webhookId.length > 0 && typeof w.url === 'string' && w.url.length > 0 && (typeof w.applicationName === 'string' || typeof w.serviceName === 'string'); }

Try / catch

try { await api.updateWebhook(body); } catch (e) { if (e.response?.status === 400 && e.response?.data?.message?.includes('Missing arguments')) { /* re-fetch webhook and merge full object */ } throw e; }

Prevention

When it happens

Trigger: PUT /webhook with body missing webhookId, missing url, or missing both applicationName and serviceName; empty-string values also trigger it; wrong key casing leaves the POJO fields null.

Common situations: Clients echoing back a webhook object read from an API variant that omits url; partial-update attempts sending only changed fields (the API requires full object); renames where serviceName was dropped from the payload.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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