"MapdlConnectionError" when runnung PyMAPDL

Hi Team,
I have a PyMAPDL script. When I run the script I get frequently the following error:
"
Error using mapdl_grpc>_multi_connect
Python Error: MapdlConnectionError: Unable to connect to MAPDL gRPC instance at 127.0.0.1:50053.
Reached either maximum amount of connection attempts (5) or timeout (45 s).The MAPDL process seems to be alive (PID: 24408) but PyMAPDL cannot connect to
it.
Error in mapdl_grpc>init (line 387)
Error in mapdl_grpc>init (line 395)
Error in launcher>launch_mapdl (line 1972)
Error in launcher>launch_mapdl (line 1993)
Error in ModalSensitivity>launch_mapdl (line 275)
Error in ModalSensitivity>perform_modal_sensitivity (line 78)
"
Immediately if I run the script again it runs smoothly without any issues. This error I get often like appx. once every 3-4 runs.
Please guide us in resolving the issue.
Comments
-
Any suggestion on this? As I have posted this long back and didn't receive any response yet!
0 -
Hi
It seems to me that the launcher is taking longer to start the MAPDL instance.
I would try to increase
start_timeout
:mapdl = launch_mapdl(start_timeout=80)
0 -
@German Martinez , I am getting this error as well as sometimes the connection is made, but then it has a connection error like this after connection. This seems somewhat random in nature.
I am also trying to run PyMAPDL on an async thread with the threading module. Any ideas?
It also seems odd that the connection to MAPDL would take longer than 45s. Why might this be?ansys.mapdl.core.errors.MapdlExitedError: MAPDL server connection terminated
0 -
@Pernelle Marone-Hitz , do you have any idea on this? I am still having this issue seemingly randomly. it typically connects either very quickly, or not at all. Adding time to the time out I expect will have the same outcome as seen by other users to only delay the time I need to wait to get the error.
0 -
@Mike.Thompson This should be reported as a bug in the PyMAPDL repo. @German Martinez could you have a look at this please? Many thanks
0