pinpoint-apm/pinpoint · warning · ResponseStatusException

No service type provided.

Error message

No service type provided.

What it means

AdminController.getApplication requires a service type when constructing an Application object for a REST call. If neither serviceTypeCode nor serviceTypeName request parameters are supplied, it throws HTTP 400 'No service type provided.'

Source

Thrown at web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AdminController.java:187

    @RequestMapping(value = "/getInactiveAgents")
    public Map<String, List<Application>> getInactiveAgents(
            @RequestParam(value = "applicationName") @NotBlank String applicationName,
            @RequestParam(value = "durationDays", defaultValue = AdminService.MIN_DURATION_DAYS_FOR_INACTIVITY_STR)
            @Min(AdminService.MIN_DURATION_DAYS_FOR_INACTIVITY)
            int durationDays
    ) {
        logger.info("Getting in-active agents - applicationName: [{}], duration: {} days.",
                applicationName, durationDays);
        return this.adminService.getInactiveAgents(applicationName, durationDays);
    }

    private Application getApplication(Service service, String applicationName, Integer serviceTypeCode, String serviceTypeName) {
        if (serviceTypeCode != null) {
            return applicationFactory.createApplication(service, applicationName, serviceTypeCode);
        } else if (serviceTypeName != null) {
            return applicationFactory.createApplicationByTypeName(service, applicationName, serviceTypeName);
        }
        throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "No service type provided.");
    }
}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Add serviceTypeCode=<int> to the request
  2. Or add serviceTypeName=<string> (e.g. HTTP_CLIENT) to the request
  3. Update client scripts/docs to the current API parameter contract

Example fix

// before
GET /admin/application?applicationName=myApp
// after
GET /admin/application?applicationName=myApp&serviceTypeCode=1010
Defensive patterns

Strategy: validation

Validate before calling

if (serviceTypeCode == null && serviceTypeName == null) throw new IllegalArgumentException("Either serviceTypeCode or serviceTypeName is required");

Type guard

boolean hasServiceType(Integer code, String name) { return code != null || (name != null && !name.isBlank()); }

Prevention

When it happens

Trigger: Calling admin/application-related endpoints that pass applicationName but omit both serviceTypeCode and serviceTypeName query parameters.

Common situations: Older clients or curl scripts written before multi-service (Service) support was added; missing parameter after API refactor; copy-pasted request templates missing the serviceType argument.

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