{"record":{"id":"8f2f536352e19153","repo":"mongodb/mongoid","slug":"invalid-configuration-file-path","errorCode":null,"errorMessage":"Invalid configuration file: %{path}.","messagePattern":"Invalid configuration file: %(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::InvalidConfigFile","httpStatus":null,"severity":"error","filePath":"lib/mongoid/config/environment.rb","lineNumber":64,"sourceCode":"        env = environment ? environment.to_s : env_name\n\n        contents = File.read(path)\n        raise Mongoid::Errors::EmptyConfigFile.new(path) if contents.empty?\n\n        # These are the classes that can be used in a Mongoid\n        # configuration file in addition to standard YAML types.\n        permitted_classes = [\n          # Symbols occur as values for read preference, for example.\n          Symbol,\n          # BSON::Binary occur as keyId values for FLE (more precisely,\n          # the keyIds are UUIDs).\n          BSON::Binary\n        ]\n\n        result = ERB.new(contents).result\n        data = YAML.safe_load(result, permitted_classes: permitted_classes, aliases: true)\n\n        raise Mongoid::Errors::InvalidConfigFile.new(path) unless data.is_a?(Hash)\n\n        data[env]\n      end\n    end\n  end\nend\n","sourceCodeStart":46,"sourceCodeEnd":71,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/config/environment.rb#L46-L71","documentation":"Error \"Invalid configuration file: %{path}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/config/environment.rb:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}