Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatabricksSubmitRunOperator Get failed for Multi Task Databricks Job Run #28812

Closed
1 of 2 tasks
NishchayAgrawal opened this issue Jan 9, 2023 · 9 comments · Fixed by #25427
Closed
1 of 2 tasks

DatabricksSubmitRunOperator Get failed for Multi Task Databricks Job Run #28812

NishchayAgrawal opened this issue Jan 9, 2023 · 9 comments · Fixed by #25427

Comments

@NishchayAgrawal
Copy link

NishchayAgrawal commented Jan 9, 2023

Apache Airflow Provider(s)

databricks

Versions of Apache Airflow Providers

As we are running DatabricksSubmitRunOperator to run multi task databricks job as I am using airflow providers with mostly all flavours of versions, but when the databricks job get failed, DatabricksSubmitRunOperator gives below error its because this operator running get-output API, hence taking job run id instead of taking task run id

Error

File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/airflow/providers/databricks/hooks/databricks_base.py", line 355, in _do_api_call
    for attempt in self._get_retry_object():
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/tenacity/__init__.py", line 382, in __iter__
    do = self.iter(retry_state=retry_state)
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/tenacity/__init__.py", line 349, in iter
    return fut.result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/airflow/providers/databricks/hooks/databricks_base.py", line 365, in _do_api_call
    response.raise_for_status()
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/airflow/providers/databricks/operators/databricks.py", line 375, in execute
    _handle_databricks_operator_execution(self, hook, self.log, context)
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/airflow/providers/databricks/operators/databricks.py", line 90, in _handle_databricks_operator_execution
    run_output = hook.get_run_output(operator.run_id)
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/airflow/providers/databricks/hooks/databricks.py", line 280, in get_run_output
    run_output = self._do_api_call(OUTPUT_RUNS_JOB_ENDPOINT, json)
  File "/home/ubuntu/.venv/airflow/lib/python3.8/site-packages/airflow/providers/databricks/hooks/databricks_base.py", line 371, in _do_api_call
    raise AirflowException(
airflow.exceptions.AirflowException: Response: b'{"error_code":"INVALID_PARAMETER_VALUE","message":"Retrieving the output of runs with multiple tasks is not supported. Please retrieve the output of each individual task run instead."}', Status Code: 400
[2023-01-10, 05:15:12 IST] {taskinstance.py} INFO - Marking task as FAILED. dag_id=experiment_metrics_store_experiment_4, task_id=, execution_date=20230109T180804, start_date=20230109T180810, end_date=20230109T181512
[2023-01-10, 05:15:13 IST] {warnings.py} WARNING - /home/ubuntu/.venv/airflow/lib/python3.8/site-packages/airflow/utils/email.py:119: PendingDeprecationWarning: Fetching SMTP credentials from configuration variables will be deprecated in a future release. Please set credentials using a connection instead.
  send_mime_email(e_from=mail_from, e_to=recipients, mime_msg=msg, conn_id=conn_id, dryrun=dryrun)

Apache Airflow version

2.3.2

Operating System

macos

Deployment

Other

Deployment details

No response

What happened

No response

What you think should happen instead

No response

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

@NishchayAgrawal NishchayAgrawal added area:providers kind:bug This is a clearly a bug labels Jan 9, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 9, 2023

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

@john-lourdu
Copy link

This has been tested with apache-airflow-providers-databricks version 3.2.0 and 4.0.0 versions as well

@alexott
Copy link
Contributor

alexott commented Jan 10, 2023

If possible, please share the source code of DAG as well

@alexott
Copy link
Contributor

alexott commented Jan 11, 2023

@alexott
Copy link
Contributor

alexott commented Jan 11, 2023

@NishchayAgrawal
Copy link
Author

Its not working even in later version 2.3.2

@NishchayAgrawal
Copy link
Author

notebook_run = DatabricksSubmitRunOperator(task_id=f"test_",databricks_conn_id='test', json=json,polling_period_seconds=60, do_xcom_push=False)

@alexott
Copy link
Contributor

alexott commented Jan 11, 2023

2.3.2 didn't include the fix, but lines in the stacktrace doesn't match any of versions

@alexott
Copy link
Contributor

alexott commented Jan 12, 2023

Issue is really fixed by #25427 - customer confirmed that upgrade to the latest version of provider fixed it.
Please close it & thank you!

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

Successfully merging a pull request may close this issue.

5 participants