Skip to content

Conversation

@lukas-mi
Copy link
Contributor

@lukas-mi lukas-mi commented Aug 23, 2024

is_job_dataflow_running function (https://github.com/apache/airflow/blob/main/airflow/providers/google/cloud/hooks/dataflow.py#L1047C9-L1047C32) is called omitting location argument from multiple places (see changes), thus, always the default value of DEFAULT_DATAFLOW_LOCATION = us-central1 is used.

This causes issues with BeamRunJavaPipelineOperator. When a job status is set to success/failure dataflow API is called using locations/us-central1 even when the operator is configured with another region (for example europe-west1), resulting in the job not being found:

googleapiclient.errors.HttpError: <HttpError 404 when requesting https://dataflow.googleapis.com/v1b3/projects/<my_gcp_project>/locations/us-central1/jobs/<my_job>%20%28org.apache.beam.runners.dataflow.DataflowRunner%29%20%28main%29?alt=json returned "(40f1eba84acd2e6a): Information about job <my_job> (org.apache.beam.runners.dataflow.DataflowRunner) (main) could not be found in our system. Please double check that the API being used is projects.locations.jobs.get (https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.locations.jobs/get). If the API being used is projects.locations.jobs.get, please double check the id (<my_job> (org.apache.beam.runners.dataflow.DataflowRunner) (main)) is correct. If it is please contact customer support.". Details: "(40f1eba84acd2e6a): Information about job <my_job> (org.apache.beam.runners.dataflow.DataflowRunner) (main) could not be found in our system. Please double check that the API being used is projects.locations.jobs.get (https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.locations.jobs/get). If the API being used is projects.locations.jobs.get, please double check the id (<my_job> (org.apache.beam.runners.dataflow.DataflowRunner) (main)) is correct. If it is please contact customer support.">

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:providers provider:apache-beam provider:google Google (including GCP) related issues labels Aug 23, 2024
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 23, 2024

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@lukas-mi lukas-mi force-pushed the bugfix/is-dataflow-job-running-location branch from e025ca6 to bb558a6 Compare August 23, 2024 12:56
@lukas-mi
Copy link
Contributor Author

Closing in favor of #41887, which adds additional changes

@lukas-mi lukas-mi closed this Aug 30, 2024
@lukas-mi lukas-mi deleted the bugfix/is-dataflow-job-running-location branch September 19, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant