You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/03 11:57:23 UTC

[GitHub] [airflow] kduvzc opened a new issue #20629: SlackWebhookOperator() unusable when running on AWS MWAA with AWS Secrets Manager as the backend

kduvzc opened a new issue #20629:
URL: https://github.com/apache/airflow/issues/20629


   ### Apache Airflow Provider(s)
   
   slack
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==1.3.0
   apache-airflow-providers-ftp==2.0.1
   apache-airflow-providers-http==2.0.1
   apache-airflow-providers-imap==2.0.1
   apache-airflow-providers-postgres==2.4.0
   apache-airflow-providers-slack==4.1.0
   apache-airflow-providers-sqlite==2.0.1
   
   ### Apache Airflow version
   
   2.0.2
   
   ### Operating System
   
   Unknown... running on AWS MWAA
   
   ### Deployment
   
   MWAA
   
   ### Deployment details
   
   Using docker-compose with https://github.com/aws/aws-mwaa-local-runner
   
   ### What happened
   
   When defining the slack webhook operator as follows,
   
   ```
   from airflow.hooks.base import BaseHook
   from airflow.providers.slack.operators.slack_webhook import SlackWebhookOperator
   
   ...
   
   slack_webhook_operator = SlackWebhookOperator(
           task_id='slack_test',
           http_conn_id=my_connection_id,                   # stored in AWS Secrets Manager
           channel=channel,
           message="Testing new SlackWebHookOperator on AWS Managed Airflow (MWAA)",
           webhook_token=BaseHook.get_connection(conn_id).password,
           username=username)
   ```
   
   we get the following error in the DAG execution log:
   
   ```
   requests.exceptions.InvalidSchema: No connection adapters were found for '"SecretName":"XXX","SecretString":"https://hooks.slack.com://YYY"}'
   ```
   
   where `XXX` is the name of the `my_connection_id` used in the DAG and `YYY` the slack webhook token stored in the password field of the connection.
   
   I presume this is happening because the SlackWebhookOperator isn't behaving as expected when fetching the connection from AWS Secrets Manager.
   
   
   ### What you expected to happen
   
   The error mentioned
   
   ```
   requests.exceptions.InvalidSchema: No connection adapters were found for '"SecretName":"XXX","SecretString":"https://hooks.slack.com://YYY"}'
   ```
   
   is there because the SlackWebhookOperator argument `http_conn_id=my_connection_id` is fetching the JSON object
   
   ```
   '{"SecretName":"XXX","SecretString":"https://hooks.slack.com://YYY"}'
   ```
   
   instead of just returning the `SecretString` value.
   
   ### How to reproduce
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #20629: SlackWebhookOperator() unusable when running on AWS MWAA with AWS Secrets Manager as the backend

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #20629:
URL: https://github.com/apache/airflow/issues/20629


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #20629: SlackWebhookOperator() unusable when running on AWS MWAA with AWS Secrets Manager as the backend

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #20629:
URL: https://github.com/apache/airflow/issues/20629#issuecomment-1004212430


   You shoudl follow the https://docs.aws.amazon.com/mwaa/latest/userguide/connections-secrets-manager.html  and store the whole URL to the slack webhook rather than you "SecretName/SecretString" dictionary.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #20629: SlackWebhookOperator() unusable when running on AWS MWAA with AWS Secrets Manager as the backend

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #20629:
URL: https://github.com/apache/airflow/issues/20629#issuecomment-1004042841


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org