Skip to content

Commit

Permalink
Merge pull request #7077 from chaen/v8.0_FIX_dmsErrorRepReg
Browse files Browse the repository at this point in the history
[v8.0] fix (ReplicateAndRegister): better error reporting for files with no replicas
  • Loading branch information
fstagni authored Aug 10, 2023
2 parents f944242 + f6f0e37 commit 15575a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,16 @@ def fts3Transfer(self):
)
opFile.Error = "Couldn't get metadata"
elif noReplicas:
self.log.error(
"Unable to schedule transfer",
f"File {opFile.LFN} doesn't exist at {','.join(noReplicas)}",
)
if None in noReplicas:
self.log.error(
"Unable to schedule transfer",
f"File {opFile.LFN} doesn't have any replicas, which should never happen",
)
else:
self.log.error(
"Unable to schedule transfer",
f"File {opFile.LFN} doesn't exist at {','.join(noReplicas)}",
)
opFile.Error = "No replicas found"
opFile.Status = "Failed"
elif badReplicas:
Expand Down
5 changes: 4 additions & 1 deletion src/DIRAC/Interfaces/API/Dirac.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,10 @@ def getReplicas(self, lfns, active=True, preferDisk=False, diskOnly=False, print
for lfn in repsResult["Value"]["Failed"]:
records.append((lfn, "Unknown", str(repsResult["Value"]["Failed"][lfn])))

printTable(fields, records, numbering=False)
if records:
printTable(fields, records, numbering=False)
else:
self.log.info("No replicas found")

return repsResult

Expand Down

0 comments on commit 15575a7

Please sign in to comment.