From 6a22662071b91f294b29a8420c30452dae36dad7 Mon Sep 17 00:00:00 2001 From: Simon Fayer Date: Sat, 12 Oct 2024 01:06:08 +0200 Subject: [PATCH] sweep: #7822 CloudCE: truncate long messages returned from create_node --- src/DIRAC/Resources/Computing/CloudComputingElement.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/DIRAC/Resources/Computing/CloudComputingElement.py b/src/DIRAC/Resources/Computing/CloudComputingElement.py index 1e3b0a3a2e7..aa0dd6dd5b5 100644 --- a/src/DIRAC/Resources/Computing/CloudComputingElement.py +++ b/src/DIRAC/Resources/Computing/CloudComputingElement.py @@ -491,7 +491,12 @@ def submitJob(self, executableFile, proxy, numberOfJobs=1): try: node = driver.create_node(**instParams) except Exception as err: - self.log.error("Failed to create_node", str(err)) + errMsg = str(err) + # sometimes cloud returns complete user_data which is too long for + # a sensible log message + if len(errMsg) > 256: + errMsg = f"{errMsg[:128]}...{errMsg[-128:]}" + self.log.error("Failed to create_node", errMsg) continue instIDs.append(VM_ID_PREFIX + node.id) stampDict[instName] = instRandom