question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fallback plugin logic faulty

See original GitHub issue

🐛 Bug

Dragging and dropping an (apparently malformed 😅) multiscale .zarr folder to napari gave me the following error:

INFO:napari_plugin_engine.manager:loaded 3 plugins:
  <module 'napari.plugins._builtins' from '/Users/jni/conda/envs/all/lib/python3.8/site-packages/napari/plugins/_builtins.py'>
  <module 'napari_svg' from '/Users/jni/conda/envs/all/lib/python3.8/site-packages/napari_svg/__init__.py'>
  <module 'ome_zarr' from '/Users/jni/conda/envs/all/lib/python3.8/site-packages/ome_zarr.py'>
  <module 'napari_plugin_engine' from '/Users/jni/conda/envs/all/lib/python3.8/site-packages/napari_plugin_engine/__init__.py'>
ERROR:napari.plugins.io:PluginError: Error in plugin 'builtins', hook 'napari_get_reader': local variable 'image' referenced before assignment
  Cause was: local variable 'image' referenced before assignment
    version: 0.3.0
    package: napari

ERROR:napari.components.add_layers_mixin:No plugin found capable of reading /Volumes/datac/napari-data/covid-gut/.

Note “local variable image referenced before assignment”. This should never happen.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
tlambert03commented, May 7, 2020

I can’t get the stack trace if I launched napari from the command line.

not even in the plugin error reporter? under builtins?

ohhh … do you mean you launch it with a filepath and it quits immediately?? hadn’t thought about that!

1reaction
jnicommented, May 7, 2020

Another logic issue: if data is a list BUT the arrays are not in decreasing order of size, we throw an AttributeError:

~/conda/envs/all/lib/python3.8/site-packages/napari/layers/image/image.py in __init__(self, data, rgb, colormap, contrast_limits, gamma, interpolation, rendering, iso_threshold, attenuation, name, metadata, scale, translate, opacity, blending, visible, multiscale)
    162             init_shape = data[0].shape
    163         else:
--> 164             init_shape = data.shape
    165
    166         # Determine if rgb

AttributeError: 'list' object has no attribute 'shape'

In this case this happened because the plugin (I’m still trying to figure out why) ended up providing the arrays in lexicographical (0, 1, 10, 2) order rather than numerical.

We should detect malformed data and quit gracefully (or re-sort, but I like that less), rather than crash with a mysterious error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SmallRye Fault Tolerance - Quarkus
In this guide, we demonstrate usage of MicroProfile Fault Tolerance annotations such as @Timeout , @Fallback , @Retry and @CircuitBreaker .
Read more >
Bypass, remove, or rescan Audio Units plug-ins in Logic Pro ...
Try to open Logic Pro or MainStage. If you can open the app, replace each plug-in file to its original location one-by-one. Quit...
Read more >
Building fault-tolerant microservices with the @Fallback ...
A tutorial and an example on how to build resilient Java microservices to handle failed executions using MicroProfile Fault Tolerance and monitor ...
Read more >
Plugin-Alliance plugs crashing Logic under 10.7.5/Ventura
Yeah, but then I'm right back at the "crashing on bounce" problem in Ventura which can't be downgraded, for some strange reason. Quote ......
Read more >
Resilience design patterns: retry, fallback, timeout, circuit ...
Resilient software should tolerate faults and failures. ... patterns like fallback values heavily depend on your business logic.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found