apereo/cas · warning
Registered service with id
Error message
Registered service with id [{}] and service id [{}] is not assigned a name. This is a required field and failure to set this field correctly may lead to unpredictable behavior. For now, CAS has automatically assigned a name to this service: [{}].To remove this warning, please consider assigning a name to the application definition directly. What it means
CAS requires every registered service to have a non-blank name. When a service definition is saved via ServicesManager.save and AbstractServicesManager.verifyServiceDefinition finds the name blank, CAS auto-assigns the name 'Service-<id>' and logs this warning. The service still works, but an unnamed service can lead to unpredictable behavior in naming-dependent features and UI displays.
Solutions
- Add or set the 'name' field in the service definition (e.g. "name": "My App") and re-save/reload.
- If building services in code, call service.setName(...) before passing it to servicesManager.save().
- Restart/reload the registry so the corrected definition is picked up, and confirm the warning no longer appears.
Example fix
// before (JSON service definition)
{
"@class": "org.apereo.cas.services.RegexRegisteredService",
"serviceId": "^https://app.example.org",
"id": 100
}
// after
{
"@class": "org.apereo.cas.services.RegexRegisteredService",
"serviceId": "^https://app.example.org",
"id": 100,
"name": "Example Application"
} Defensive patterns
Strategy: validation
Validate before calling
// Java: before saving
if (service.getName() == null || service.getName().isBlank()) {
throw new IllegalArgumentException("Registered service " + service.getId() + " must have a name");
} Prevention
- Always include a 'name' field in JSON/YAML service definitions.
- Validate service definitions (name, serviceId, id) before committing them to the registry directory.
- In code, set name immediately after constructing the RegisteredService.
When it happens
Trigger: Calling servicesManager.save(service) (or saving via the management webapp/JSON/YAML service registry) where RegisteredService.setName() was never called or was set to null/empty/whitespace.
Common situations: Hand-written JSON/YAML service definition files missing the 'name' field; programmatically constructed RegisteredService objects where only serviceId was set; deserialization from a registry file authored before the name field existed.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- No metadata resolvers could be configured for service with…
- Resource ID already exists in namespace .
- Denied
- Username is null.
- Password is null.
AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08).
Data as JSON: /api/errors/a24d7e5c531fc82e.
Report an issue: GitHub.
Appendix: source
Thrown at core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/mgmt/AbstractServicesManager.java:553
}
@SafeVarargs
private static Predicate<RegisteredService> getRegisteredServicesFilteringPredicate(
final Predicate<RegisteredService>... predicates) {
return Stream.of(predicates).reduce(x -> true, Predicate::and);
}
private static void flattenAttributeReleasePolicy(final RegisteredService registeredService) {
if (registeredService.getAttributeReleasePolicy() instanceof final RegisteredServiceChainingAttributeReleasePolicy chain
&& chain.getPolicies().size() == 1) {
registeredService.setAttributeReleasePolicy(chain.getPolicies().getFirst());
}
}
private static void verifyServiceDefinition(final RegisteredService registeredService) {
if (StringUtils.isBlank(registeredService.getName())) {
registeredService.setName("Service-" + registeredService.getId());
LOGGER.warn("Registered service with id [{}] and service id [{}] is not assigned a name. "
+ "This is a required field and failure to set this field correctly may lead to "
+ "unpredictable behavior. For now, CAS has automatically assigned a name to this service: [{}]."
+ "To remove this warning, please consider assigning a name to the application definition directly.",
registeredService.getId(), registeredService.getServiceId(), registeredService.getName());
}
}
}
View on GitHub (pinned to e7288fc434)