{"record":{"id":"33bab0ec44cc7554","repo":"mongodb/mongoid","slug":"invalid-automatic-encryption-configuration-for-cli","errorCode":null,"errorMessage":"Invalid automatic encryption configuration for client %{client}.","messagePattern":"Invalid automatic encryption configuration for client %(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::InvalidAutoEncryptionConfiguration","httpStatus":null,"severity":"error","filePath":"lib/mongoid/tasks/encryption.rb","lineNumber":63,"sourceCode":"\n      private\n\n      # Prepare arguments needed to create a data key from the client's\n      # auto_encryption_options.\n      #\n      # @param [ String | nil ] kms_provider_name The name of the kms provider.\n      # @param [ String | nil ] client_name The name of the client.\n      #\n      # @return [ Array<String, Hash, String> ] An array containing the\n      #   normalized kms provider name, the kms providers hash, and the key\n      #   vault namespace.\n      def prepare_arguments(kms_provider_name, client_name)\n        client = (client_name || 'default').to_s\n        client_options = Mongoid.clients[client]\n        raise Errors::NoClientConfig.new(client) unless client_options.is_a?(Hash)\n\n        auto_encryption_options = client_options.dig(:options, :auto_encryption_options)\n        raise Errors::InvalidAutoEncryptionConfiguration.new(client) unless auto_encryption_options.is_a?(Hash)\n\n        key_vault_namespace = auto_encryption_options[:key_vault_namespace]\n        raise Errors::InvalidAutoEncryptionConfiguration.new(client) unless key_vault_namespace.is_a?(String)\n\n        kms_providers = auto_encryption_options[:kms_providers]\n        raise Errors::InvalidAutoEncryptionConfiguration.new(client) unless kms_providers.is_a?(Hash)\n\n        valid_kms_provider_name = get_kms_provider_name(kms_provider_name, kms_providers)\n        unless kms_providers.key?(valid_kms_provider_name)\n          raise Errors::InvalidAutoEncryptionConfiguration.new(client, valid_kms_provider_name)\n        end\n\n        [ valid_kms_provider_name, kms_providers, key_vault_namespace ]\n      end\n\n      # Get kms provider name to use for creating a data key.\n      #\n      # If kms_provider_name is provided, it will be used. Otherwise, if there","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/tasks/encryption.rb#L45-L81","documentation":"Error \"Invalid automatic encryption configuration for client %{client}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/tasks/encryption.rb:63 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"}