# Buggy code
def check_obj(self, target, recurse=False):
    account = target.account
    container = target.container
    obj = target.obj

    if (account, container, obj) in self.running:
        self.running[(account, container, obj)].wait()
    if (account, container, obj) in self.list_cache:
        return self.list_cache[(account, container, obj)]
    self.running[(account, container, obj)] = Event()
    print('Checking object "%s"' % target)
    container_listing, ct_meta = self.check_container(target)
    error = False
    if obj not in container_listing:
        print("  Object %s missing from container listing" % target)
        error = True
        # checksum = None
    else:
        # TODO check checksum match
        # checksum = container_listing[obj]['hash']
        pass

    results = []
    meta = dict()
    try:
        meta, results = self.container_client.content_locate(
            account=account, reference=container, path=obj
        )
    except exc.NotFound as e:
        self.object_not_found += 1
        error = True
        print('  Not found object "%s": %s' % (target, str(e)))
    except Exception as e:
        self.object_exceptions += 1
        error = True
        print(' Exception object "%s": %s' % (target, str(e)))

    chunk_listing = dict()
    for chunk in results:
        chunk_listing[chunk["url"]] = chunk

    self.check_obj_policy(target.copy(), meta, results)

    self.objects_checked += 1
    self.list_cache[(account, container, obj)] = (chunk_listing, meta)
    self.running[(account, container, obj)].send(True)
    del self.running[(account, container, obj)]

    if recurse:
        for chunk in chunk_listing:
            t = target.copy()
            t.chunk = chunk
            self.pool.spawn_n(self.check_chunk, t)
    if error and self.error_file:
        self.write_error(target)
    return chunk_listing, meta


# Traceback (KeyError)
Checking object "account=AUTH_demo, container=testing, obj=magic"
Checking container "account=AUTH_demo, container=testing, obj=magic"
Checking account "account=AUTH_demo, container=testing, obj=magic"
Exception object "account=AUTH_demo, container=testing, obj=magic": ('reqid=None', 'Connection aborted.', HTTPException('got more than 100 headers',))
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/eventlet/greenpool.py", line 82, in _spawn_n_impl
func(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/oio/crawler/integrity.py", line 244, in check_obj
self.check_obj_policy(target.copy(), meta, results)
File "/usr/lib/python2.7/site-packages/oio/crawler/integrity.py", line 185, in check_obj_policy
stg_met = STORAGE_METHODS.load(obj_meta['chunk_method'])
KeyError: 'chunk_method'

Report
Accounts checked  : 1

Containers checked: 1

Objects checked   : 0
Exceptions        : 1

Chunks checked    : 0

# Fixed code
def check_obj(self, target, recurse=False):
    account = target.account
    container = target.container
    obj = target.obj

    if (account, container, obj) in self.running:
        self.running[(account, container, obj)].wait()
    if (account, container, obj) in self.list_cache:
        return self.list_cache[(account, container, obj)]
    self.running[(account, container, obj)] = Event()
    print('Checking object "%s"' % target)
    container_listing, ct_meta = self.check_container(target)
    error = False
    if obj not in container_listing:
        print("  Object %s missing from container listing" % target)
        error = True
        # checksum = None
    else:
        # TODO check checksum match
        # checksum = container_listing[obj]['hash']
        pass

    results = []
    meta = dict()
    try:
        meta, results = self.container_client.content_locate(
            account=account, reference=container, path=obj, properties=False
        )
    except exc.NotFound as e:
        self.object_not_found += 1
        error = True
        print('  Not found object "%s": %s' % (target, str(e)))
    except Exception as e:
        self.object_exceptions += 1
        error = True
        print(' Exception object "%s": %s' % (target, str(e)))

    chunk_listing = dict()
    for chunk in results:
        chunk_listing[chunk["url"]] = chunk

    self.check_obj_policy(target.copy(), meta, results)

    self.objects_checked += 1
    self.list_cache[(account, container, obj)] = (chunk_listing, meta)
    self.running[(account, container, obj)].send(True)
    del self.running[(account, container, obj)]

    if recurse:
        for chunk in chunk_listing:
            t = target.copy()
            t.chunk = chunk
            self.pool.spawn_n(self.check_chunk, t)
    if error and self.error_file:
        self.write_error(target)
    return chunk_listing, meta