{"record":{"id":"8c9d8ef272aeb00b","repo":"BerriAI/litellm","slug":"tags-must-be-a-dict-or-list-of-key-value-pairs","errorCode":null,"errorMessage":"Tags must be a dict or list of {Key, Value} pairs","messagePattern":"Tags must be a dict or list of (.+?) pairs","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/secret_managers/aws_secret_manager_v2.py","lineNumber":283,"sourceCode":"        from litellm._uuid import uuid\n\n        data: Final[dict[str, Any]] = {\n            \"Name\": secret_name,\n            \"SecretString\": secret_value,\n            \"ClientRequestToken\": str(uuid.uuid4()),\n        }\n\n        if description:\n            data[\"Description\"] = description\n\n        # ✅ Normalize tags to AWS format\n        if tags:\n            if isinstance(tags, dict):\n                tags_list = [{\"Key\": k, \"Value\": str(v)} for k, v in tags.items()]\n            elif isinstance(tags, list):\n                tags_list = tags\n            else:\n                raise ValueError(\"Tags must be a dict or list of {Key, Value} pairs\")\n            data[\"Tags\"] = tags_list\n\n        endpoint_url, headers, body = self._prepare_request(\n            action=\"CreateSecret\",\n            secret_name=secret_name,\n            secret_value=secret_value,\n            optional_params=optional_params,\n            request_data=data,\n        )\n\n        async_client: Final = get_async_httpx_client(\n            llm_provider=httpxSpecialProvider.SecretManager,\n            params={\"timeout\": timeout},\n        )\n\n        try:\n            response: Final = await async_client.post(\n                url=endpoint_url,","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/secret_managers/aws_secret_manager_v2.py#L265-L301","documentation":"Input-shape validation when creating/putting a secret: the optional tags argument must be either a dict (key -> value) or an already-formed list of {Key, Value} pairs. Any other type (e.g. a string or tuple) is rejected before the AWS request is built.","triggerScenarios":"Thrown at litellm/secret_managers/aws_secret_manager_v2.py:283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass tags as a dict ({'Key':'Value'}) or a list of {'Key':..., 'Value':...} pairs.","Normalize tag input before calling the AWS API so it matches boto3's expected shape."],"exampleFix":null,"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"}