ansys / ansys/pyworkbench-examples
Bug located in "Integrating PyFluent with PyWorkbench": wb.start_fluent_server, fails to start fluent server
- Dominant language
- No language data
- Stars
- 4
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
### 🔍 Before submitting the issue
- [x] I have searched among the existing issues
- [x] I am using a Python virtual environment
### 🐞 Description of the bug
Executing the example: Ansys Fluent workflow as presented in the documentation fails to run to completion.
Execution halts at step "Launch Fluent & Connect to Fluent" with a seemingly failure to by _pyfluent.connect_to_fluent_ method, however it seems that the issue is with _wb.start_fluent_server_ where a server fails to start altogether despite a _server_info_file_ being generated correctly.
Exception thrown by _pyfluent.connect_to_fluent_:
```
Exception has occurred: RuntimeError
failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.68.73:57548: socket is null
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.68.73:57548: socket is null"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.68.73:57548: socket is null", grpc_status:14, created_time:"2024-11-14T15:12:50.3409939+00:00"}"
>
During handling of the above exception, another exception occurred:
File "D:\Testing\pyWorkbench\pyworkbench-examples\examples\pyfluent-workflow\main.py", line 54, in
fluent_session = pyfluent.connect_to_fluent(server_info_file_name=server_info_file)
RuntimeError: failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.68.73:57548: socket is null
```
Further more, while trying to start a fluent web server manually in the app launched by main.py, web server parameters where disabled:

However these parameters are enabled if launching fluent as a standalone:

### 📝 Steps to reproduce
1. Clone pyworkbench-examples.
2. Create virtual environment using provided cpython in ansys installation: "$ANSYS_PATH"+"v251"+"\commonfiles\CPython\3_10\winx64\Release\python\python.exe"
3. Install required packages:
`python -m pip ansys-workbench-core ansys-fluent-core`
4. Execute $[..]/pyworkbench-examples/examples/pyfluent-workflow/main.py
### 💻 Which operating system are you using?
Windows
### 📀 Which ANSYS version are you using?
Fluent: Build Time: Oct 30 2024 02:44:03 EST Build Id: 203 Revision: 5ab3dd04f9 Branch: releases/release-25.1
Workbench: 2025R1 File Date: Wednesday, October 30, 2024 2:07:43 PM, File Version: 25.1.0.0
Unified Package Name: 2024-10-31 01:13 P00
### 🐍 Which Python version are you using?
3.10
### 📦 Installed packages
```shell
about-time==4.2.1
alive-progress==3.2.0
ansys-api-fluent==0.3.28
ansys-api-platform-instancemanagement==1.1.0
ansys-api-tools-filetransfer==0.1.1
ansys-api-workbench==0.2.0
ansys-fluent-core==0.26.1
ansys-platform-instancemanagement==1.1.2
ansys-pythonnet==3.1.0rc4
ansys-tools-filetransfer==0.1.0
ansys-tools-path==0.7.0
ansys-units==0.3.2
ansys-workbench-core==0.7.0
asttokens==2.4.1
beartype==0.19.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
click==8.1.7
clr-loader==0.2.6
colorama==0.4.6
comm==0.2.2
debugpy==1.8.8
decorator==5.1.1
docker==7.1.0
exceptiongroup==1.2.2
executing==2.1.0
grapheme==0.6.0
grpcio==1.67.1
grpcio-health-checking==1.62.3
idna==3.10
importlib_metadata==8.5.0
ipykernel==6.29.5
ipython==8.29.0
jedi==0.19.2
joblib==1.4.2
jupyter_client==8.6.3
jupyter_core==5.7.2
lxml==5.3.0
matplotlib-inline==0.1.7
nest-asyncio==1.6.0
nltk==3.9.1
numpy==1.26.4
packaging==24.2
pandas==2.2.3
parso==0.8.4
platformdirs==4.3.6
prompt_toolkit==3.0.48
protobuf==4.25.5
psutil==6.1.0
pure_eval==0.2.3
pycparser==2.22
Pygments==2.18.0
python-dateutil==2.9.0.post0
pytz==2024.2
pywin32==308
PyYAML==6.0.2
pyzmq==26.2.0
regex==2024.11.6
requests==2.32.3
six==1.16.0
stack-data==0.6.3
tornado==6.4.1
tqdm==4.67.0
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.2.3
wcwidth==0.2.13
WMI==1.5.1
zipp==3.21.0
```
Contributor guide
Research direction
Run examples/pyfluent-workflow/main.py using the documented Windows setup and inspect the wb.start_fluent_server and pyfluent.connect_to_fluent steps around the generated server_info_file. Compare the failing connection and disabled web-server parameters with the standalone Fluent launch; done means the example runs to completion and connects successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100