Commit e06e0e0
feat: Log from container when health-check fails (#4599)
## Context
When the initial health checks fails while launching Fluent, that
usually means Fluent has encountered an error during the startup. The
Fluent error is recorded in the Fluent transcript which cannot be
accessed easily if we are running on a remote machine (like github
runner).
## Change Summary
If we are launching a Fluent container, the Fluent transcript is also
copied to the container log. In this PR, the container error log is also
logged in PyFluent when the initial health checks fails. Following is an
example of pyfluent session when a wrong license server is set:
```
(.venv) mkundu@AAPAomeLhXO1rdt:~/devel/pyfluent$ export ANSYSLMD_LICENSE_FILE=1055@XYZ
(.venv) mkundu@AAPAomeLhXO1rdt:~/devel/pyfluent$ python
Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ansys.fluent.core as pyfluent
>>> solver = pyfluent.launch_fluent(start_container=True)
pyfluent.launcher WARNING: Configuring Fluent container to mount to /home/mkundu/devel/pyfluent, with this path available as /home/container/workdir for the Fluent session running inside the container.
pyfluent.general ERROR: Error reported from Fluent:
pyfluent.general ERROR:
Unexpected license problem; exiting.
==============================================================================
Stack backtrace generated for process id 163 on signal 11 :
1000000: fluent() [0x924a30]
1000000: /lib64/libc.so.6(+0x4e5b0) [0x7f4b464915b0]
<... more Fluent error lines ...>
==============================================================================
Stack backtrace generated for process id 163 on signal 6 :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mkundu/devel/pyfluent/src/ansys/fluent/core/utils/deprecate.py", line 136, in wrapper
return deprecated_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<... more PyFluent error lines ...>
File "/home/mkundu/devel/pyfluent/src/ansys/fluent/core/services/interceptors.py", line 164, in _intercept_call
raise new_ex from None
RuntimeError: Deadline Exceeded
>>>
```
## Rationale
For Fluent containers, we know the container id, so we can get the log.
However, there is no good solution for standalone Fluent case as the
transcript file name cannot be deterministically inferred from PyFluent.
## Impact
This came up while triaging a container launch failure in a remote
machine and will help such triaging in future.
---------
Co-authored-by: Copilot <[email protected]>
Co-authored-by: pyansys-ci-bot <[email protected]>1 parent c23cfd0 commit e06e0e0
File tree
2 files changed
+10
-1
lines changed- doc/changelog.d
- src/ansys/fluent/core
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
455 | 463 | | |
456 | 464 | | |
457 | 465 | | |
| |||
0 commit comments