Skip to content

Commit

Permalink
fix: CloudCE: truncate long messages returned from create_node.
Browse files Browse the repository at this point in the history
Co-authored-by: marianne013 <[email protected]>
Co-authored-by: aldbr <[email protected]>
  • Loading branch information
3 people committed Oct 10, 2024
1 parent fbfad32 commit 7f1eb61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DIRAC/Resources/Computing/CloudComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,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
Expand Down

0 comments on commit 7f1eb61

Please sign in to comment.