pinpoint-apm/pinpoint · warning · ResponseStatusException

Missing argument: applicationId / serviceName / ruleId

Error message

Missing argument: applicationId / serviceName / ruleId

What it means

WebhookController.getWebhook requires at least one of three query parameters — applicationId (bound to applicationName), serviceName, or ruleId — to scope the lookup. When all three are absent or empty, the controller rejects the request with HTTP 400 to avoid returning the entire webhook table.

Source

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

    @DeleteMapping()
    public Response deleteWebhook(@RequestBody Webhook webhook) {

        if (!StringUtils.hasText(webhook.getWebhookId())) {
            logger.info("Missing argument: webhookId");
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Missing argument: webhook.id");
        }
        webhookService.deleteWebhook(webhook);
        return SimpleResponse.ok();
    }

    @GetMapping()
    public List<Webhook> getWebhook(@RequestParam(value=APPLICATION_ID, required=false) String applicationName,
                                    @RequestParam(value=SERVICE_NAME, required=false) String serviceName,
                                    @RequestParam(value=ALARM_RULE_ID, required=false) String ruleId) {

        if (!StringUtils.hasText(applicationName) && !StringUtils.hasText(serviceName) && !StringUtils.hasText(ruleId)) {
            logger.info("Missing argument: applicationId/serviceName/ruleId");
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Missing argument: applicationId / serviceName / ruleId");
        }

        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()))) {

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Add at least one filter parameter: ?ruleId=<alarmRuleId>, ?applicationId=<appId>, or ?serviceName=<name>
  2. Use ruleId when you want webhooks attached to a specific alarm rule
  3. Use applicationId+serviceName together when listing all webhooks for an application
  4. Check your HTTP client is not stripping empty-looking but meaningful query parameters

Example fix

// before
GET /webhook
// after
GET /webhook?applicationId=myApp&serviceName=myService
Defensive patterns

Strategy: validation

Validate before calling

boolean hasFilter = hasText(applicationId) || hasText(serviceName) || hasText(ruleId); if (!hasFilter) throw new IllegalArgumentException("Provide at least one of applicationId, serviceName, ruleId");

Type guard

function canQueryWebhooks(p) { return Boolean(p.applicationId?.trim() || p.serviceName?.trim() || p.ruleId?.trim()); }

Try / catch

try { return api.getWebhooks(params); } catch (HttpClientErrorException.BadRequest e) { if (e.getResponseBodyAsString().contains("Missing argument: applicationId")) { /* add a required filter param */ } throw e; }

Prevention

When it happens

Trigger: GET /webhook with no query string; GET /webhook?applicationId= (empty value); passing only unknown parameter names so every @RequestParam resolves to null.

Common situations: Client code forgetting that applicationId maps to the parameter APPLICATION_ID value; users browsing the API in a browser without adding filters; frontends that omit empty-string filters instead of the whole parameter set, plus a logic bug where all filters end up blank.

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/47c3a62aab033f76. Report an issue: GitHub.