SchemaCache.buildAutomaticallyConfiguredUsingFileUrl fails when used on an empty GeoServer data directory because the heuristic in isSuitableDirectoryToContainCache is too strict. Only the workspaces directory is present when GeoServer is started with an empty directory (except the workspaces directory required to define the app-schema data store).
Workaround is to create an empty app-schema-cache directory in the data directory.
A warning should be logged if unable to build a cache and automaticConfigurationEnabled is true.