{"record":{"id":"a24d7e5c531fc82e","repo":"apereo/cas","slug":"registered-service-with-id-and-service-id","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/mgmt/AbstractServicesManager.java","lineNumber":553,"sourceCode":"    }\n\n    @SafeVarargs\n    private static Predicate<RegisteredService> getRegisteredServicesFilteringPredicate(\n        final Predicate<RegisteredService>... predicates) {\n        return Stream.of(predicates).reduce(x -> true, Predicate::and);\n    }\n\n    private static void flattenAttributeReleasePolicy(final RegisteredService registeredService) {\n        if (registeredService.getAttributeReleasePolicy() instanceof final RegisteredServiceChainingAttributeReleasePolicy chain\n            && chain.getPolicies().size() == 1) {\n            registeredService.setAttributeReleasePolicy(chain.getPolicies().getFirst());\n        }\n    }\n\n    private static void verifyServiceDefinition(final RegisteredService registeredService) {\n        if (StringUtils.isBlank(registeredService.getName())) {\n            registeredService.setName(\"Service-\" + registeredService.getId());\n            LOGGER.warn(\"Registered service with id [{}] and service id [{}] is not assigned a name. \"\n                    + \"This is a required field and failure to set this field correctly may lead to \"\n                    + \"unpredictable behavior. For now, CAS has automatically assigned a name to this service: [{}].\"\n                    + \"To remove this warning, please consider assigning a name to the application definition directly.\",\n                registeredService.getId(), registeredService.getServiceId(), registeredService.getName());\n        }\n    }\n}\n","sourceCodeStart":535,"sourceCodeEnd":561,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/mgmt/AbstractServicesManager.java#L535-L561","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (JSON service definition)\n{\n  \"@class\": \"org.apereo.cas.services.RegexRegisteredService\",\n  \"serviceId\": \"^https://app.example.org\",\n  \"id\": 100\n}\n// after\n{\n  \"@class\": \"org.apereo.cas.services.RegexRegisteredService\",\n  \"serviceId\": \"^https://app.example.org\",\n  \"id\": 100,\n  \"name\": \"Example Application\"\n}","handlingStrategy":"validation","validationCode":"// Java: before saving\nif (service.getName() == null || service.getName().isBlank()) {\n    throw new IllegalArgumentException(\"Registered service \" + service.getId() + \" must have a name\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["config","registered-service","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}