Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] If a plugin file is missing, a misleading error is shown in the logs #633

Open
jtsextonMITRE opened this issue Aug 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jtsextonMITRE
Copy link
Collaborator

The specific use case I encountered this on was when forgetting to upload a needed plugin file that doesn't have any task plugins in it. (The plugin file contained functions required for other task plugins to run, but did not contain any task plugins itself). In this case, instead of printing an error along the lines of "this file could not be found" for importing functions from, it prints Package ____ does not exist, where the package it refers to is the folder that should contain the forgotten file.

Here is where the issue occurs:
https://github.com/usnistgov/dioptra/blob/main/src/dioptra/pyplugs/_plugins.py#L303

In the past, I believe we did not run into this at all because we uploaded the entire folder as a zip file, so forgetting files was pretty much impossible. Now that we upload them one at a time through the web interface this is more likely to occur and the actual import error should probably be bubbled up to somewhere. The V1 python client can probably avoid this issue by continuing to upload every python file in the directory (instead of what I was doing, which was only selecting files containing task plugins referenced in the specific YML entrypoint.

@jtsextonMITRE jtsextonMITRE added the bug Something isn't working label Aug 29, 2024
@jkglasbrenner
Copy link
Collaborator

The most obvious fix is to include the exception's message in the output to the user instead of swallowing entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants