{"record":{"id":"5b72b9b759a9f7d4","repo":"mongodb/mongoid","slug":"the-schema-map-is-configured-in-the-auto-encrypt","errorCode":null,"errorMessage":"The :schema_map is configured in the :auto_encryption_options for the client; encryption setting in Mongoid documents will be ignored.","messagePattern":"The :schema_map is configured in the :auto_encryption_options for the client; encryption setting in Mongoid documents will be ignored\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/mongoid/clients/factory.rb","lineNumber":94,"sourceCode":"        end\n      end\n\n      # Build auto encryption options for the client based on the options\n      # provided in the Mongoid client configuration and the encryption\n      # schema map for the database.\n      #\n      # @param [ Hash ] opts Options from the Mongoid client configuration.\n      # @param [ String ] database Database name to use for encryption schema map.\n      #\n      # @return [ Hash | nil ] Auto encryption options for the client.\n      #\n      # @api private\n      def build_auto_encryption_options(opts, database)\n        return nil unless opts[:auto_encryption_options]\n\n        opts[:auto_encryption_options].dup.tap do |auto_encryption_options|\n          if auto_encryption_options.key?(:schema_map)\n            default_logger.warn(\n              'The :schema_map is configured in the :auto_encryption_options for the client;' +\n              ' encryption setting in Mongoid documents will be ignored.'\n            )\n          else\n            auto_encryption_options[:schema_map] = Mongoid.config.encryption_schema_map(database)\n          end\n          if auto_encryption_options.key?(:key_vault_client)\n            auto_encryption_options[:key_vault_client] = Mongoid.client(\n              auto_encryption_options[:key_vault_client]\n            )\n          end\n        end\n      end\n\n      MONGOID_WRAPPING_LIBRARY = {\n        name: 'Mongoid',\n        version: VERSION\n      }.freeze","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/clients/factory.rb#L76-L112","documentation":"Error \"The :schema_map is configured in the :auto_encryption_options for the client; encryption setting in Mongoid documents will be ignored.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/clients/factory.rb:94 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"}