Skip to content

airflow.sdk.api.client.ServerResponseError: Invalid auth token: Signature has expired #59637

Description

@devgonvarun

Apache Airflow version

Other Airflow 3 version (please specify below)

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

3.1.3

What happened?

Sometimes sporadically some kubernetes executor task pods fail with the following error:

{"timestamp":"2025-12-19T10:51:28.704195Z","level":"info","event":"Connecting to server:","server":"http://airflowtest-api-server.airflow.svc.cluster.local:8080/execution/","logger":"__main__","filename":"execute_workload.py","lineno":64}
{"timestamp":"2025-12-19T10:51:29.055323Z","level":"info","event":"Secrets backends loaded for worker","count":2,"backend_classes":["VaultBackend","EnvironmentVariablesBackend"],"logger":"supervisor","filename":"supervisor.py","lineno":1931}
{"timestamp":"2025-12-19T10:51:34.119133Z","level":"info","event":"Process exited","pid":13,"exit_code":-9,"signal_sent":"SIGKILL","logger":"supervisor","filename":"supervisor.py","lineno":709}
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/execute_workload.py", line 125, in <module>
    main()
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/execute_workload.py", line 121, in main
    execute_workload(workload)
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/execute_workload.py", line 66, in execute_workload
    supervise(
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py", line 1940, in supervise
    process = ActivitySubprocess.start(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py", line 954, 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 965, 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 215, 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 885, 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 186, 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 176, in get_json_error
    raise err
airflow.sdk.api.client.ServerResponseError: Invalid auth token: Signature has expired
Correlation-id=019b363c-6fb7-7b53-ba74-df8e23546e12

What you think should happen instead?

The signature should not expire for when the task is still running.

How to reproduce

I have set my AIRFLOW__API_AUTH__JWT_EXPIRATION_TIME along with session_lifetime_minutes to "43200" or 12 hours to control the sign out of logged in users after this time. Also i am explicitly setting a apiSecretKeySecretName and jwtSecretName with appropriate k8 secrets.

This does not happen for all dag runs but when scheduling multiple dag runs with multiple tasks. Also the dag fails long before 12 hours set for the jwt expiration time.

Operating System

Debian GNU/Linux 12 (bookworm)

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. jason810496 commented on Dec 20, 2025

    @jason810496
    Member

    It seems #58782 already fixed the issue, it will be included in 3.2.0 but it didn't backport to 3.1.5 version yet.

  2. devgonvarun commented on Dec 21, 2025

    @devgonvarun
    Author

    @jason810496 #53713 has the same error.

    My execution_api.jwt_expiration_time is default (600) and scheduler.task_queued_timeout is 300. So scheduler.task_queued_timeout is already lower than execution_api.jwt_expiration_time.

  3. chandakanant commented on Sep 15, 2026

    @chandakanant

    Hi @devgonvarun & @jason810496 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

Assignees

No one assigned

    Labels

    area:APIAirflow's REST/HTTP APIarea:autharea:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions