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

Enhance Experiment Logs to Include Detailed ImportError Information #271

Open
rkjakeer opened this issue Mar 1, 2024 · 0 comments
Open

Comments

@rkjakeer
Copy link

rkjakeer commented Mar 1, 2024

Is your feature request related to a problem? Please describe.
I am working on a new custom extension and I have encountered occasional errors, such as the one shown below while running experiments with it. This error seems to occur during the custom module import process. Although the module is installed using pip install, we lack detailed information about what caused the import to fail. Running the experiment in verbose mode did not provide additional insights either.

ERROR] [run:188] could not find Python module '<custom-extension>' in activity '<activity-name>'

Describe the solution you'd like
To enhance troubleshooting, it would be beneficial if the experiment log also included details about the error. Therefore, I propose logging the ImportError in this section that currently captures the error. Currently, the log output lacks information regarding the root cause of the import errors.

Describe alternatives you've considered
I attempted using sys.exc_info() in the specified section, which provided the following error message, aiding in issue resolution:

ImportError (<class 'ImportError'>, ImportError("cannot import name 'setup_logger' from 'logzero' (unknown location)"), <traceback object at 0x7fdaef5584c0>)

Additional context
The custom extension was attempting to import setup_logger from logzero and required correction to address the root cause of the issue.

cdsre added a commit to cdsre/chaostoolkit-lib that referenced this issue Mar 3, 2024
… fails to import. This is to help aid debugging the underlying cause as raised in issue chaostoolkit#271

Signed-off-by: Chris Doyle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant