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

Having Openeye installed with no license kills the server #271

Open
jthorton opened this issue Jul 11, 2023 · 1 comment
Open

Having Openeye installed with no license kills the server #271

jthorton opened this issue Jul 11, 2023 · 1 comment

Comments

@jthorton
Copy link
Contributor

Description
Running a bespokefit server in an environment with openeye installed but not licensed causes the server to die while creating a canonical ordering of the molecule for the qcgeneration stage.

Reproduction

launch a bespokefit server
openff-bespoke executor launch
submit a molecule
openff-bespoke executor submit --smiles 'CCCCO' --workflow debug
watch the progress
openff-bespoke executor watch --id 1

Output

[task id=1] transitioned from waiting -> running
[task id=1] fragmentation transitioned from waiting -> success
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 75, in __call__
    raise exc
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 64, in __call__
    await self.app(scope, receive, sender)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/routing.py", line 680, in __call__
    await route.handle(scope, receive, send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/routing.py", line 275, in handle
    await self.app(scope, receive, send)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/routing.py", line 65, in app
    response = await func(request)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/fastapi/routing.py", line 235, in app
    raw_response = await run_endpoint_function(
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/home/b6056633/programs/openff-bespokefit/openff/bespokefit/executor/services/qcgenerator/app.py", line 88, in post_qc_result
    task_id = cached_compute_task(body.input_schema, redis_connection)
  File "/home/b6056633/programs/openff-bespokefit/openff/bespokefit/executor/services/qcgenerator/cache.py", line 68, in cached_compute_task
    task = _canonicalize_task(task)
  File "/home/b6056633/programs/openff-bespokefit/openff/bespokefit/executor/services/qcgenerator/cache.py", line 18, in _canonicalize_task
    canonical_molecule = canonical_order_atoms(
  File "/home/b6056633/programs/openff-bespokefit/openff/bespokefit/utilities/molecule.py", line 72, in canonical_order_atoms
    atom_order = _oe_canonical_atom_order(molecule)
  File "/home/b6056633/programs/openff-bespokefit/openff/bespokefit/utilities/molecule.py", line 37, in _oe_canonical_atom_order
    oe_mol: oechem.OEMol = molecule.to_openeye()
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/openff/toolkit/topology/molecule.py", line 5048, in to_openeye
    return toolkit_registry.call(
  File "/home/b6056633/micromamba/envs/bespokefit/lib/python3.9/site-packages/openff/toolkit/utils/toolkit_registry.py", line 370, in call
    raise ValueError(msg)
ValueError: No registered toolkits can provide the capability "to_openeye" for args "(Molecule with name '' and SMILES '[H][O][C]([H])([H])[C]([H])([H])[C]([H])([H])[C]([H])([H])[H]',)" and kwargs "{'aromaticity_model': 'O
EAroModel_MDL'}"
Available toolkits are: [ToolkitWrapper around The RDKit version 2023.03.2, ToolkitWrapper around AmberTools version 22.0, ToolkitWrapper around Built-in Toolkit version None]

Fix
The molecule utility functions need to check that openeye is licensed and raise and error if not.

Software versions

  • Which operating system and version are you using? Ubuntu 20.04.5 LTS (Focal Fossa)
  • How did you install BespokeFit? mamba install 'openff-bespokefit>=0.2' -c conda-forge
  • Are you using Apple Silicon? If so, are you running BespokeFit in Rosetta (osx-64) or natively (osx-arm64)? no
  • What is the output of running conda list?
Output of conda list

Please place the output of conda list here

@mattwthompson
Copy link
Member

Might be useful: https://github.com/openforcefield/openff-utilities/blob/v0.1.8/openff/utilities/utilities.py#L87

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

Successfully merging a pull request may close this issue.

2 participants