Skip to content

Commit 15575a7

Browse files
authored
Merge pull request #7077 from chaen/v8.0_FIX_dmsErrorRepReg
[v8.0] fix (ReplicateAndRegister): better error reporting for files with no replicas
2 parents f944242 + f6f0e37 commit 15575a7

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/DIRAC/DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,16 @@ def fts3Transfer(self):
430430
)
431431
opFile.Error = "Couldn't get metadata"
432432
elif noReplicas:
433-
self.log.error(
434-
"Unable to schedule transfer",
435-
f"File {opFile.LFN} doesn't exist at {','.join(noReplicas)}",
436-
)
433+
if None in noReplicas:
434+
self.log.error(
435+
"Unable to schedule transfer",
436+
f"File {opFile.LFN} doesn't have any replicas, which should never happen",
437+
)
438+
else:
439+
self.log.error(
440+
"Unable to schedule transfer",
441+
f"File {opFile.LFN} doesn't exist at {','.join(noReplicas)}",
442+
)
437443
opFile.Error = "No replicas found"
438444
opFile.Status = "Failed"
439445
elif badReplicas:

src/DIRAC/Interfaces/API/Dirac.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,10 @@ def getReplicas(self, lfns, active=True, preferDisk=False, diskOnly=False, print
917917
for lfn in repsResult["Value"]["Failed"]:
918918
records.append((lfn, "Unknown", str(repsResult["Value"]["Failed"][lfn])))
919919

920-
printTable(fields, records, numbering=False)
920+
if records:
921+
printTable(fields, records, numbering=False)
922+
else:
923+
self.log.info("No replicas found")
921924

922925
return repsResult
923926

0 commit comments

Comments
 (0)