Airflow conn_id isn’t defined error with Airflow 2.7.2

Could you please help on the following issue

facing an issue with conn_id isn’t defined error with Airflow 2.7.2 version. but this connection is already present in the connection list.

This issue is happening intermittently, and this error resulted into DAG import error on the airflow UI Screen.
enter image description here

Exception logs

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> File "/opt/airflow/plugins/domainp/utils/utilities.py", line 112, in on_retry_callback
retry_duration_limit = float(get_config_macro(task_ins, "retry_tasks_failed_within_seconds"))
File "/opt/airflow/plugins/domainp/utils/config.py", line 204, in get_config_macro
config = get_configs_macro(
File "/opt/airflow/plugins/domainp/utils/config.py", line 245, in get_configs_macro
filter_entries(get_pgcc_config(dataset_pcd_rendered, prefix), prefix)
File "/opt/airflow/plugins/domainp/utils/config.py", line 276, in get_pgcc_config
grpc_hook = GrpcServiceHook("shared_service_conn")
File "/opt/airflow/plugins/domainp/service/hooks/service.py", line 20, in __init__
self.conn = self.get_connection(self.conn_id)
File "/home/airflow/.local/lib/python3.10/site-packages/airflow/hooks/base.py", line 72, in get_connection
conn = Connection.get_connection_from_secrets(conn_id)
File "/home/airflow/.local/lib/python3.10/site-packages/airflow/models/connection.py", line 477, in get_connection_from_secrets
raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't defined")
airflow.exceptions.AirflowNotFoundException: The conn_id `shared_service_conn` isn't defined
the Connection fetch code:
class GrpcServiceHook(BaseHook):
"""Grpc service hook"""
</code>
<code> File "/opt/airflow/plugins/domainp/utils/utilities.py", line 112, in on_retry_callback retry_duration_limit = float(get_config_macro(task_ins, "retry_tasks_failed_within_seconds")) File "/opt/airflow/plugins/domainp/utils/config.py", line 204, in get_config_macro config = get_configs_macro( File "/opt/airflow/plugins/domainp/utils/config.py", line 245, in get_configs_macro filter_entries(get_pgcc_config(dataset_pcd_rendered, prefix), prefix) File "/opt/airflow/plugins/domainp/utils/config.py", line 276, in get_pgcc_config grpc_hook = GrpcServiceHook("shared_service_conn") File "/opt/airflow/plugins/domainp/service/hooks/service.py", line 20, in __init__ self.conn = self.get_connection(self.conn_id) File "/home/airflow/.local/lib/python3.10/site-packages/airflow/hooks/base.py", line 72, in get_connection conn = Connection.get_connection_from_secrets(conn_id) File "/home/airflow/.local/lib/python3.10/site-packages/airflow/models/connection.py", line 477, in get_connection_from_secrets raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't defined") airflow.exceptions.AirflowNotFoundException: The conn_id `shared_service_conn` isn't defined the Connection fetch code: class GrpcServiceHook(BaseHook): """Grpc service hook""" </code>
 File "/opt/airflow/plugins/domainp/utils/utilities.py", line 112, in on_retry_callback
    retry_duration_limit = float(get_config_macro(task_ins, "retry_tasks_failed_within_seconds"))
  File "/opt/airflow/plugins/domainp/utils/config.py", line 204, in get_config_macro
    config = get_configs_macro(
  File "/opt/airflow/plugins/domainp/utils/config.py", line 245, in get_configs_macro
    filter_entries(get_pgcc_config(dataset_pcd_rendered, prefix), prefix)
  File "/opt/airflow/plugins/domainp/utils/config.py", line 276, in get_pgcc_config
    grpc_hook = GrpcServiceHook("shared_service_conn")
  File "/opt/airflow/plugins/domainp/service/hooks/service.py", line 20, in __init__
    self.conn = self.get_connection(self.conn_id)
  File "/home/airflow/.local/lib/python3.10/site-packages/airflow/hooks/base.py", line 72, in get_connection
    conn = Connection.get_connection_from_secrets(conn_id)
  File "/home/airflow/.local/lib/python3.10/site-packages/airflow/models/connection.py", line 477, in get_connection_from_secrets
    raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't defined")
airflow.exceptions.AirflowNotFoundException: The conn_id `shared_service_conn` isn't defined 
the Connection fetch code:
class GrpcServiceHook(BaseHook):
    """Grpc service hook"""

Connection retrieve code

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>def __init__(self, conn_id) -> None:
super().__init__()
self.conn_id = conn_id
self.conn = self.get_connection(self.conn_id)
</code>
<code>def __init__(self, conn_id) -> None: super().__init__() self.conn_id = conn_id self.conn = self.get_connection(self.conn_id) </code>
def __init__(self, conn_id) -> None:
        super().__init__()
        self.conn_id = conn_id
        self.conn = self.get_connection(self.conn_id)

Please provide suggestions

New contributor

Anil Reddaboina is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật