Skip to content

Can`t connect to MAPDL processΒ #4311

@fakemade

Description

@fakemade

πŸ€“ Before submitting the issue

πŸ” Description of the bug

Hello everyone!
I have been using pymapdl for a long time. I have got some error recently. My python can`t connect to mapdl instance. I have tried follow things:

  1. Just launch MAPDL instance from simple code using "launch_mapdl" func
  2. Launch MAPDL using "launch_mapdl" func and change ips, ports, licenses. I changed every argument I could. Nothing changed.
  3. I tried launch mapdl instance from cmd like - "path\to\ansys" -grpc and connect to this instance from pycharm and from python which is started im cmd. Nothing changed.

Also i reinstall PyCharm, Python and Ansys and it doesn't help.
I don't know what i can do. I think i try everything and i don't know what to do.
it's strange, but command

launch_mapdl()

really start MAPDL instance, but can not connect to this instance

πŸ•΅οΈ Steps To Reproduce

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()

πŸ’» Which Operating System are you using?

Windows

🐍 Which Python version are you using?

3.12

πŸ’Ύ Which MAPDL version are you using?

2024R1

πŸ“ PyMAPDL Report

Show the Report!

PyAnsys Software and Environment Report
-------------------------------------------------------------------------------
  Date: Wed Nov 19 02:39:13 2025 UTC

                                 OS : Windows (10 10.0.19045 SP0 Multiprocessor Free)
                             CPU(s) : 20
                            Machine : AMD64
                       Architecture : 64bit
                                RAM : 47.8 GiB
                        Environment : Python
                         GPU Vendor : NVIDIA Corporation
                       GPU Renderer : NVIDIA GeForce RTX 4070/PCIe/SSE2
                        GPU Version : 4.5.0 NVIDIA 560.94

  Python 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64
  bit (AMD64)]

                   ansys.mapdl.core : 0.70.2
                              numpy : 2.2.6
                       platformdirs : 4.5.0
                              scipy : 1.16.3
                               grpc : 1.67.1
                 ansys.api.mapdl.v0 : Version unknown
                 ansys.mapdl.reader : 0.55.1
                    google.protobuf : 4.25.8
                    ansys-math-core : 0.2.4
                         matplotlib : 3.10.7
                            pyvista : 0.46.4
                             pyiges : 0.3.2
                               tqdm : 4.67.1
ansys-tools-visualization_interface : Module not found
                             pandas : 2.3.3
                 ansys_sphinx_theme : Module not found
                     ansys.acp.core : 0.2.1
               ansys.dpf.composites : 0.7.0
                     ansys.dpf.core : 0.14.1
                     ansys.dpf.post : 0.10.0
                  ansys.fluent.core : 0.34.1
         ansys.fluent.visualization : Module not found
            ansys.fluent.parametric : Module not found
                ansys.geometry.core : 0.11.0
                   ansys.hps.client : 0.10.1
                    ansys.math.core : 0.2.4
              ansys.mechanical.core : 0.11.30
                ansys.meshing.prime : 0.9.1
         ansys.modelcenter.workflow : 0.1.1
                ansys.motorcad.core : 0.7.4
               ansys.openapi.common : 2.3.2
               ansys.optislang.core : 1.0.0
  ansys.platform.instancemanagement : 1.1.2
               ansys.pyensight.core : 0.10.9
                   ansys.rocky.core : 0.3.2
                     ansys.seascape : 0.2.0
                   ansys.simai.core : 0.3.3
          ansys.systemcoupling.core : 0.10.1
               ansys.turbogrid.core : 0.4.6
                 ansys.tools.report : 0.9.0
             ansys.tools.versioning : 0.7.0
                             pyaedt : 0.18.1
                              pyedb : 0.54.0
                           pygranta : 2025.2.1
                             pytwin : 0.9.2
                            appdirs : 1.4.4
-------------------------------------------------------------------------------
Ansys Environment Report
-------------------------------------------------------------------------------


Ansys Installation
******************
No Ansys installations provided


Ansys Environment Variables
***************************
P_SCHEMA                       C:\Program Files\ANSYS Inc\v241\AISOL\CADIntegration\Parasolid\PSchema
AWP_LOCALE241                  en-us
ANSYSLMD_LICENSE_FILE          1055@localhost
ANSYSLIC_DIR                   C:\Program Files\ANSYS Inc\Shared Files\licensing
ANSYS241_DIR                   C:\Program Files\ANSYS Inc\v241\ANSYS
CADOE_LIBDIR241                C:\Program Files\ANSYS Inc\v241\CommonFiles\Language\en-us
AWP_ROOT241                    C:\Program Files\ANSYS Inc\v241

πŸ“ Installed packages

Show the installed packages!

# PASTE HERE THE OUTPUT OF `python -m pip freeze` here

πŸ“ Logger output file

Show the logger output file.

DEBUG - GRPC_127.0.0.1:50053 -  mapdl_core - __init__ - Logging set to DEBUG
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - __init__ - Creating channel to 127.0.0.1:50053
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _create_channel - Opening insecure channel at 127.0.0.1:50053
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - connectivity_callback - Channel connectivity changed to: ChannelConnectivity.IDLE
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - connectivity_callback - Channel connectivity changed to: ChannelConnectivity.CONNECTING
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _multi_connect - Connection attempt 1
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - connectivity_callback - Channel connectivity changed to: ChannelConnectivity.TRANSIENT_FAILURE
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _multi_connect - Connection attempt 2
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _multi_connect - Connection attempt 3
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _multi_connect - Connection attempt 4
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _multi_connect - Connection attempt 5
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _read_stds - Reading stdout
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _read_stds - Read stdout: []
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _read_stds - Reading stderr
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _read_stds - Read stderr: []
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _check_stds - MAPDL exited without stderr.
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - _check_stds - MAPDL exited without stdout.
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - __init__ - The error wasn't caught by the post-mortem checks.
DEBUG - GRPC_127.0.0.1:50053 -  mapdl_grpc - __init__ - []
ERROR - pymapdl_global -  launcher - launch_mapdl - An error occurred when connecting to MAPDL.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\PostgraduateSt\NN_Prog_Solver\NNTO_Python\.venv\Lib\site-packages\ansys\mapdl\core\launcher.py", line 1726, in launch_mapdl
    raise exception
  File "D:\PostgraduateSt\NN_Prog_Solver\NNTO_Python\.venv\Lib\site-packages\ansys\mapdl\core\launcher.py", line 1713, in launch_mapdl
    mapdl = MapdlGrpc(
            ^^^^^^^^^^
  File "D:\PostgraduateSt\NN_Prog_Solver\NNTO_Python\.venv\Lib\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 476, in __init__
    raise err  # Raise original error if we couldn't catch it in post-mortem analysis
    ^^^^^^^^^
  File "D:\PostgraduateSt\NN_Prog_Solver\NNTO_Python\.venv\Lib\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 468, in __init__
    self._multi_connect(timeout=timeout)
  File "D:\PostgraduateSt\NN_Prog_Solver\NNTO_Python\.venv\Lib\site-packages\ansys\mapdl\core\mapdl_grpc.py", line 615, in _multi_connect
    raise MapdlConnectionError(
ansys.mapdl.core.errors.MapdlConnectionError: Unable to connect to MAPDL gRPC instance at dns:///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: 43964) but PyMAPDL cannot connect to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue, problem or error in PyMAPDL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions