dbbs-lab / bsb-core

The Brain Scaffold Builder
https://bsb.readthedocs.io
GNU General Public License v3.0
22 stars 16 forks source link

Missing morphology metadata KeyError #819

Closed Helveg closed 8 months ago

Helveg commented 8 months ago

The following error occurs randomly when generating morphologies:

(b4py9) robin@LAPTOP-JF6T3PSU:/mnt/c/Users/pwd06/git/cerebellum$ bsb compile cerebellum.yaml --clear
  + Exception Group Traceback (most recent call last):
  |   File "/home/robin/.pyenv/versions/b4py9/bin/bsb", line 8, in <module>
  |     sys.exit(handle_cli())
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/cli/__init__.py", line 11, in handle_cli
  |     handle_command(sys.argv[1:], exit=True)
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/cli/__init__.py", line 31, in handle_command
  |     namespace.handler(namespace, dryrun=dryrun)
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/cli/commands/__init__.py", line 99, in execute_handler
  |     self.handler(context)
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/cli/commands/_commands.py", line 143, in handler
  |     network.compile(
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/profiling.py", line 159, in decorated
  |     return f(*args, **kwargs)
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/core.py", line 382, in compile
  |     self.run_placement(p_strats, fail_fast=fail_fast, pipelines=False)
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/profiling.py", line 159, in decorated
  |     return f(*args, **kwargs)
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/core.py", line 279, in run_placement
  |     pool.execute()
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 552, in execute
  |     self._execute_serial()
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 663, in _execute_serial
  |     self.notify()
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 687, in notify
  |     self.raise_unhandled()
  |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 701, in raise_unhandled
  |     raise WorkflowError(
  | bsb.services.pool.WorkflowError: Your workflow encountered errors. (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 332, in _completed
    |     result = self._future.result()
    |   File "/home/robin/.pyenv/versions/3.9.9/lib/python3.9/concurrent/futures/_base.py", line 438, in result
    |     return self.__get_result()
    |   File "/home/robin/.pyenv/versions/3.9.9/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    |     raise self._exception
    |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 293, in target
    |     result = self.execute(self._pool.owner, self._args, self._kwargs)
    |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 404, in execute
    |     return placement.place(chunk, indicators, **kwargs)
    |   File "/mnt/c/Users/pwd06/git/bsb/bsb/placement/arrays.py", line 99, in place
    |     self.place_cells(indicator, pos_current_chunk, chunk=c)
    |   File "/mnt/c/Users/pwd06/git/bsb/bsb/placement/strategy.py", line 92, in place_cells
    |     morphologies, rotations = self.distribute._specials(
    |   File "/mnt/c/Users/pwd06/git/bsb/bsb/placement/distributor.py", line 304, in _specials
    |     loaders = self.scaffold.storage.morphologies.select(*sel)
    |   File "/mnt/c/Users/pwd06/git/bsb-hdf5/bsb_hdf5/morphology_repository.py", line 45, in select
    |     all_loaders = self.all()
    |   File "/mnt/c/Users/pwd06/git/bsb-hdf5/bsb_hdf5/resource.py", line 44, in handle_indirection
    |     return f(*bound.args, **bound.kwargs)
    |   File "/mnt/c/Users/pwd06/git/bsb-hdf5/bsb_hdf5/morphology_repository.py", line 100, in all
    |     return [
    |   File "/mnt/c/Users/pwd06/git/bsb-hdf5/bsb_hdf5/morphology_repository.py", line 101, in <listcomp>
    |     self.preload(name, meta=meta[name], handle=handle) for name in self.keys()
    | KeyError: 'H17-03-013-11-08-04_692297214_m'
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    |   File "/mnt/c/Users/pwd06/git/bsb/bsb/services/pool.py", line 697, in raise_unhandled
    |     raise JobErroredError(f"{job} failed", job.error) from job.error
    | bsb.services.pool.JobErroredError: <bsb.services.pool.PlacementJob object {root}.placement.purkinje_layer_placement at 0x7f0e7b37d3a0> failed
    +------------------------------------