pymapdl icon indicating copy to clipboard operation
pymapdl copied to clipboard

TimeOut error when initializing pools

Open tletutour-an opened this issue 1 year ago • 2 comments

🤓 Before submitting the issue

🔍 Description of the bug

I have tried on different PCs with different versions of the package (0.69.dev0, 0.68.4, 0.67) to use MapdlPool and it works but some client processes do not connect. I have provided a sharepoint link to the code for a minimally working example.

🕵️ Steps To Reproduce

Run impedance_conductivities.py on this folder ... (ask for link) It relies on input files (exp_plan.csv, dura_thickness_0.33585088029503823.cdb) and 2 helper classes (FieldComputer.py and ExperiencePlanManager.py).

Give it some time, it might work at first but it will fail at some point and console will show output in logger

💻 Which Operating System are you using?

Windows

🐍 Which Python version are you using?

3.11

💾 Which MAPDL version are you using?

24.1

📝 PyMAPDL Report

Show the Report!

C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\pyvista\utilities\__init__.py:72: PyVistaDeprecationWarning: The `pyvista.utilities` module has been deprecated. `GPUInfo` is now imported as: `from pyvista.report import GPUInfo`.
  warnings.warn(
-------------------------------------------------------------------------------


PyMAPDL Software and Environment Report


Packages Requirements
*********************

Core packages
-------------
ansys.mapdl.core    : 0.68.4
numpy               : 1.26.4
platformdirs        : 4.3.6
scipy               : 1.14.1
grpc                : Package not found
ansys.api.mapdl.v0  : Package not found
ansys.mapdl.reader  : 0.54.1
google.protobuf     : Package not found

Optional packages
-----------------
matplotlib          : 3.9.2
pyvista             : 0.44.1
pyiges              : 0.3.1
tqdm                : 4.66.5


Ansys Installation
******************
Version   Location
------------------
231       C:\Program Files\ANSYS Inc\v231
241       C:\Program Files\ANSYS Inc\v241


Ansys Environment Variables
***************************
ANSYS231_DIR                   C:\Program Files\ANSYS Inc\v231\ANSYS
ANSYS241_DIR                   C:\Program Files\ANSYS Inc\v241\ANSYS
ANSYSLIC_DIR                   C:\Program Files\ANSYS Inc\Shared Files\Licensing
AWP_LOCALE231                  en-us
AWP_LOCALE241                  en-us
AWP_ROOT231                    C:\Program Files\ANSYS Inc\v231
AWP_ROOT241                    C:\Program Files\ANSYS Inc\v241
CADOE_LIBDIR231                C:\Program Files\ANSYS Inc\v231\CommonFiles\Language\en-us
CADOE_LIBDIR232                C:\Program Files\ANSYS Inc\v232\CommonFiles\Language\en-us
CADOE_LIBDIR241                C:\Program Files\ANSYS Inc\v241\CommonFiles\Language\en-us

📝 Installed packages

Show the installed packages!

ansys-api-mapdl==0.5.2
ansys-api-platform-instancemanagement==1.1.0
ansys-mapdl-core==0.68.4
ansys-mapdl-reader==0.54.1
ansys-math-core==0.1.5
ansys-platform-instancemanagement==1.1.2
ansys-tools-path==0.6.0
appdirs==1.4.4
certifi==2024.8.30
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.3.0
cycler==0.12.1
fonttools==4.54.1
geomdl==5.3.1
grpcio==1.66.2
idna==3.10
importlib_metadata==8.5.0
kiwisolver==1.4.7
matplotlib==3.9.2
NEURON==8.2.2
numpy==1.26.4
packaging==24.1
pandas==2.2.3
pillow==10.4.0
platformdirs==4.3.6
pooch==1.8.2
protobuf==4.25.5
psutil==6.0.0
pyansys-tools-versioning==0.6.0
pyiges==0.3.1
pyparsing==3.1.4
python-dateutil==2.9.0.post0
pytz==2024.2
pyvista==0.44.1
requests==2.32.3
scipy==1.14.1
scooby==0.10.0
six==1.16.0
tabulate==0.9.0
tqdm==4.66.5
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.2.3
vtk==9.3.1
zipp==3.20.2

📝 Logger output file

Show the logger output file.

  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 525, in _multi_connect    
ansys.mapdl.core.errors.MapdlConnectionError: Unable to connect to MAPDL gRPC instance at dns:///127.0.0.1:50052.
Reached either maximum amount of connection attempts (5) or timeout (45 s).The MAPDL process seems to be alive (PID: 32808) but PyMAPDL cannot connect to it.

During handling of the above exception, another exception occurred:

    raise MapdlConnectionError(
Traceback (most recent call last):
ansys.mapdl.core.errors.MapdlConnectionError: Unable to connect to MAPDL gRPC instance at dns:///127.0.0.1:50054.
Reached either maximum amount of connection attempts (5) or timeout (45 s).The MAPDL process seems to be alive (PID: 32736) but PyMAPDL cannot connect to it.
  File "C:\Users\tletutou\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1045, in _bootstrap_inner

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\tletutou\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "C:\Users\tletutou\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 982, in run
    self.run()
  File "C:\Users\tletutou\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\pool.py", line 907, in _spawn_mapdl
    self._target(*self._args, **self._kwargs)
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\pool.py", line 907, in _spawn_mapdl
    self._instances[index] = launch_mapdl(
                             ^^^^^^^^^^^^^
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\launcher.py", line 1831, in launch_mapdl       
    self._instances[index] = launch_mapdl(
                             ^^^^^^^^^^^^^
    lic_check.check()
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\launcher.py", line 1831, in launch_mapdl       
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\licensing.py", line 191, in check
    lic_check.check()
    raise LicenseServerConnectionError("\n".join(self._license_file_msg))
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\licensing.py", line 191, in check
ansys.mapdl.core.errors.LicenseServerConnectionError: Exceeded 10 seconds while waiting for D:\temp\.ansys\licdebug.AAP7yAvfo5sR80r.FEAT_ANSYS.241.out to exist.
    raise LicenseServerConnectionError("\n".join(self._license_file_msg))
ansys.mapdl.core.errors.LicenseServerConnectionError: Exceeded 10 seconds while waiting for D:\temp\.ansys\licdebug.AAP7yAvfo5sR80r.FEAT_ANSYS.241.out to exist.
Exception in main loop
Traceback (most recent call last):
  File "c:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\ExperiencePlanManager.py", line 75, in run_parallel_in_mapdl_pool
    pool = MapdlPool(n_instances=n_instances, nproc=cores_per_instance, run_location=run_location, cleanup_on_exit=True, override=True, remove_temp_files=True, wait=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\pool.py", line 374, in __init__
    raise TimeoutError(
TimeoutError: Only 1 of 3 could be started.

Creating Pool:  33%|█████████████████████████████████▋                                                                   | 1/3 [01:18<02:36, 78.30s/it] 
Creating Pool:  67%|███████████████████████████████████████████████████████████████████▎                                 | 2/3 [00:25<00:11, 11.10s/it]Exception in thread Instance_0:
Traceback (most recent call last):
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\launcher.py", line 1808, in launch_mapdl       
    mapdl = MapdlGrpc(
            ^^^^^^^^^^
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 429, in __init__
    raise err  # Raise original error if we couldn't catch it in post-mortem analysis
    ^^^^^^^^^
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 421, in __init__
    self._multi_connect(timeout=timeout)
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 525, in _multi_connect    
    raise MapdlConnectionError(
ansys.mapdl.core.errors.MapdlConnectionError: Unable to connect to MAPDL gRPC instance at dns:///127.0.0.1:50055.
Reached either maximum amount of connection attempts (5) or timeout (45 s).The MAPDL process seems to be alive (PID: 35024) but PyMAPDL cannot connect to it.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\tletutou\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "C:\Users\tletutou\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\pool.py", line 907, in _spawn_mapdl
    self._instances[index] = launch_mapdl(
                             ^^^^^^^^^^^^^
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\launcher.py", line 1831, in launch_mapdl       
    lic_check.check()
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\licensing.py", line 191, in check
    raise LicenseServerConnectionError("\n".join(self._license_file_msg))
ansys.mapdl.core.errors.LicenseServerConnectionError: Exceeded 10 seconds while waiting for D:\temp\.ansys\licdebug.AAP7yAvfo5sR80r.FEAT_ANSYS.241.out to exist.
Exception in main loop
Traceback (most recent call last):
  File "c:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\ExperiencePlanManager.py", line 75, in run_parallel_in_mapdl_pool
    pool = MapdlPool(n_instances=n_instances, nproc=cores_per_instance, run_location=run_location, cleanup_on_exit=True, override=True, remove_temp_files=True, wait=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tletutou\OneDrive - ANSYS, Inc\issue_pool_mapdl\venv\Lib\site-packages\ansys\mapdl\core\pool.py", line 374, in __init__
    raise TimeoutError(
TimeoutError: Only 2 of 3 could be started.

****

tletutour-an avatar Oct 04 '24 14:10 tletutour-an