{"record":{"id":"fb278c24434346db","repo":"apereo/cas","slug":"is-not-found-at-the-path-specified","errorCode":null,"errorMessage":"[{}] is not found at the path specified","messagePattern":"\\[(.+?)\\] is not found at the path specified","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/resource/AbstractResourceBasedServiceRegistry.java","lineNumber":271,"sourceCode":"                        BaseResourceBasedRegisteredServiceWatcher.LOG_SERVICE_DUPLICATE.accept(s2);\n                        return s1;\n                    }, LinkedHashMap::new));\n            val listedServices = new ArrayList<>(this.services.values());\n            val results = registeredServiceReplicationStrategy.updateLoadedRegisteredServicesFromCache(listedServices, this);\n            results.forEach(service -> publishEvent(new CasRegisteredServiceLoadedEvent(this, service, clientInfo)));\n            return results;\n        });\n    }\n\n    @Override\n    public Collection<RegisteredService> load(final File file) {\n        val fileName = file.getName();\n        if (!file.canRead()) {\n            LOGGER.warn(\"[{}] is not readable. Check file permissions\", fileName);\n            return new ArrayList<>();\n        }\n        if (!file.exists()) {\n            LOGGER.warn(\"[{}] is not found at the path specified\", fileName);\n            return new ArrayList<>();\n        }\n        if (file.length() == 0) {\n            LOGGER.debug(\"[{}] appears to be empty so no service definition will be loaded\", fileName);\n            return new ArrayList<>();\n        }\n        if (!fileName.isEmpty() && fileName.charAt(0) == '.') {\n            LOGGER.debug(\"[{}] starts with ., ignoring\", fileName);\n            return new ArrayList<>();\n        }\n        if (Arrays.stream(getExtensions()).noneMatch(fileName::endsWith)) {\n            LOGGER.debug(\"[{}] doesn't end with valid extension, ignoring\", fileName);\n            return new ArrayList<>();\n        }\n\n        if (!RegexUtils.matches(this.serviceFileNamePattern, fileName)) {\n            LOGGER.warn(\"[{}] does not match the recommended pattern [{}]. \"\n                    + \"While CAS tries to be forgiving as much as possible, it's recommended \"","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/resource/AbstractResourceBasedServiceRegistry.java#L253-L289","documentation":"In load(File), after the readability check, CAS verifies file.exists(). If the file disappeared (deleted between scan and load, or a stale path was passed), it logs this warning and returns an empty list — no service is loaded from it.","triggerScenarios":"Calling serviceRegistry.load(file) with a File object whose path no longer exists; the directory watcher fires for a file that was already removed.","commonSituations":"Race between file deletion and the resource watcher; hand-editing scripts that move/rename service files while CAS runs; typo'd absolute path passed to load().","solutions":["Verify the path exists (ls the directory) before calling load; correct any path typos.","If a script deletes/renames files, let the registry watcher handle removal instead of calling load on stale handles.","Restart the registry load or call serviceRegistry.load() (no-arg) to rescan the whole directory."],"exampleFix":"// before\nserviceRegistry.load(new File(\"/etc/cas/config/services/1001-app.json\")); // file moved\n// after\nFile f = new File(\"/etc/cas/config/services/1001-app.json\");\nif (f.exists()) { serviceRegistry.load(f); }","handlingStrategy":"validation","validationCode":"File f = new File(path);\nif (!f.exists()) {\n    throw new NoSuchFileException(f.getAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve canonical paths at call time instead of caching File objects across operations.","Avoid deleting/renaming service files while CAS is watching the directory; use the registry API instead.","For bulk ops, stop the watcher or use a maintenance window."],"tags":["filesystem","file-not-found","service-registry"],"backgroundTag":"file-not-found","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"}