diff --git a/src/LHCbDIRAC/BookkeepingSystem/Service/BookkeepingManagerHandler.py b/src/LHCbDIRAC/BookkeepingSystem/Service/BookkeepingManagerHandler.py
index 373051d18314dbc0e8f42b6358df88077c2a6bdf..e6f8664c4d0ee98417cf5e27b92c1eb1d27b3792 100644
--- a/src/LHCbDIRAC/BookkeepingSystem/Service/BookkeepingManagerHandler.py
+++ b/src/LHCbDIRAC/BookkeepingSystem/Service/BookkeepingManagerHandler.py
@@ -477,6 +477,11 @@ class BookkeepingManagerHandlerMixin:
         else:
             retVal = self._getFilesWithMetadata(in_dict)
 
+        if not retVal["OK"] and "ExecInfo" in retVal:
+            # ExecInfo isn't encodable by DEncode or JEncode and it's normally dropped
+            # transparently by the RPC mechanism. As we're doing it by hand here we need
+            # to remove it explicitly.
+            retVal.pop("ExecInfo")
         fileString = JEncoder.dumps(retVal)
 
         retVal = fileHelper.stringToNetwork(fileString)