{"record":{"id":"d4735effd3febd92","repo":"apereo/cas","slug":"loggingutils-warn-logger-e-d4735e","errorCode":null,"errorMessage":"LoggingUtils.warn(LOGGER, e)","messagePattern":"LoggingUtils\\.warn\\(LOGGER, e\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"support/cas-server-support-git-service-registry/src/main/java/org/apereo/cas/services/GitServiceRegistry.java","lineNumber":132,"sourceCode":"                    LOGGER.info(\"Unable to pull changes from the remote repository. Service definition files may be stale.\");\n                }\n                val objectPatternStr = StringUtils.isBlank(rootDirectory)\n                    ? GitRepositoryRegisteredServiceLocator.PATTEN_ACCEPTED_REPOSITORY_FILES\n                    : rootDirectory + '/' + GitRepositoryRegisteredServiceLocator.PATTEN_ACCEPTED_REPOSITORY_FILES;\n                val objectPattern = RegexUtils.createPattern(objectPatternStr, Pattern.CASE_INSENSITIVE);\n                val objects = gitRepository.getObjectsInRepository(\n                    new PathRegexPatternTreeFilter(objectPattern));\n                registeredServices = objects\n                    .stream()\n                    .filter(Objects::nonNull)\n                    .map(this::parseGitObjectContentIntoRegisteredService)\n                    .flatMap(Collection::stream)\n                    .map(this::invokeServiceRegistryListenerPostLoad)\n                    .filter(Objects::nonNull)\n                    .collect(Collectors.toList());\n                return registeredServices;\n            } catch (final Exception e) {\n                LoggingUtils.warn(LOGGER, e);\n                val parentDir = StringUtils.isBlank(rootDirectory)\n                    ? gitRepository.getRepositoryDirectory()\n                    : new File(gitRepository.getRepositoryDirectory(), rootDirectory);\n                val files = FileUtils.listFiles(parentDir,\n                    GitRepositoryRegisteredServiceLocator.FILE_EXTENSIONS.toArray(ArrayUtils.EMPTY_STRING_ARRAY), true);\n                LOGGER.debug(\"Located [{}] files(s)\", files.size());\n\n                registeredServices = files\n                    .stream()\n                    .filter(file -> file.isFile() && file.canRead() && file.canWrite() && file.length() > 0)\n                    .map(Unchecked.function(file -> {\n                        try (val in = Files.newBufferedReader(file.toPath())) {\n                            return registeredServiceSerializers\n                                .stream()\n                                .filter(s -> s.supports(file))\n                                .map(s -> s.load(in))\n                                .filter(Objects::nonNull)\n                                .flatMap(Collection::stream)","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-git-service-registry/src/main/java/org/apereo/cas/services/GitServiceRegistry.java#L114-L150","documentation":"GitServiceRegistry.load() reads registered services from the git-backed repository. When any exception occurs (git I/O, corrupt repository, bad credentials), the service logs the exception via LoggingUtils.warn and falls back to listing the service-definition files directly from the repository directory, parsing them without git operations. The registry stays operational in degraded mode.","triggerScenarios":"load() throws internally: JGit cannot open the repository (missing .git dir, lock files, corrupt index), authentication to a remote fails, or a pull/fetch during load raises an Exception.","commonSituations":"Remote git repositories with expired credentials; leftover .git/index.lock after a crashed JVM; filesystem permission changes; network outage when the registry syncs with a remote.","solutions":["Inspect the warn-level stack trace from LoggingUtils to identify the underlying git failure (auth, lock, corruption)","Remove stale lock files (.git/index.lock) and verify repository directory permissions","Re-clone or repair the service-registry repository (git fsck / fresh clone at the configured directory)","Validate remote credentials and network connectivity if the registry pulls from a remote"],"exampleFix":"// before\n// index.lock present, load fails and degrades\n// after\nrm -f /etc/cas/services/.git/index.lock\ngit -C /etc/cas/services fsck","handlingStrategy":"fallback","validationCode":"File gitDir = new File(repoDir, \".git\");\nif (!gitDir.exists() || new File(gitDir, \"index.lock\").exists()) {\n    LOGGER.warn(\"git repository unhealthy at {}\", repoDir);\n}","typeGuard":null,"tryCatchPattern":"try {\n    services = gitServiceRegistry.load();\n} catch (Exception e) {\n    LOGGER.warn(\"git registry load failed, relying on degraded file parse\", e);\n}","preventionTips":["Monitor registry logs for the degraded-mode warn and alert on it","Clean stale index.lock files and ensure the JVM exits cleanly","Verify remote credentials and run git fsck after unclean shutdowns"],"tags":["git","service-registry","fallback","repository-error"],"backgroundTag":"git-command-failed","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"}