From 41740bad0580f40f60c27a164e73118968f670aa Mon Sep 17 00:00:00 2001 From: badrogger Date: Thu, 24 Oct 2024 17:57:14 +0000 Subject: [PATCH 1/2] Fix cleaner. Add more logs --- core/schains/cleaner.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/schains/cleaner.py b/core/schains/cleaner.py index f006d439..dc89fda4 100644 --- a/core/schains/cleaner.py +++ b/core/schains/cleaner.py @@ -109,11 +109,14 @@ def monitor(skale, node_config, dutils=None): for schain_name in schains_on_node: if schain_name not in schain_names_on_contracts: - logger.warning( + logger.info( '%s was found on node, but not on contracts: %s, trying to cleanup', schain_name, schain_names_on_contracts, ) + if schain_name == '': + logger.warning('Found phantom schain on node') + continue try: ensure_schain_removed(skale, schain_name, node_config.id, dutils=dutils) except Exception: @@ -138,6 +141,12 @@ def get_schains_on_node(dutils=None): schains_with_dirs = os.listdir(SCHAINS_DIR_PATH) schains_with_container = get_schains_with_containers(dutils) schains_active_records = get_schains_names() + logger.debug( + 'dirs %s, containers: %s, records: %s', + schains_with_dirs, + schains_with_container, + schains_active_records + ) return sorted(merged_unique(schains_with_dirs, schains_with_container, schains_active_records)) From 2c8add703b7ba701341d309ae97e7663e17d220a Mon Sep 17 00:00:00 2001 From: badrogger Date: Fri, 25 Oct 2024 11:32:28 +0000 Subject: [PATCH 2/2] Switch to info log --- core/schains/cleaner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/schains/cleaner.py b/core/schains/cleaner.py index dc89fda4..7fd291ef 100644 --- a/core/schains/cleaner.py +++ b/core/schains/cleaner.py @@ -141,7 +141,7 @@ def get_schains_on_node(dutils=None): schains_with_dirs = os.listdir(SCHAINS_DIR_PATH) schains_with_container = get_schains_with_containers(dutils) schains_active_records = get_schains_names() - logger.debug( + logger.info( 'dirs %s, containers: %s, records: %s', schains_with_dirs, schains_with_container,