pinpoint-apm/pinpoint · error · ResponseStatusException

There should be webhookSendInfoId, webhookId and ruleId to u

Error message

There should be webhookSendInfoId, webhookId and ruleId to update webhook send information

What it means

The PUT endpoint for updating webhook send information requires the request body to contain non-empty webhookSendInfoId, webhookId, and ruleId. If any of the three is missing or blank, the controller throws a 400 BAD_REQUEST ResponseStatusException and skips the update. All three fields are needed to identify the record and its webhook/rule associations.

Source

Thrown at webhook/src/main/java/com/navercorp/pinpoint/web/webhook/controller/WebhookSendInfoController.java:77

    @GetMapping()
    public List<WebhookSendInfo> getWebhookSendInfo(@RequestParam(value=WEBHOOK_ID, required=false) String webhookId,
                                                    @RequestParam(value=RULE_ID, required=false) String ruleId) {
        if (!StringUtils.hasText(webhookId) && !StringUtils.hasText(ruleId)) {
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Either webhookId or ruleId is needed to get webhook send information");
        }

        if (StringUtils.hasText(webhookId)) {
            return webhookSendInfoService.selectWebhookSendInfoByWebhookId(webhookId);
        }

        return webhookSendInfoService.selectWebhookSendInfoByRuleId(ruleId);
    }

    @PutMapping()
    public Response updateWebhookSendInfo(@RequestBody WebhookSendInfo webhookSendInfo) {
         if (!StringUtils.hasText(webhookSendInfo.getWebhookSendInfoId()) ||
                !StringUtils.hasText(webhookSendInfo.getWebhookId()) || !StringUtils.hasText(webhookSendInfo.getRuleId())) {
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "There should be webhookSendInfoId, webhookId and ruleId to update webhook send information");
        }
        webhookSendInfoService.updateWebhookSendInfo(webhookSendInfo);
        return SimpleResponse.ok();
    }
}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Load the existing WebhookSendInfo via GET first and send the complete object with all three fields populated.
  2. Ensure webhookSendInfoId, webhookId, and ruleId are all set on the request body before the PUT.
  3. Client-side: validate all three fields are non-empty strings before calling the update API.
  4. Check JSON field names match the WebhookSendInfo Java properties exactly.

Example fix

// before
updateWebhookSendInfo({ webhookSendInfoId: id, webhookId: wid }); // ruleId missing
// after
updateWebhookSendInfo({ webhookSendInfoId: id, webhookId: wid, ruleId: sendInfo.ruleId });
Defensive patterns

Strategy: validation

Validate before calling

const canUpdate = (info) =>
  [info?.webhookSendInfoId, info?.webhookId, info?.ruleId].every((v) => typeof v === 'string' && v.trim() !== '');
if (!canUpdate(webhookSendInfo)) {
  throw new Error('webhookSendInfoId, webhookId and ruleId are all required to update');
}

Type guard

const isUpdatableSendInfo = (v: unknown): v is { webhookSendInfoId: string; webhookId: string; ruleId: string } =>
  typeof v === 'object' && v !== null &&
  ['webhookSendInfoId', 'webhookId', 'ruleId'].every((k) => typeof (v as any)[k] === 'string' && (v as any)[k].trim() !== '');

Try / catch

try {
  await updateWebhookSendInfo(info);
} catch (e) {
  if (e?.status === 400 && /webhookSendInfoId, webhookId and ruleId/.test(e.message)) {
    showError('Update failed: reload the record and ensure all fields are present.');
  } else throw e;
}

Prevention

When it happens

Trigger: Sending PUT with a WebhookSendInfo body where webhookSendInfoId, webhookId, or ruleId is null, absent, an empty string, or whitespace.

Common situations: Clients send a partially-loaded object (only the fields the user edited); the object was created client-side for a new row and lacks a server-generated webhookSendInfoId; field-name casing mismatches make one property silently undefined after deserialization.

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