{"record":{"id":"b9943550c9df62e2","repo":"apereo/cas","slug":"configuration-file-format-is-not-recognized","errorCode":null,"errorMessage":"Configuration file format [{}] is not recognized","messagePattern":"Configuration file format \\[(.+?)\\] is not recognized","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/properties/AddPropertiesToConfigurationCommand.java","lineNumber":74,"sourceCode":"            LOGGER.warn(\"Configuration file [{}] is not readable/writable or is not a path to a file\", filePath.getCanonicalPath());\n            return;\n        }\n\n        val results = findProperties(group);\n        LOGGER.info(\"Located [{}] properties matching [{}]\", results.size(), group);\n\n        switch (FilenameUtils.getExtension(filePath.getName()).toLowerCase(Locale.ENGLISH)) {\n            case \"properties\" -> {\n                createConfigurationFileIfNeeded(filePath);\n                val props = loadPropertiesFromConfigurationFile(filePath);\n                writeConfigurationPropertiesToFile(filePath, results, props);\n            }\n            case \"yaml\", \"yml\" -> {\n                createConfigurationFileIfNeeded(filePath);\n                val yamlProps = CasCoreConfigurationUtils.loadYamlProperties(new FileSystemResource(filePath));\n                writeYamlConfigurationPropertiesToFile(filePath, results, yamlProps);\n            }\n            default -> LOGGER.warn(\"Configuration file format [{}] is not recognized\", filePath.getCanonicalPath());\n        }\n\n    }\n\n    private static void writeYamlConfigurationPropertiesToFile(final File filePath,\n                                                               final Map<String, ConfigurationMetadataProperty> results,\n                                                               final Map<String, Object> yamlProps) throws Exception {\n        val options = new DumperOptions();\n        options.setDefaultFlowStyle(DumperOptions.FlowStyle.AUTO);\n        options.setDefaultScalarStyle(DumperOptions.ScalarStyle.PLAIN);\n        options.setPrettyFlow(true);\n        options.setAllowUnicode(true);\n        val yaml = new Yaml(options);\n        try (val writer = Files.newBufferedWriter(filePath.toPath(), StandardCharsets.UTF_8)) {\n            putResultsIntoProperties(results, yamlProps);\n            yaml.dump(yamlProps, writer);\n        }\n    }","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/properties/AddPropertiesToConfigurationCommand.java#L56-L92","documentation":"AddPropertiesToConfigurationCommand.add() switches on the configuration file extension and only supports 'properties' and 'yaml'/'yml'. Any other extension falls into the default branch and the command logs this warning and skips writing the located properties. No exception is thrown; the properties are simply not added.","triggerScenarios":"Running 'cas add-properties-to-configuration --file <path>' where the target file has an extension other than .properties, .yaml, or .yml (e.g. .conf, .json, or no extension).","commonSituations":"Using a .json or .env config file; targeting a file with no extension; typo in the filename extension (.prop, .yam); copying a template with a backup extension (.properties.bak).","solutions":["Rename or copy the target so its extension is .properties, .yaml, or .yml","Convert the configuration content to a supported properties or YAML format","Verify the --file argument points at the intended file (check the logged canonical path)","If using a backup file, restore the original extension before running the command"],"exampleFix":"// before\ncas add-properties-to-configuration --file /etc/cas/config/application.conf ...\n// after\ncas add-properties-to-configuration --file /etc/cas/config/application.properties ...","handlingStrategy":"validation","validationCode":"String name = file.getName().toLowerCase();\nboolean supported = name.endsWith(\".properties\") || name.endsWith(\".yaml\") || name.endsWith(\".yml\");\nif (!supported) throw new IllegalArgumentException(\"Unsupported config format: \" + name);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep CAS configuration in .properties, .yaml, or .yml files only","Watch for backup/temp extensions (.bak, ~) when scripting","Log or echo the canonical path before running batch config edits"],"tags":["cli","configuration","file-format"],"backgroundTag":"unsupported-config-value","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"}