ansys / pyfluent

Pythonic interface to Ansys Fluent
https://fluent.docs.pyansys.com
MIT License
253 stars 42 forks source link

Fluent session not connecting (NOT_SERVING) #1176

Closed mkvani closed 4 months ago

mkvani commented 1 year ago

πŸ” Before submitting the issue

🐞 Description of the bug

I am trying to launch Fluent session. But the session is not connecting. If I "check_health()", it says "NOT_SERVING".

Following is the script:

****

import ansys.fluent.core as pyfluent pyfluent.set_ansys_version(version= '23.1') session = pyfluent.launch_fluent(show_gui=True) session.check_health()

***

However, if I try to set REMOTING_SERVER_ADDRESS as local host, then it works well.

***

import os import ansys.fluent.core as pyfluent

os.environ["REMOTING_SERVER_ADDRESS"] = "localhost"

pyfluent.set_ansys_version(version= '23.1') session = pyfluent.launch_fluent(show_gui=True) session.check_health()

***

There is an old issue similar to this (#19). That issue is closed.

Best regards, Manoj

πŸ“ Steps to reproduce

Run following script:

import ansys.fluent.core as pyfluent pyfluent.set_ansys_version(version= '23.1') session = pyfluent.launch_fluent(show_gui=True) session.check_health()

πŸ’» Which operating system are you using?

Windows

🐍 Which Python version are you using?

3.7

πŸ“¦ Installed packages

aiohttp==3.8.3
aiosignal==1.3.1
ansys-api-fluent==0.3.5
ansys-api-platform-instancemanagement==1.0.0b3
ansys-fluent-core==0.11.0
ansys-fluent-visualization==0.5.0
ansys-platform-instancemanagement==1.0.2
anyio==3.6.2
appdirs==1.4.4
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
async-timeout==4.0.2
asynctest==0.13.0
attrs==22.1.0
backcall==0.2.0
beautifulsoup4==4.11.1
bleach==5.0.1
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==2.1.1
colorama==0.4.6
cycler==0.11.0
debugpy==1.6.4
decorator==5.1.1
defusedxml==0.7.1
entrypoints==0.4
fastjsonschema==2.16.2
fonttools==4.38.0
frozenlist==1.3.3
googleapis-common-protos==1.56.4
grpcio==1.51.1
h5py==3.7.0
idna==3.4
imageio==2.22.4
importlib-metadata==4.13.0
importlib-resources==5.10.1
ipycanvas==0.13.1
ipyevents==2.0.1
ipykernel==6.16.2
ipython==7.34.0
ipython-genutils==0.2.0
ipyvtklink==0.2.3
ipywidgets==7.7.2
jedi==0.18.2
Jinja2==3.1.2
jsonschema==4.17.3
jupyter-server==1.23.3
jupyter_client==7.4.8
jupyter_core==4.12.0
jupyterlab-pygments==0.2.2
jupyterlab-widgets==1.1.1
kiwisolver==1.4.4
MarkupSafe==2.1.1
matplotlib==3.5.3
matplotlib-inline==0.1.6
mistune==2.0.4
multidict==6.0.3
nbclassic==0.4.8
nbclient==0.7.2
nbconvert==7.2.6
nbformat==5.7.0
nest-asyncio==1.5.6
notebook==6.5.2
notebook_shim==0.2.2
numpy==1.21.6
packaging==22.0
pandas==1.3.5
pandocfilters==1.5.0
parso==0.8.3
pickleshare==0.7.5
Pillow==9.3.0
pkgutil_resolve_name==1.3.10
pooch==1.6.0
prometheus-client==0.15.0
prompt-toolkit==3.0.36
protobuf==3.20.1
protoc-gen-swagger==0.1.0
psutil==5.9.4
pycparser==2.21
pydantic==1.10.2
Pygments==2.13.0
pyparsing==3.0.9
pyrsistent==0.19.2
PySide6==6.4.1
PySide6-Addons==6.4.1
PySide6-Essentials==6.4.1
python-dateutil==2.8.2
pytz==2022.6
pyvista==0.37.0
pyvistaqt==0.9.0
pywin32==305
pywinpty==2.0.9
pyzmq==24.0.1
QtPy==2.3.0
requests==2.28.1
scooby==0.7.0
Send2Trash==1.8.0
shiboken6==6.4.1
six==1.16.0
sniffio==1.3.0
soupsieve==2.3.2.post1
terminado==0.17.1
tinycss2==1.2.1
tornado==6.2
traitlets==5.6.0
typing_extensions==4.4.0
urllib3==1.26.13
vtk==9.2.2
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.4.2
widgetsnbextension==3.6.1
wslink==1.9.1
yarl==1.8.2
zipp==3.11.0
seanpearsonuk commented 1 year ago

@mkvani do you have colleagues in the same office who can run without this workaround? Are you able to debug together. We are not able to reproduce this issue?

dnwillia-work commented 1 year ago

I wonder if it's the defaulting to 127.0.0.1 and a misconfiguration of the loopback adapter on the local customer machine?

https://github.com/pyansys/pyfluent/blob/7fa8f6c196e40b36a722b4123fa3e11f77fca450/src/ansys/fluent/core/fluent_connection.py#L148

Maybe we should try localhost as well if 127.0.0.1 does not work out? Or see what name 127.0.0.1 resolves to, if anything, before using it.

mkundu1 commented 1 year ago

@mkvani Just to understand whether this is Fluent server-side issue, are you able to launch Remote Visualization Client from Fluent (File β†’ Applications β†’ Visualization Client) without the REMOTING_SERVER_ADDRESS setting.?

mkundu1 commented 1 year ago

I can reproduce the issue in ansys VPN environment. It is not possible to fix this by forcing the ip to "localhost"/"127.0.0.1"/public ip of the VPN in pyfluent code (there is an issue in the pyfluent code that it doesn't respect PYFLUENT_FLUENT_IP even when ip is not explicitly passed - but I've forced the channel ip within the code). Setting the REMOTING_SERVER_ADDRESS only works for me.

mkvani commented 1 year ago

Hi @mkundu1 and @dnwillia-work , I am still facing this issue. I am getting following exception:

"The connection to the Fluent server could not be established within the configurable 100 second time limit."

Strangely, the problem is with meshing mode only. When I launch in solver mode, it works fine.

I am using: ansys-fluent-core = {version = "^0.12.3"}

mkundu1 commented 1 year ago

@mkvani the fix will be available in version 0.13 (which will be released in a few days). Meanwhile can you please try it in the latest dev release?

mkundu1 commented 4 months ago

This was fixed few releases back, feel free to revert is the issue is still seen.