Airflow-MS-Teams-Operator icon indicating copy to clipboard operation
Airflow-MS-Teams-Operator copied to clipboard

Cloud Composer - 'Host' Data Too Long

Open RickRen7575 opened this issue 4 years ago • 2 comments

I am trying to create a Connection in my managed Airflow service - GCP's Composer. However, when trying to create the connection, Airflow is letting me know that the data is too long in the column 'host'. Here is part of the error without the actual Webhook URI attached:

image

Do you know if there is a way to fix this in Composer? I cannot access the database since it is managed by GCP.

RickRen7575 avatar Mar 31 '21 18:03 RickRen7575

I'm not familiar with Composer, or GCP. However from what I know it's Airflow that creates the DB, unless GCP have somehow decided to alter the creation?

Reason for mentiong it - does it work if you try in a local Airflow with a local MySql? If it works locally but not in Composer then maybe that's some limitation they've introduced in their implementation.

mendhak avatar Apr 01 '21 16:04 mendhak

@RickRen7575 you can resolve that limitation separating the full webhook teams url by the http_conn_id and webhook_token when calling the MSTeamsWebhookOperator operator:

teams_notification = MSTeamsWebhookOperator(
        task_id="notify_failure",
        http_conn_id="<your-webhook-teams-domain (https://xyz.webhook.office.com)>",
        webhook_token="<the webhook url part after the domain (/webhookb2/string/IncomingWebhook/string)>",
        ...
    )
    teams_notification.execute(context)

Hope that helps!

rotsmi avatar May 27 '21 16:05 rotsmi