{"record":{"id":"39a4876ed76f5f45","repo":"apereo/cas","slug":"no-groovy-script-cache-manager-is-available-for-at","errorCode":null,"errorMessage":"No groovy script cache manager is available for attribute definition [{}]","messagePattern":"No groovy script cache manager is available for attribute definition \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/attribute/DefaultAttributeDefinition.java","lineNumber":127,"sourceCode":"                LOGGER.trace(\"Encrypted attribute value [{}]\", result);\n                return result;\n            }))\n            .collect(Collectors.toList());\n    }\n\n    private static @Nullable List<Object> fetchAttributeValueFromExternalGroovyScript(final String attributeName,\n                                                                                      final List<Object> currentValues,\n                                                                                      final String file,\n                                                                                      final AttributeDefinitionResolutionContext context) throws Throwable {\n        val result = ApplicationContextProvider.getScriptResourceCacheManager();\n        if (result.isPresent()) {\n            val cacheMgr = result.get();\n            val script = cacheMgr.resolveScriptableResource(file, attributeName, file);\n            if (script != null) {\n                return fetchAttributeValueFromScript(script, attributeName, currentValues, context);\n            }\n        }\n        LOGGER.warn(\"No groovy script cache manager is available for attribute definition [{}]\", attributeName);\n        return new ArrayList<>();\n    }\n\n    private static List<Object> fetchAttributeValueAsInlineGroovyScript(final String attributeName,\n                                                                        final List<Object> currentValues,\n                                                                        final String inlineGroovy,\n                                                                        final AttributeDefinitionResolutionContext context) {\n        return ApplicationContextProvider.getScriptResourceCacheManager()\n            .map(cacheManager -> FunctionUtils.doUnchecked(() -> {\n                val script = cacheManager.resolveScriptableResource(inlineGroovy, attributeName, inlineGroovy);\n                return fetchAttributeValueFromScript(Objects.requireNonNull(script), attributeName, currentValues, context);\n            })).orElseGet(() -> {\n                LOGGER.warn(\"No groovy script cache manager is available for attribute definition [{}]\", attributeName);\n                return new ArrayList<>();\n            });\n    }\n\n    private static @Nullable List<Object> fetchAttributeValueFromScript(","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/attribute/DefaultAttributeDefinition.java#L109-L145","documentation":"DefaultAttributeDefinition tried to resolve an attribute from an external Groovy script file but ApplicationContextProvider.getScriptResourceCacheManager() was empty, so there is no cache manager to load/compile the script. It logs this warning and returns an empty attribute list — the scripted attribute silently resolves to nothing.","triggerScenarios":"An attribute definition with a Groovy script file is resolved while no ScriptResourceCacheManager bean is published in the application context (fetchAttributeValueFromExternalGroovyScript).","commonSituations":"Groovy resource cache manager bean not defined/removed by configuration; scripting support module missing from the build; attribute definition pointing at a .groovy file but the runtime lacks the cache manager dependency.","solutions":["Ensure a GroovyResourceCacheManager (e.g., DefaultGroovyResourceCacheManager) bean is registered in the CAS configuration","Include the required scripting/groovy support module in the overlay so the cache manager auto-configuration runs","If the script is unnecessary, remove the groovyFile/script setting from the attribute definition"],"exampleFix":"// before: no bean\n// after\n@Bean\npublic GroovyResourceCacheManager groovyResourceCacheManager() {\n    return new DefaultGroovyResourceCacheManager();\n}","handlingStrategy":"validation","validationCode":"if (ApplicationContextProvider.getScriptResourceCacheManager().isEmpty()) { log.warn(\"no groovy cache manager; scripted attributes will be empty\"); }","typeGuard":"boolean canResolveScriptedAttributes() { return ApplicationContextProvider.getScriptResourceCacheManager().isPresent(); }","tryCatchPattern":null,"preventionTips":["Always register a GroovyResourceCacheManager bean when using scripted attributes","Include the CAS groovy/scripting module in the overlay","Add a startup assertion that the cache manager is present when script definitions exist"],"tags":["groovy","scripted-attributes","cache-manager","attribute-definition","empty-result"],"backgroundTag":"missing-dependency","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"}