Skip to content

GCSToBigQueryOperator in deferrable mode do not respect impersonation chain #29535

Closed

Description

@piotrdziuba

Apache Airflow Provider(s)

google

Versions of Apache Airflow Providers

apache-airflow-providers-google==8.8.0

Apache Airflow version

airflow-2.4.3

Operating System

N/A

Deployment

Composer

Deployment details

No response

What happened

When using operator GCSToBigQueryOperator with used impersonation_chain it works correctly as long as I do not turn on deferrable=True

Traceback (most recent call last):
  File "/opt/python3.8/lib/python3.8/site-packages/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py", line 452, in execute_complete
    raise AirflowException(event["message"])
airflow.exceptions.AirflowException: 403, message='Forbidden: {\n  "error": {\n    "code": 403,\n    "message": "Access Denied: Job my-gcp-project:EU.airflow_sc_15793_sync_airflow_summary_table_to_bq_import_to_bigquery_2023_02_13T02_00_00_00_00_b7726c7b935bb5c777eb129a5ec3a1e9: Permission bigquery.jobs.get denied on job my-gcp-project:EU.airflow_sc_15793_sync_airflow_summary_table_to_bq_import_to_bigquery_2023_02_13T02_00_00_00_00_b7726c7b935bb5c777eb129a5ec3a1e9 (or it may not exist)

What you think should happen instead

Seems the only provided details for the deferred operation are project_id and gcp_conn_id, but not the impersonation_chain.

https://github.com/apache/airflow/blob/providers-google/8.8.0/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py#L429

Most likely it would be beneficial to rework the BigQueryInsertJobTrigger so that it considers use case with the impersonation.

How to reproduce

No response

Anything else

Possibly related to #29307

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. boring-cyborg commented on Feb 14, 2023

    @boring-cyborg

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

  2. changed the title [-]GCSToBigQueryOperator in defferable mode do not respect impersonation chain[/-] [+]GCSToBigQueryOperator in deferrable mode do not respect impersonation chain[/+] on Feb 14, 2023
  3. added
    provider:google
    on Feb 17, 2023
  4. eskarimov commented on Feb 26, 2023

    @eskarimov
    Contributor

    Currently gcloud-aio package used for the Trigger doesn't support impersonated credentials, we should link the current issue to the upstream one in gloud-aio.

  5. potiuk commented on Feb 26, 2023

    @potiuk
    Member

    Currently gcloud-aio package used for the Trigger doesn't support impersonated credentials, we should link the current issue to the upstream one in gloud-aio.

    You just did :D

  6. eladkal commented on Apr 21, 2023

    @eladkal
    Contributor

    Do we have a task here?
    This seems to be upstream package issue so if we don't actually have a task I think we should close this issue

  7. potiuk commented on Apr 22, 2023

    @potiuk
    Member

    Agree. W econ re-open if needs be,. PR to implement it the feature is added will be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providersgood first issuekind:bugprovider:google

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions