From 620e49c480499231f6cc270e502c64f2c4b539cb Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 21 Jan 2026 14:19:44 +0100 Subject: [PATCH 1/4] Fix cluster_id length check in startup.py MAX_ID_LENGTH suggests a maximum length, not a static length. I adapted the condition accordingly --- bibigrid/core/startup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bibigrid/core/startup.py b/bibigrid/core/startup.py index a96bfb2e..30816cde 100755 --- a/bibigrid/core/startup.py +++ b/bibigrid/core/startup.py @@ -68,7 +68,7 @@ def check_cid(cluster_id): LOG.info("-cid %s is not a cid, but probably the master's ip. " "Using the master ip instead of cid only works if a cluster key is in your systems default ssh key " "location (~/.ssh/). Otherwise bibigrid can't identify the cluster key.") - if len(cluster_id) != id_generation.MAX_ID_LENGTH or not set(cluster_id).issubset( + if len(cluster_id) > id_generation.MAX_ID_LENGTH or not set(cluster_id).issubset( id_generation.CLUSTER_UUID_ALPHABET): LOG.warning( f"Cluster id doesn't fit length ({id_generation.MAX_ID_LENGTH}) or defined alphabet " From feb1fe758d4355b73f16621af91113e28863a33e Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 30 Jan 2026 11:46:50 +0100 Subject: [PATCH 2/4] Fix condition for cluster_id length check in startup_rest.py --- bibigrid/core/startup_rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bibigrid/core/startup_rest.py b/bibigrid/core/startup_rest.py index e995e090..f56e1af3 100644 --- a/bibigrid/core/startup_rest.py +++ b/bibigrid/core/startup_rest.py @@ -64,7 +64,7 @@ def setup(cluster_id, configurations_json=None): """ if cluster_id: if cluster_id and ( - len(cluster_id) != id_generation.MAX_ID_LENGTH or not set(cluster_id).issubset( + len(cluster_id) > id_generation.MAX_ID_LENGTH or not set(cluster_id).issubset( id_generation.CLUSTER_UUID_ALPHABET)): LOG.warning(f"Cluster id doesn't fit length ({id_generation.MAX_ID_LENGTH}) or defined alphabet " f"({id_generation.CLUSTER_UUID_ALPHABET}). Aborting.") From da1a3b59665c9a17d74f5c520414cce6c42aa3f7 Mon Sep 17 00:00:00 2001 From: Manuel Koesters <17874544+MKoesters@users.noreply.github.com> Date: Thu, 23 Jul 2026 10:09:04 +0200 Subject: [PATCH 3/4] add cid uniqueness check --- bibigrid/core/startup.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bibigrid/core/startup.py b/bibigrid/core/startup.py index 30816cde..5978965b 100755 --- a/bibigrid/core/startup.py +++ b/bibigrid/core/startup.py @@ -58,7 +58,12 @@ def set_logger_verbosity(verbosity): LOG.debug(f"Logging verbosity set to {capped_verbosity}") -def check_cid(cluster_id): +def check_cid(cluster_id, configurations): + providers = provider_handler.get_providers(configurations, LOG) + if not id_generation.is_unique_cluster_id(cluster_id, providers): + msg = f"Cluster id ({cluster_id}) already exists" + LOG.error(msg) + raise RuntimeError(msg) if "-" in cluster_id: new_cid = cluster_id.split("-")[-1] LOG.info("-cid %s is not a cid, but probably the entire master name. Using '%s' as " @@ -175,14 +180,14 @@ def main(verbose, debug, config_input, default_config_input, enforced_config_inp default_config_input = expand_path(default_config_input) enforced_config_input = expand_path(enforced_config_input) - if cluster_id: - cluster_id = check_cid(cluster_id) - configurations = configuration_handler.read_configuration(LOG, config_input) if not configurations: sys.exit(1) + if cluster_id: + cluster_id = check_cid(cluster_id, configurations) + configurations = configuration_handler.merge_configurations( user_config=configurations, default_config_path=default_config_input, From 338843fe4eeea1bec3f396cab18d00f4e6a7f2e8 Mon Sep 17 00:00:00 2001 From: Manuel Koesters <17874544+MKoesters@users.noreply.github.com> Date: Mon, 27 Jul 2026 06:45:25 +0000 Subject: [PATCH 4/4] only check cluster id uniqueness for create action --- bibigrid/core/startup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bibigrid/core/startup.py b/bibigrid/core/startup.py index 5978965b..fd669802 100755 --- a/bibigrid/core/startup.py +++ b/bibigrid/core/startup.py @@ -58,12 +58,13 @@ def set_logger_verbosity(verbosity): LOG.debug(f"Logging verbosity set to {capped_verbosity}") -def check_cid(cluster_id, configurations): - providers = provider_handler.get_providers(configurations, LOG) - if not id_generation.is_unique_cluster_id(cluster_id, providers): - msg = f"Cluster id ({cluster_id}) already exists" - LOG.error(msg) - raise RuntimeError(msg) +def check_cid(cluster_id, configurations, action): + if action == 'create': + providers = provider_handler.get_providers(configurations, LOG) + if not id_generation.is_unique_cluster_id(cluster_id, providers): + msg = f"Cluster id ({cluster_id}) already exists" + LOG.error(msg) + raise RuntimeError(msg) if "-" in cluster_id: new_cid = cluster_id.split("-")[-1] LOG.info("-cid %s is not a cid, but probably the entire master name. Using '%s' as " @@ -186,7 +187,7 @@ def main(verbose, debug, config_input, default_config_input, enforced_config_inp sys.exit(1) if cluster_id: - cluster_id = check_cid(cluster_id, configurations) + cluster_id = check_cid(cluster_id, configurations, action) configurations = configuration_handler.merge_configurations( user_config=configurations,