bhavaniravi opened a new issue, #24773:
URL: https://github.com/apache/airflow/issues/24773

   ### Apache Airflow version
   
   2.3.1
   
   ### What happened
   
   Airflow AWS Secret manager handles `AccesssDeniedException` in 
[secret_manager.py](https://github.com/apache/airflow/blob/providers-amazon/4.0.0/airflow/providers/amazon/aws/secrets/secrets_manager.py#L272)
 whereas it's not a valid exception for the client
   
   ```
     File "/usr/local/lib/python3.9/site-packages/airflow/models/variable.py", 
line 265, in get_variable_from_secrets
   
       var_val = secrets_backend.get_variable(key=key)
   
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/amazon/aws/secrets/secrets_manager.py",
 line 238, in get_variable
   
       return self._get_secret(self.variables_prefix, key)
   
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/amazon/aws/secrets/secrets_manager.py",
 line 275, in _get_secret
   
       except self.client.exceptions.AccessDeniedException:
   
     File 
"/home/astro/.local/lib/python3.9/site-packages/botocore/errorfactory.py", line 
51, in __getattr__
   
       raise AttributeError(
   
   AttributeError: <botocore.errorfactory.SecretsManagerExceptions object at 
0x7f19cd3c09a0> object has no attribute 'AccessDeniedException'. Valid 
exceptions are: DecryptionFailure, EncryptionFailure, InternalServiceError, 
InvalidNextTokenException, InvalidParameterException, InvalidRequestException, 
LimitExceededException, MalformedPolicyDocumentException, 
PreconditionNotMetException, PublicPolicyException, ResourceExistsException, 
ResourceNotFoundException
   ```
   
   ### What you think should happen instead
   
   Handle exception specific to 
[get_secret_value](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/secretsmanager.html#SecretsManager.Client.get_secret_value)
   
   ### How to reproduce
   
   This happened during a unique case where the 100s of secrets are loaded at 
once. I'm assuming the request is hanging over 30s
   
   ### Operating System
   
   Debian GNU/Linux 10 (buster)
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==3.4.0
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to