MolSSI / QCFractal

A distributed compute and database platform for quantum chemistry.
https://molssi.github.io/QCFractal/
BSD 3-Clause "New" or "Revised" License
144 stars 47 forks source link

SSL error on creating FractalSnowflakeHandler #734

Closed ntBre closed 11 months ago

ntBre commented 1 year ago

Describe the bug

When trying to build a FractalSnowflakeHandler, I get the error below:

---------------------------------------------------------------------------
ConnectionRefusedError                    Traceback (most recent call last)
Cell In[1], line 4
      1 from qcfractal import FractalSnowflakeHandler
      2 from qcportal.client import FractalClient
----> 4 local_fractal_instance = FractalSnowflakeHandler(ncores=8)
      5 local_fractal_client = FractalClient(local_fractal_instance)

File [~/mambaforge/envs/build-a-force-field/lib/python3.10/site-packages/qcfractal/snowflake.py:230](https://file+.vscode-resource.vscode-cdn.net/home/brent/omsf/notebooks/~/mambaforge/envs/build-a-force-field/lib/python3.10/site-packages/qcfractal/snowflake.py:230), in FractalSnowflakeHandler.__init__(self, ncores)
    227 # Set items for the Client
    228 self.client_verify = False
--> 230 self.start()
    232 # We need to call before threadings cleanup
    233 atexit.register(self.stop)

File [~/mambaforge/envs/build-a-force-field/lib/python3.10/site-packages/qcfractal/snowflake.py:361](https://file+.vscode-resource.vscode-cdn.net/home/brent/omsf/notebooks/~/mambaforge/envs/build-a-force-field/lib/python3.10/site-packages/qcfractal/snowflake.py:361), in FractalSnowflakeHandler.start(self, timeout)
    359     self.stop()
    360     out, err = self._qcfractal_proc.communicate()
--> 361     raise ConnectionRefusedError(
    362         "Snowflake instance did not boot properly, try increasing the timeout.\n\n"
    363         f"stdout:\n{out.decode()}\n\n",
    364         f"stderr:\n{err.decode()}",
    365     )
    367 self._running = True

ConnectionRefusedError: [Errno Snowflake instance did not boot properly, try increasing the timeout.

stdout:
Starting a QCFractal server.

QCFractal server base folder: [/tmp/tmp_99lm2eb](https://file+.vscode-resource.vscode-cdn.net/tmp/tmp_99lm2eb)

>>> Examining SSL Certificates...
Autogenerated SSL certificates, clients must use 'verify=False' when connecting.

>>> Logging to [/tmp/tmp_99lm2eb/db_dc89b52c_9b1b_4bd6_8ed3_a5fecbbbdc9b](https://file+.vscode-resource.vscode-cdn.net/tmp/tmp_99lm2eb/db_dc89b52c_9b1b_4bd6_8ed3_a5fecbbbdc9b)
>>> Loglevel: INFO

>>> Checking the PostgreSQL connection...

>>> Initializing the QCFractal server...
Fatal during server startup:

[SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:3900)

Failed to start the server, shutting down.

] stderr:

To Reproduce

from qcfractal import FractalSnowflakeHandler

local_fractal_instance = FractalSnowflakeHandler()

Expected behavior

No error.

Additional context

I spent some time debugging this with @j-wags and we noticed that it works on Python 3.8 and 3.9 but not on 3.10. I found this issue that might be at least tangentially related.

Here's the original failing conda environment I was using: fail.txt

And the 3.9 environment that worked: pass.txt

j-wags commented 1 year ago

It's also worth mentioning that this reproduced on three machines - a linux box (both native and an ubuntu VM), an M1 mac, and an M2 mac.

bennybp commented 11 months ago

I don't believe this happens in v0.50 (we don't deal with certificates at all, especially with snowflakes). And v0.15.x is now EOL. So closing, but let me know if this is really holding you back for some reason