alkismavridis commented on issue #62218:
URL: https://github.com/apache/airflow/issues/62218#issuecomment-3952161418

   UPDATE:
   
   As mentioned, I tried to increase the `execution_api -> jwt_expiration_time` 
to one month.
   I now get different error message (Progress!!). So the change seem to have 
worked. Now the message does not speak of expired token but of "server error". 
It is possible that this is due to our firewall (my long-running is and SSH 
operator).
   
   ```
   [2026-02-24T09:55:26.173901Z] {trace.py:285} ERROR - Task 
execute_workload[8fd73cf1-4e1a-441d-8f4d-156a70e4b85a] raised unexpected: 
ServerResponseError('Server returned error')
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.12/site-packages/celery/app/trace.py", line 
479, in trace_task
       R = retval = fun(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/celery/app/trace.py", line 
779, 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 162, in execute_workload
       supervise(
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py",
 line 1984, in supervise
       process = ActivitySubprocess.start(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/supervisor.py",
 line 955, 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 966, 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 887, 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: Server returned error
   Correlation-id=019c8f13-333b-7eed-a005-9ad146f79548
   [2026-02-24T09:55:29.206431Z] {supervisor.py:1115} ERROR - Server indicated 
the task shouldn't be running anymore detail={'detail': {'reason': 
'not_running', 'message': 'TI is no longer in the running state and task should 
terminate', 'current_state': 'failed'}} status_code=409 
ti_id=UUID('019c89ec-c8f8-7d10-b74c-4afcc071ca46')
   [2026-02-24T09:55:34.211829Z] {supervisor.py:718} WARNING - Process did not 
terminate in time; escalating pid=15965 signal=SIGTERM
   [2026-02-24T09:55:34.220909Z] {supervisor.py:710} INFO - Process exited 
pid=15965 exit_code=-9 signal_sent=SIGKILL
   [2026-02-24T09:55:34.221249Z] {supervisor.py:1995} INFO - Task finished 
task_instance_id=019c89ec-c8f8-7d10-b74c-4afcc071ca46 exit_code=-9 
duration=86411.40724210022 final_state=SERVER_TERMINATED
   [2026-02-24T09:55:34.225350Z] {trace.py:128} INFO - Task 
execute_workload[8fd73cf1-4e1a-441d-8f4d-156a70e4b85a] succeeded in 
86411.41635726904s: None
   [2026-02-24T09:55:47.892614Z] {autoscale.py:125} INFO - Scaling down 1 
processes.
   ``` 
   
   I will try to confirm asap that this now is an internal infrastructure issue 
and not an airflow one. To test this, I used the keepalive_interval parameter 
in the ssh_hook of my SSHOperator:
   ```python
   ssh_hook=SSHHook(
       ssh_conn_id="___the_connection_id___",
       keepalive_interval=300
   ),
   ```
   
   I will post news as soon as I have them. Unfortunatelly every experiment 
costs 24 hours


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to