{"record":{"id":"ed79b7799b67a8d9","repo":"BerriAI/litellm","slug":"invalid-args-passed-in-need-to-set-both-read-capa","errorCode":null,"errorMessage":"Invalid args passed in. Need to set both read_capacity_units and write_capacity_units. Args passed in - {database_arguments}","messagePattern":"Invalid args passed in\\. Need to set both read_capacity_units and write_capacity_units\\. Args passed in - (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/db/dynamo_db.py","lineNumber":35,"sourceCode":"    def __init__(self, database_arguments: DynamoDBArgs):\n        from aiodynamo.models import PayPerRequest, Throughput\n\n        self.throughput_type = None\n        if database_arguments.billing_mode == \"PAY_PER_REQUEST\":\n            self.throughput_type = PayPerRequest()\n        elif database_arguments.billing_mode == \"PROVISIONED_THROUGHPUT\":\n            if (\n                database_arguments.read_capacity_units is not None\n                and isinstance(database_arguments.read_capacity_units, int)\n                and database_arguments.write_capacity_units is not None\n                and isinstance(database_arguments.write_capacity_units, int)\n            ):\n                self.throughput_type = Throughput(\n                    read=database_arguments.read_capacity_units,\n                    write=database_arguments.write_capacity_units,\n                )\n            else:\n                raise Exception(\n                    f\"Invalid args passed in. Need to set both read_capacity_units and write_capacity_units. Args passed in - {database_arguments}\"\n                )\n        self.database_arguments = database_arguments\n        self.region_name = database_arguments.region_name\n\n    def set_env_vars_based_on_arn(self):\n        if self.database_arguments.aws_role_name is None:\n            return\n        verbose_proxy_logger.debug(\"DynamoDB: setting env vars based on arn=%s\", self.database_arguments.aws_role_name)\n        import os\n\n        import boto3\n\n        sts_client: Final = boto3.client(\"sts\")\n\n        # call 1\n        sts_client.assume_role_with_web_identity(\n            RoleArn=self.database_arguments.aws_role_name,","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/db/dynamo_db.py#L17-L53","documentation":"Validation of DynamoDB billing args: billing_mode is PROVISIONED_THROUGHPUT but read_capacity_units/write_capacity_units are not both supplied as ints, so table throughput cannot be set; the passed args are embedded.","triggerScenarios":"Thrown at litellm/proxy/db/dynamo_db.py:35 when the library encounters an invalid state.","commonSituations":"Only one of read_capacity_units/write_capacity_units was provided for the DynamoDB table.","solutions":["Pass both read_capacity_units and write_capacity_units in the database arguments."],"exampleFix":"database_arguments: {read_capacity_units: 5, write_capacity_units: 5}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}