ZettaAI / zetta_utils

MIT License
11 stars 0 forks source link

Cryptic error message for missing destination NG layer #803

Open nkemnitz opened 1 month ago

nkemnitz commented 1 month ago

Could use a better check and exception (including the layer path):

2024-10-02 08:15:03.346 ERROR    mazepa /home/nkemnitz/zetta_utils/zetta_utils/mazepa/execution_state.py: 138
                                 Task traceback: Traceback (most recent call last):
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/datasource/precomputed/metadata.py", line 610, in to_mip
                                     (i for (i,s) in enumerate(self.scales) if s["resolution"] == mip)
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/datasource/precomputed/metadata.py", line 446, in scales
                                     return self.info['scales']
                                 KeyError: 'scales'

                                 During handling of the above exception, another exception occurred:

                                 Traceback (most recent call last):
                                   File "/opt/zetta_utils/zetta_utils/mazepa/tasks.py", line 99, in __call__
                                     return_value = self._call_task_fn(debug=debug)
                                   File "/opt/zetta_utils/zetta_utils/mazepa/tasks.py", line 79, in _call_task_fn
                                     return_value = self.fn(*self.args, **self.kwargs)
                                   File "/opt/zetta_utils/zetta_utils/mazepa_layer_processing/common/subchunkable_apply_flow.py", line 73, in __call__
                                     mazepa.Executor(
                                   File "/opt/zetta_utils/zetta_utils/mazepa/execution.py", line 47, in __call__
                                     return execute(
                                   File "/opt/zetta_utils/zetta_utils/mazepa/execution.py", line 129, in execute
                                     _execute_from_state(
                                   File "/opt/zetta_utils/zetta_utils/mazepa/execution.py", line 179, in _execute_from_state
                                     submit_ready_tasks(
                                   File "/opt/zetta_utils/zetta_utils/mazepa/execution.py", line 216, in submit_ready_tasks
                                     task_outcomes = outcome_queue.pull(max_num=100)
                                   File "/opt/zetta_utils/zetta_utils/mazepa/autoexecute_task_queue.py", line 43, in pull
                                     results.append(execute_task(task, self.debug, self.handle_exceptions))
                                   File "/opt/zetta_utils/zetta_utils/mazepa/autoexecute_task_queue.py", line 56, in execute_task
                                     finished_processing, outcome = process_task_message(
                                   File "/opt/zetta_utils/zetta_utils/mazepa/worker.py", line 107, in process_task_message
                                     outcome = task(debug=debug, handle_exceptions=handle_exceptions)
                                   File "/opt/zetta_utils/zetta_utils/mazepa/tasks.py", line 110, in __call__   
                                     return_value = self._call_task_fn(debug=debug)
                                   File "/opt/zetta_utils/zetta_utils/mazepa/tasks.py", line 79, in _call_task_fn
                                     return_value = self.fn(*self.args, **self.kwargs)
                                   File "/opt/zetta_utils/zetta_utils/mazepa_layer_processing/common/volumetric_callable_operation.py", line 90, in __call__
                                     task_kwargs = _process_callable_kwargs(idx_input_padded, kwargs)
                                   File "/opt/zetta_utils/zetta_utils/mazepa_layer_processing/common/callable_operation.py", line 23, in _process_callable_kwargs
                                     result[k] = v.read_with_procs(idx)
                                   File "/opt/zetta_utils/zetta_utils/layer/layer_base.py", line 53, in read_with_procs
                                     data_backend = self.backend.read(idx=idx_proced)
                                   File "/opt/zetta_utils/zetta_utils/layer/volumetric/cloudvol/backend.py", line 201, in read
                                     cvol = _get_cv_cached(self.path, idx.resolution, **self.cv_kwargs)
                                   File "/opt/zetta_utils/zetta_utils/layer/volumetric/cloudvol/backend.py", line 43, in _get_cv_cached
                                     result = CloudVolume(
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/cloudvolume.py", line 233, in __new__
                                     return REGISTERED_PLUGINS[path.format](**kwargs)
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/datasource/precomputed/__init__.py", line 105, in create_precomputed
                                     return CloudVolumePrecomputed(
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/frontends/precomputed.py", line 55, in __init__
                                     self.mip = mip
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/frontends/precomputed.py", line 272, in mip
                                     self.config.mip = self.meta.to_mip(mip)
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/datasource/precomputed/metadata.py", line 620, in to_mip
                                     scales = [ ",".join(map(str, scale)) for scale in self.available_resolutions ]
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/datasource/precomputed/metadata.py", line 510, in available_resolutions
                                     return (s["resolution"] for s in self.scales)
                                   File "/usr/local/lib/python3.10/dist-packages/cloudvolume/datasource/precomputed/metadata.py", line 446, in scales
                                     return self.info['scales']
                                 KeyError: 'scales'