vinitpayal commented on issue #54603:
URL: https://github.com/apache/airflow/issues/54603#issuecomment-3196282998
@potiuk I feel it's not only specific to kubernetes executor but something
common for reading AWS secrets from metadata database.
Similar issue is being faced in the `EKSPodOperator` as well where
connection id is defined but while using `EKSPodOperator` it reports the same.
Was debuggin the same by adding some logs and seems like in
AwsConnectionWrapper it's able to read the connection but later gets switched
to the `kubernetes_default` connection.
```shell
[2025-08-18, 16:40:23] WARNING - Using
Connection.get_connection_from_secrets from `airflow.models` is
deprecated.Please use `from airflow.sdk import Connection` instead:
category="DeprecationWarning":
filename="/usr/local/lib/python3.12/site-packages/airflow/models/connection.py":
lineno=471: source="py.warnings"
[2025-08-18, 16:40:23] INFO - Connection Retrieved 'aws_eks':
source="airflow.hooks.base"
[2025-08-18, 16:40:23] INFO - AWS Connection (conn_id='aws_eks',
conn_type='aws') credentials retrieved from login and password1.:
source="airflow.providers.amazon.aws.utils.connection_wrapper.AwsConnectionWrapper"
[2025-08-18, 16:40:23] INFO - aws conn reterived: AKIAZXXXXXXXXXXXXXXXX |
secret: *** | session token: None:
source="airflow.providers.amazon.aws.utils.connection_wrapper.AwsConnectionWrapper"
[2025-08-18, 16:40:23] INFO - secret: ***: chan="stdout": source="task"
[2025-08-18, 16:40:24] INFO - Building pod
run-data-operations-script-rnpqbnb2 with labels: {'dag_id':
'manual_data_operations_command_run', 'task_id': 'run_data_operations_script',
'run_id': 'manual__2025-08-18T111021.6180000000-14be046c6',
'kubernetes_pod_operator': 'True', 'try_number': '1'}:
source="airflow.task.operators.utils.operators.eks_custom_operator.CustomEksRunTaskOperator"
[2025-08-18, 16:40:24] INFO - Connection Retrieved 'kubernetes_default':
source="airflow.hooks.base"
[2025-08-18, 16:40:25] ERROR - exec: process returned 1. 1 -> aws_eks
Traceback (most recent call last):
File
"/usr/local/lib/python3.12/site-packages/airflow/providers/amazon/aws/hooks/base_aws.py",
line 625, in conn_config
connection = self.get_connection(self.aws_conn_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/airflow/hooks/base.py", line
64, in get_connection
conn = Connection.get_connection_from_secrets(conn_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/usr/local/lib/python3.12/site-packages/airflow/models/connection.py", line
512, in get_connection_from_secrets
raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't defined")
airflow.exceptions.AirflowNotFoundException: The conn_id `aws_eks` isn't
defined
[2025-08-18T11:10:25.251+0000] {base_aws.py:636} WARNING - Unable to find
AWS Connection ID 'aws_eks', switching to empty.
[2025-08-18T11:10:25.252+0000] {base_aws.py:201} INFO - No connection ID
provided. Fallback on boto3 credential strategy (region_name='eu-central-1').
See:
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html
[2025-08-18T11:10:25.254+0000] {base_aws.py:201} INFO - No connection ID
provided. Fallback on boto3 credential strategy (region_name='eu-central-1').
See:
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html
1 -> aws_default
Traceback (most recent call last):
File
"/usr/local/lib/python3.12/site-packages/airflow/providers/amazon/aws/hooks/base_aws.py",
line 625, in conn_config
connection = self.get_connection(self.aws_conn_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/airflow/hooks/base.py", line
64, in get_connection
conn = Connection.get_connection_from_secrets(conn_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/usr/local/lib/python3.12/site-packages/airflow/models/connection.py", line
512, in get_connection_from_secrets
raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't defined")
airflow.exceptions.AirflowNotFoundException: The conn_id `aws_default` isn't
defined
```
<img width="1109" height="499" alt="Image"
src="https://github.com/user-attachments/assets/5bcf3c99-1162-4ca3-bf93-7eaf54c2d581"
/>
--
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]