ansys / pyworkbench

PyWorkbench
http://workbench.docs.pyansys.com/
MIT License
2 stars 1 forks source link

Protobuf issues with running scripts #93

Closed a-abir closed 3 months ago

a-abir commented 3 months ago

πŸ” Before submitting the issue

🐞 Description of the bug

Unable to run scripts or start fluent or mechanical server.

ERROR:grpc._common:Exception deserializing message! Traceback (most recent call last): File "c:\Users\USER\Documents\Ansys\Lib\site-packages\grpc_common.py", line 89, in _transform return transformer(message) ^^^^^^^^^^^^^^^^^^^^ google.protobuf.message.DecodeError: Error parsing message

{ "name": "_MultiThreadedRendezvous", "message": "<_MultiThreadedRendezvous of RPC that terminated with: \tstatus = StatusCode.INTERNAL \tdetails = \"Exception deserializing response!\" \tdebug_error_string = \"None\"

", "stack": "--------------------------------------------------------------------------- _MultiThreadedRendezvous Traceback (most recent call last) Cell In[3], line 4 2 from ansys.workbench.core import connect_workbench 3 wb = connect_workbench(port=64634) ----> 4 server_info_file=wb.start_fluent_server(system_name=\"FFF\")

File c:\Users\User\Documents\Ansys\Lib\site-packages\ansys\workbench\core\workbench_client.py:484, in WorkbenchClient.start_fluent_server(self, system_name) 461 def start_fluent_server(self, system_name): 462 \"\"\"Start the PyFluent server for the given system in the Workbench project. 463 464 Parameters (...) 482 483 \"\"\" --> 484 server_info_file_name = self.run_script_string( 485 f\"\"\"import json 486 server_info_file=LaunchFluentServerOnSystem(SystemName=\"{system_name}\") 487 wb_script_result=json.dumps(server_info_file) 488 \"\"\" 489 ) 490 local_copy = os.path.join(self.workdir, server_info_file_name) 491 if os.path.exists(local_copy):

File c:\Users\User\Documents\Ansys\Lib\site-packages\ansys\workbench\core\workbench_client.py:168, in WorkbenchClient.run_script_string(self, script_string, log_level) 164 logging.error(\"Workbench client is not yet connected to a server.\") 165 request = wb.RunScriptRequest( 166 content=script_string, log_level=WorkbenchClient.__to_server_log_level(log_level) 167 ) --> 168 for response in self.stub.RunScript(request): 169 if response.log and response.log.messages and len(response.log.messages) > 0: 170 for log_entry in response.log.messages:

File c:\Users\User\Documents\Ansys\Lib\site-packages\grpc\_channel.py:543, in _Rendezvous.next(self) 542 def next(self): --> 543 return self._next()

File c:\Users\User\Documents\Ansys\Lib\site-packages\grpc\_channel.py:969, in _MultiThreadedRendezvous._next(self) 967 raise StopIteration() 968 elif self._state.code is not None: --> 969 raise self

_MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with: \tstatus = StatusCode.INTERNAL \tdetails = \"Exception deserializing response!\" \tdebug_error_string = \"None\"

" }

πŸ“ Steps to reproduce

Basic connection to the Workbench server followed by trying to run any script by string, script by file or starting server.

import ansys.fluent.core as pyfluent from ansys.workbench.core import connect_workbench wb = connect_workbench(port=64634) server_info_file=wb.start_fluent_server(system_name="FFF")

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

Ansys 2023 R2 v232

🐍 Which Python version are you using?

3.11

πŸ“¦ Installed packages

about-time==4.2.1
alive-progress==3.1.5
ansys-api-fluent==0.3.24
ansys-api-mechanical==0.1.2
ansys-api-platform-instancemanagement==1.1.0
ansys-api-workbench==0.2.0
ansys-fluent-core==0.20.1
ansys-mechanical-core==0.10.11
ansys-mechanical-env==0.1.6
ansys-platform-instancemanagement==1.1.2
ansys-pythonnet==3.1.0rc3
ansys-tools-path==0.6.0
ansys-units==0.3.2
ansys-workbench-core==0.4.0
appdirs==1.4.4
asttokens==2.4.1
beartype==0.17.2
certifi==2024.6.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
clr-loader==0.2.6
colorama==0.4.6
comm==0.2.2
debugpy==1.8.1
decorator==5.1.1
docker==6.1.3
executing==2.0.1
grapheme==0.6.0
grpcio==1.64.1
grpcio-health-checking==1.62.2
idna==3.7
importlib_metadata==7.1.0
ipykernel==6.29.4
ipython==8.25.0
jedi==0.19.1
jupyter_client==8.6.2
jupyter_core==5.7.2
lxml==4.9.4
matplotlib-inline==0.1.7
nest-asyncio==1.6.0
numpy==1.26.4
packaging==24.1
pandas==1.5.3
parso==0.8.4
platformdirs==3.11.0
prompt_toolkit==3.0.47
protobuf==4.25.3
psutil==5.9.8
pure-eval==0.2.2
pycparser==2.22
Pygments==2.18.0
python-dateutil==2.9.0.post0
pytz==2024.1
pywin32==306
PyYAML==6.0.1
pyzmq==26.0.3
requests==2.32.3
six==1.16.0
stack-data==0.6.3
tornado==6.4.1
tqdm==4.66.4
traitlets==5.14.3
typing_extensions==4.12.2
urllib3==2.2.2
wcwidth==0.2.13
websocket-client==1.8.0
WMI==1.5.1
zipp==3.19.2
franknli commented 3 months ago

@a-abir I see that you are running with release 23.2. Can you try using a later release such as 24.2?

a-abir commented 3 months ago

@franknli I was waiting on access to 24.1 and after running the same setup, it seems to not have either of the issues I've raised (#92 #93). Seems to be a version specific issue.

franknli commented 3 months ago

@a-abir Right - release 23.2 does not contain all functions of WB gRPC service. So the error you saw is not a surprise. I am closing this issue. Thanks!

a-abir commented 3 months ago

Please put that disclaimer of required version and issues on the readmes if not already on there.