Skip to content

Error details missing in the logs for internal SDK API calls #57961

Closed

Description

@arkadiuszbach

Apache Airflow version

3.1.2

If "Other Airflow 2/3 version" selected, which one?

3.1.1

What happened?

For some internal sdk api client calls error details are not printed in the logs, only stacktrace with airflow.sdk.api.client.ServerResponseError: Server returned error, see below:

2025-11-05T17:32:56.233876Z [error    [] Task execute_workload[b4c1c834-0c96-4387-b5e7-1f159fd0afd3[] raised unexpected: ServerResponseError('Server returned error') [celery.app.trace] loc=trace.py:267
Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/trace.py", line 453, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/celery/app/trace.py", line 736, in __protected_call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/celery/executors/celery_executor_utils.py", line 174, in execute_workload
    supervise(
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py", line 1926, in supervise
    process = ActivitySubprocess.start(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py", line 950, in start
    proc._on_child_started(ti=what, dag_rel_path=dag_rel_path, bundle_info=bundle_info)
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py", line 961, in _on_child_started
    ti_context = self.client.task_instances.start(ti.id, self.pid, start_date)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/api/client.py", line 210, in start
    resp = self.client.patch(f"task-instances/{id}/run", content=body.model_dump_json())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/httpx/_client.py", line 1218, in patch
    return self.request(
           ^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 477, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 480, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/api/client.py", line 866, in request
    return super().request(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/httpx/_client.py", line 825, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/httpx/_client.py", line 999, in _send_handling_redirects
    raise exc
  File "/home/airflow/.local/lib/python3.12/site-packages/httpx/_client.py", line 982, in _send_handling_redirects
    hook(response)
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/api/client.py", line 181, in raise_on_4xx_5xx_with_note
    return get_json_error(response) or response.raise_for_status()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/api/client.py", line 171, in get_json_error
    raise err
airflow.sdk.api.client.ServerResponseError: Server returned error
Correlation-id=019a5514-2a01-7556-862b-11cee90b65c9

Seems its because of this change: #51079 - if the code that is calling the client is not catching the exception or reraising the exception without printing error.details then the details are missing as the log.warning("Server error", detail=err.detail) has been removed from get_json_error

What you think should happen instead?

Error details printed for all sdk calls

How to reproduce

Not sure yet, was killing redis to test how Airflow will behave when its down

Operating System

k8s

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Nov 6, 2025
  2. boring-cyborg commented on Nov 6, 2025

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  3. added
    area:API
    on Nov 6, 2025
  4. self-assigned this
    on Nov 6, 2025
  5. added
    affected_version:3.1
    on Nov 6, 2025
  6. removed
    needs-triage
    on Nov 25, 2025
  7. 11 remaining items

  8. chandakanant commented on Sep 15, 2026

    @chandakanant

    Hi @arkadiuszbach & @pierrejeambrun, is this issue solved by upgrading Airflow to 3.2.0? I am also facing the above issue.

    I have 2 Airflow environments, i.e., staging and production. Staging Airflow is working fine, but in production I am getting the above error when running multiple DAGs with multiple tasks. Both have the same configurations.

    config:
      api: 
        base_url: "${var.environment == "production" ? "https://airflow.${var.region}a.com" : "https://airflow.${var.region}a.${var.environment}.com"}"
        worker_timeout: 600
      api_auth:
        jwt_secret: "airflow-jwt-secret"
      webserver:
        page_size: 25
        base_url: "${var.environment == "production" ? "https://airflow.${var.region}a.com" : "https://airflow.${var.region}a.${var.environment}.com"}"
      core:
        dags_folder: /opt/airflow/dags/repo/dags_us
        max_active_tasks_per_dag: 50
        max_active_runs_per_dag: 16
        dagbag_import_timeout: 600
        non_pooled_task_slot_count: 1000
        dag_concurrency: 10000
        parallelism: 500
        default_pool_task_slot_count: 1000
        default_timezone: "utc"
      dag_processor:
        min_file_process_interval: 120
      logging:
        fab_logging_level: "ERROR"
        logging_level: "INFO"
      database:
        sql_alchemy_max_overflow: 50
        sql_alchemy_pool_enabled: true
        sql_alchemy_pool_pre_ping: true
        sql_alchemy_pool_recycle: 600
        sql_alchemy_pool_size: 300
      scheduler:
        dag_file_processor_timeout : 1000
        enable_health_check: true
        job_heartbeat_sec: 300
        max_dagruns_per_loop_to_schedule: 175
        max_dagruns_to_create_per_loop: 175
        max_tis_per_query: 300
        scheduler_health_check_threshold: 120
        scheduler_zombie_task_threshold: 300
      kubernetes_executor: 
        worker_pods_creation_batch_size : 1000
        delete_worker_pods: true
        delete_worker_pods_on_failure: false
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

affected_version:3.1area:APIarea:corekind:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions