apereo/cas · warning
No groovy script cache manager is available for attribute…
Error message
No groovy script cache manager is available for attribute definition [{}] What it means
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.
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
Example fix
// before: no bean
// after
@Bean
public GroovyResourceCacheManager groovyResourceCacheManager() {
return new DefaultGroovyResourceCacheManager();
} Defensive patterns
Strategy: validation
Validate before calling
if (ApplicationContextProvider.getScriptResourceCacheManager().isEmpty()) { log.warn("no groovy cache manager; scripted attributes will be empty"); } Type guard
boolean canResolveScriptedAttributes() { return ApplicationContextProvider.getScriptResourceCacheManager().isPresent(); } Prevention
- 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
When it happens
Trigger: An attribute definition with a Groovy script file is resolved while no ScriptResourceCacheManager bean is published in the application context (fetchAttributeValueFromExternalGroovyScript).
Common situations: 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.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- Could not locate an LDAP entry for [filter] and base DN…
- Script cache manager unavailable to handle LDAP filter
- No groovy script cache manager is available to execute…
- No security questions could be found for
- Attribute definition contains a key property
AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08).
Data as JSON: /api/errors/39a4876ed76f5f45.
Report an issue: GitHub.
Appendix: source
Thrown at core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/attribute/DefaultAttributeDefinition.java:127
LOGGER.trace("Encrypted attribute value [{}]", result);
return result;
}))
.collect(Collectors.toList());
}
private static @Nullable List<Object> fetchAttributeValueFromExternalGroovyScript(final String attributeName,
final List<Object> currentValues,
final String file,
final AttributeDefinitionResolutionContext context) throws Throwable {
val result = ApplicationContextProvider.getScriptResourceCacheManager();
if (result.isPresent()) {
val cacheMgr = result.get();
val script = cacheMgr.resolveScriptableResource(file, attributeName, file);
if (script != null) {
return fetchAttributeValueFromScript(script, attributeName, currentValues, context);
}
}
LOGGER.warn("No groovy script cache manager is available for attribute definition [{}]", attributeName);
return new ArrayList<>();
}
private static List<Object> fetchAttributeValueAsInlineGroovyScript(final String attributeName,
final List<Object> currentValues,
final String inlineGroovy,
final AttributeDefinitionResolutionContext context) {
return ApplicationContextProvider.getScriptResourceCacheManager()
.map(cacheManager -> FunctionUtils.doUnchecked(() -> {
val script = cacheManager.resolveScriptableResource(inlineGroovy, attributeName, inlineGroovy);
return fetchAttributeValueFromScript(Objects.requireNonNull(script), attributeName, currentValues, context);
})).orElseGet(() -> {
LOGGER.warn("No groovy script cache manager is available for attribute definition [{}]", attributeName);
return new ArrayList<>();
});
}
private static @Nullable List<Object> fetchAttributeValueFromScript(View on GitHub (pinned to e7288fc434)