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

bad poncho import error message in Task Vine #3552

Open
benclifford opened this issue Jul 30, 2024 · 7 comments
Open

bad poncho import error message in Task Vine #3552

benclifford opened this issue Jul 30, 2024 · 7 comments
Labels

Comments

@benclifford
Copy link
Collaborator

Describe the bug
Trying to use Task Vine serverless mode, I get an error: "The poncho module is not available. Cannot create library {name}."

On deeper investigation, this is actually masking a different error, that conda_pack is not importable - see the below stack trace from lightly hacked code.

This is misleading to users who do have poncho available and are trying to debug this.

Process TaskVine-Submit-Process:
Traceback (most recent call last):
  File "/home/benc/parsl/src/cctools/I/lib/python3.12/site-packages/ndcctools/taskvine/manager.py", line 891, in create_library_from_functions
    from ndcctools.poncho import package_serverize
  File "/home/benc/parsl/src/cctools/I/lib/python3.12/site-packages/ndcctools/poncho/package_serverize.py", line 9, in <module>
    from ndcctools.poncho import package_create as create
  File "/home/benc/parsl/src/cctools/I/lib/python3.12/site-packages/ndcctools/poncho/package_create.py", line 12, in <module>
    import conda_pack
ModuleNotFoundError: No module named 'conda_pack'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.12/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/benc/parsl/src/parsl/parsl/process_loggers.py", line 26, in wrapped
    r = func(*args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^
  File "/home/benc/parsl/src/parsl/parsl/executors/taskvine/manager.py", line 248, in _taskvine_submit_wait
    serverless_lib = m.create_library_from_functions('common-parsl-taskvine-lib',
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/benc/parsl/src/cctools/I/lib/python3.12/site-packages/ndcctools/taskvine/manager.py", line 893, in create_library_from_functions
    raise ModuleNotFoundError(f"The poncho module is not available. Cannot create library {name}.") from ie
ModuleNotFoundError: The poncho module is not available. Cannot create library common-parsl-taskvine-lib.

cc @tphung3 @dthain

To Reproduce
install task vine without conda pack. try using serverless mode.

Environment
my laptop

@dthain
Copy link
Contributor

dthain commented Jul 30, 2024

Hmm, I wonder what the precise installation method is here. conda install ndcctools includes conda-pack as a dependency. Was this installed in some other way?

@BarrySlyDelgado is Mr Poncho. Do you have any other ideas?

@benclifford
Copy link
Collaborator Author

yeah it's my dev source build!

if i pip install conda_pack then I get the right behaviour and can run stuff - so it's really the phrasing rather than any fundamental failure here...

@dthain
Copy link
Contributor

dthain commented Jul 30, 2024

So maybe we should not try so hard to catch the error, and just let the import fail in the normal way. There was some prior reason we did it that way, but the reason eludes me...

@benclifford
Copy link
Collaborator Author

yeah i think that would be good. there are other places in parsl where we have done an import and made the assumption that the import failed must mean that its because that particular dependency is not installed -- rather than accept that there could be all sorts of reasons.

@benclifford
Copy link
Collaborator Author

alternatively, what I did to diagnose above was to write this:

catch ImportError as ie
raise ModuleNotFoundError(f"The poncho module is not available. Cannot create library {name}.") from ie

which makes the stack trace contain the original exception rather than masking it.

I'm not super fussed either way, and if you don't get round to doing anything here, i'll probably commit that (with a message rephase) when I'm feeling like a simple PR...

@dthain
Copy link
Contributor

dthain commented Jul 31, 2024

@BarrySlyDelgado
Copy link

We now forgo catching the import exception when creating a library with the change introduced in cooperative-computing-lab/cctools#3907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants