napari / napari-plugin-manager

The napari plugin installation dialog and associated machinery
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

Error trying to cancel actions #61

Open dalthviz opened 1 week ago

dalthviz commented 1 week ago

Trigger a plugin update or installation and then try to cancel the operation via cancel all actions. An error appears over the terminal/cmd used to launch napari and the plugin ends up updating or being installed.

Traceback

```python-traceback --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\anaconda3\envs\napari-dev\lib\site-packages\napari_plugin_manager\qt_package_installer.py:395, in InstallerQueue.cancel(self=, job_id=False) 388 msg = f"No job with id {job_id}. Current queue:\n - " 389 msg += "\n - ".join( 390 [ 391 f"{item.ident} -> {item.executable()} {item.arguments()}" 392 for item in self._queue 393 ] 394 ) --> 395 raise ValueError(msg) msg = "No job with id False. Current queue:\n - -3303983535389491151 -> C:\\Users\\dalth\\anaconda3\\envs\\napari-dev\\python.exe ('-m', 'pip', 'install', '-c', 'C:\\\\Users\\\\dalth\\\\AppData\\\\Local\\\\Temp\\\\tmpatxfwlpv-napari-constraints.txt', 'affinder==0.4.0rc0')" ValueError: No job with id False. Current queue: - -3303983535389491151 -> C:\Users\dalth\anaconda3\envs\napari-dev\python.exe ('-m', 'pip', 'install', '-c', 'C:\\Users\\dalth\\AppData\\Local\\Temp\\tmpatxfwlpv-napari-constraints.txt', 'affinder==0.4.0rc0') --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\anaconda3\envs\napari-dev\lib\site-packages\napari_plugin_manager\qt_package_installer.py:395, in InstallerQueue.cancel(self=, job_id=False) 388 msg = f"No job with id {job_id}. Current queue:\n - " 389 msg += "\n - ".join( 390 [ 391 f"{item.ident} -> {item.executable()} {item.arguments()}" 392 for item in self._queue 393 ] 394 ) --> 395 raise ValueError(msg) msg = "No job with id False. Current queue:\n - -3303983535389491151 -> C:\\Users\\dalth\\anaconda3\\envs\\napari-dev\\python.exe ('-m', 'pip', 'install', '-c', 'C:\\\\Users\\\\dalth\\\\AppData\\\\Local\\\\Temp\\\\tmppkq2zfpo-napari-constraints.txt', 'affinder==0.4.0rc0')" ValueError: No job with id False. Current queue: - -3303983535389491151 -> C:\Users\dalth\anaconda3\envs\napari-dev\python.exe ('-m', 'pip', 'install', '-c', 'C:\\Users\\dalth\\AppData\\Local\\Temp\\tmppkq2zfpo-napari-constraints.txt', 'affinder==0.4.0rc0') Exception ignored in atexit callback: PermissionError: [WinError 32] El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso: 'C:\\Users\\dalth\\AppData\\Local\\Temp\\tmppkq2zfpo-napari-constraints.txt' Exception ignored in atexit callback: PermissionError: [WinError 32] El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso: 'C:\\Users\\dalth\\AppData\\Local\\Temp\\tmpatxfwlpv-napari-constraints.txt' Exception ignored in atexit callback: PermissionError: [WinError 32] El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso: 'C:\\Users\\dalth\\AppData\\Local\\Temp\\tmprlsro03k-napari-constraints.txt' ```

napari info

``` napari: 0.5.0a2.dev750+g0e01840c Platform: Windows-10-10.0.19045-SP0 Python: 3.10.9 | packaged by conda-forge | (main, Jan 11 2023, 15:15:40) [MSC v.1916 64 bit (AMD64)] Qt: 5.15.2 PyQt5: 5.15.10 NumPy: 1.25.2 SciPy: 1.9.3 Dask: 2023.10.1 VisPy: 0.14.1 magicgui: 0.7.3 superqt: 0.6.7 in-n-out: 0.2.0 app-model: 0.2.7 npe2: 0.7.5 OpenGL: - GL version: 4.5.0 - Build 25.20.100.6444 - MAX_TEXTURE_SIZE: 16384 - GL_MAX_3D_TEXTURE_SIZE: 2048 Screens: - screen 1: resolution 1366x768, scale 1.0 - screen 2: resolution 1920x1080, scale 1.0 Optional: - numba: 0.58.1 - triangle not installed Settings path: - C:\Users\dalth\AppData\Local\napari\napari-dev_4454fdbf170edefe23827a4bf512389a6806af69\settings.yaml Plugins: - affinder: 0.4.0rc0 (8 contributions) - napari: 0.5.0a2.dev750+g0e01840c (81 contributions) - napari-assistant: 0.4.7 (4 contributions) - napari-console: 0.1.dev42+ge2a8d71.d20240315 (0 contributions) - napari-generic-SIMulator: 0.1.2 (4 contributions) - napari-ome-zarr: 0.5.2 (2 contributions) - napari-pyclesperanto-assistant: 0.22.1 (51 contributions) - napari-skimage-regionprops: 0.10.1 (2 contributions) - napari-svg: 0.1.10 (2 contributions) - napari-time-slicer: 0.4.9 (2 contributions) - napari-tools-menu: 0.1.19 (0 contributions) - napari-ui-tracer: 0.2.0.dev0 (2 contributions) ```
goanpeca commented 1 week ago

Thanks for the report @dalthviz , just to check is this still present on this PR https://github.com/napari/napari-plugin-manager/pull/45 ?

dalthviz commented 6 days ago

Checking #45 I think a kind of related error can still happen but you need to click cancel all actions and also the cancel button from an specific plugin item in the dialog:

plugin_cancel_action_error

goanpeca commented 6 days ago

Ok, I think it is easier to fix over there, as I remember seeing the issue you raised. Working on a fix :O)