POSKeyError: ‘No blob file’ using api.content.copy

I'm trying to copy objects from a collection into a folder. Each collection consists of documents, files, and images. When I ran the script, it throws the POSKeyError exception.

Code Snippet

def setCollectionChildrenToFolder(collection, folder):
     filters = {v['i']: v['v'] for v in collection.query}
     objects = collection.listFolderContents(contentFilter=filters)
     print "{} objects found in collection {}".format(len(objects), collection.title)
     for obj in objects:
         print "Copying {} to {}".format(obj.title, folder.title)
         api.content.copy(obj, folder)

Any ideas on how to resolve this?

@b4oshany
You probably need to show what line 64 of collectoinToFolder.py is doing. Or even better, just share the entire script.

Code Snippet

def setCollectionChildrenToFolder(collection, folder):
     filters = {v['i']: v['v'] for v in collection.query}
     objects = collection.listFolderContents(contentFilter=filters)
     print "{} objects found in collection {}".format(len(objects), collection.title)
     for obj in objects:
         print "Copying {} to {}".format(obj.title, folder.title)
         api.content.copy(obj, folder)

Usually that error happens when the blob file on the file system that the db is pointing to is missing.

options:

Your screenshot is cutting off the oid printed by the traceback, but I think you should use it in a debug session to find out which object is actually missing a blob:

>>> app._p_jar.get(oid)