You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/07/01 15:39:00 UTC
[jira] [Commented] (AIRFLOW-4849) Add gcp_conn_id parameter to
CloudSqlDatabaseHook class to avaid CloudSqlProxyRunner use the gcp_conn_id
by default
[ https://issues.apache.org/jira/browse/AIRFLOW-4849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16876279#comment-16876279 ]
ASF subversion and git services commented on AIRFLOW-4849:
----------------------------------------------------------
Commit 72aabe3b86fe2a03ad43da10a472387de04e3226 in airflow's branch refs/heads/v1-10-stable from César Reyes
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=72aabe3 ]
[AIRFLOW-4849] Add gcp_conn_id to cloudsqldatabehook class to use correctly CloudSqlProxyRunner class (#5478)
* add gcp_conn_id to cloudsqldatabehook
* Modified gcp sql hook test
(cherry picked from commit 12a2a414662c39a2484721ee67d9b1e61d384edd)
> Add gcp_conn_id parameter to CloudSqlDatabaseHook class to avaid CloudSqlProxyRunner use the gcp_conn_id by default
> -------------------------------------------------------------------------------------------------------------------
>
> Key: AIRFLOW-4849
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4849
> Project: Apache Airflow
> Issue Type: Bug
> Components: contrib, gcp, hooks, operators
> Affects Versions: 1.10.3
> Reporter: César Reyes
> Priority: Major
> Labels: GCP, contrib, hooks, operators
> Fix For: 1.10.4
>
>
> CloudSqlQueryOperator() class has gcp_conn_id, gcp_cloudsql_conn_id attributes and a object attribute of the CloudSqlDatabaseHook class to manage cloud_sql_proxy but CloudSqlDatabaseHook doesn't passing gcp_conn_id as argument, only use gcp_cloudsql_conn_id. So when the get_sqlproxy_runner() method in CloudSqlDatabaseHook call CloudSqlProxyRunner() class, CloudSqlProxyRunner try to get gcp credential from gcp_cloudsql_conn_id but it hasn't credential parameter and Airflow send the following message:
> {{ }}
> {{[2019-06-25 09:31:55,381] \{logging_mixin.py:95} INFO - [2019-06-25 09:31:55,381] \{gcp_sql_hook.py:508} INFO - The credentials are not supplied by neither key_path nor keyfile_dict of the gcp connection google_cloud_proxy_conn_XXX. Falling back to default activated account}}
>
> This fix add gcp_coon_id attribute to CloudSqlDatabaseHook class, change parameter passed to CloudSqlProxyRunner from gcp_cloudsql_conn_id to gcp_conn_id and add gcp_conn_id parameter to CloudSqlDatabaseHook when it is called from CloudSqlQueryOperator.
>
> There was other issue about the problem (https://issues.apache.org/jira/browse/AIRFLOW-4557?jql=text%20~%20%22AIRFLOW-4557%22) but the solution was not resolve the error because CloudSqlProxyRunner() need a google cloud platform connection not a google cloud sql connection.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)