Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Raise an exception if license is inaccessible #3316

Closed
wants to merge 17 commits into from

Conversation

hpohekar
Copy link
Collaborator

@hpohekar hpohekar commented Sep 25, 2024

closes #3312

Raise an exception if Ansys license is not available.

>>> from ansys.fluent.core import launch_fluent
>>> solver = launch_fluent()
pyfluent.launcher ERROR: Exception caught - InaccessibleAnsysLicense: Ansys license is inaccessible.
Traceback (most recent call last):
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\standalone_launcher.py", line 259, in __call__
    session = self.new_session._create_from_server_info_file(
  File "D:\Repos\pyfluent\src\ansys\fluent\core\session.py", line 289, in _create_from_server_info_file
    fluent_connection = FluentConnection(
  File "D:\Repos\pyfluent\src\ansys\fluent\core\fluent_connection.py", line 385, in __init__
    self.health_check.check_health()
  File "D:\Repos\pyfluent\src\ansys\fluent\core\services\health_check.py", line 62, in check_health
    response = self._stub.Check(request, metadata=self._metadata)
  File "C:\Users\hpohekar\AppData\Local\Programs\Python\Python310\lib\site-packages\grpc\_interceptor.py", line 277, in __call__
    response, ignored_call = self._with_call(
  File "C:\Users\hpohekar\AppData\Local\Programs\Python\Python310\lib\site-packages\grpc\_interceptor.py", line 329, in _with_call
    call = self._interceptor.intercept_unary_unary(
  File "D:\Repos\pyfluent\src\ansys\fluent\core\services\interceptors.py", line 124, in intercept_unary_unary
    return self._intercept_call(continuation, client_call_details, request)
  File "D:\Repos\pyfluent\src\ansys\fluent\core\services\interceptors.py", line 113, in _intercept_call
    if not _license_error(ex):
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\error_handler.py", line 18, in _license_error
    raise InaccessibleAnsysLicense()
ansys.fluent.core.launcher.error_handler.InaccessibleAnsysLicense: Ansys license is inaccessible.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Repos\pyfluent\src\ansys\fluent\core\utils\deprecate.py", line 49, in wrapper
    return func(*args, **kwargs)
  File "D:\Repos\pyfluent\src\ansys\fluent\core\utils\deprecate.py", line 49, in wrapper
    return func(*args, **kwargs)
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\launcher.py", line 294, in launch_fluent
    return launcher()
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\standalone_launcher.py", line 300, in __call__
    raise LaunchFluentError(self._launch_cmd) from ex
ansys.fluent.core.launcher.error_handler.LaunchFluentError:
Fluent Launch string: start "" D:\ANSYSDev\vNNN\fluent\ntbin\win64\fluent.exe 3ddp -hidden -sifile=C:\Users\hpohekar\AppData\Local\Temp\serverinfo-aatujg6o.txt -nm
>>>

------------------------------------------------------------------------------------------

>>> from ansys.fluent.core import launch_fluent
>>> solver = launch_fluent(cwd=r"D:\Repos")
pyfluent.launcher ERROR: Exception caught - InaccessibleAnsysLicense: Ansys license is inaccessible.
Traceback (most recent call last):
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\standalone_launcher.py", line 259, in __call__
    session = self.new_session._create_from_server_info_file(
  File "D:\Repos\pyfluent\src\ansys\fluent\core\session.py", line 289, in _create_from_server_info_file
    fluent_connection = FluentConnection(
  File "D:\Repos\pyfluent\src\ansys\fluent\core\fluent_connection.py", line 385, in __init__
    self.health_check.check_health()
  File "D:\Repos\pyfluent\src\ansys\fluent\core\services\health_check.py", line 62, in check_health
    response = self._stub.Check(request, metadata=self._metadata)
  File "C:\Users\hpohekar\AppData\Local\Programs\Python\Python310\lib\site-packages\grpc\_interceptor.py", line 277, in __call__
    response, ignored_call = self._with_call(
  File "C:\Users\hpohekar\AppData\Local\Programs\Python\Python310\lib\site-packages\grpc\_interceptor.py", line 329, in _with_call
    call = self._interceptor.intercept_unary_unary(
  File "D:\Repos\pyfluent\src\ansys\fluent\core\services\interceptors.py", line 124, in intercept_unary_unary
    return self._intercept_call(continuation, client_call_details, request)
  File "D:\Repos\pyfluent\src\ansys\fluent\core\services\interceptors.py", line 113, in _intercept_call
    if not _license_error(ex):
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\error_handler.py", line 18, in _license_error
    raise InaccessibleAnsysLicense()
ansys.fluent.core.launcher.error_handler.InaccessibleAnsysLicense: Ansys license is inaccessible.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Repos\pyfluent\src\ansys\fluent\core\utils\deprecate.py", line 49, in wrapper
    return func(*args, **kwargs)
  File "D:\Repos\pyfluent\src\ansys\fluent\core\utils\deprecate.py", line 49, in wrapper
    return func(*args, **kwargs)
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\launcher.py", line 294, in launch_fluent
    return launcher()
  File "D:\Repos\pyfluent\src\ansys\fluent\core\launcher\standalone_launcher.py", line 300, in __call__
    raise LaunchFluentError(self._launch_cmd) from ex
ansys.fluent.core.launcher.error_handler.LaunchFluentError:
Fluent Launch string: start "" D:\ANSYSDev\vNNN\fluent\ntbin\win64\fluent.exe 3ddp -hidden -sifile=C:\Users\hpohekar\AppData\Local\Temp\serverinfo-aatujg6o.txt -nm
>>>

@mkundu1
Copy link
Contributor

mkundu1 commented Sep 26, 2024

@hpohekar Do we receive anything via transcript-streaming or errorevent in event-streaming? Licensing error would be a fatal error in server which should be automatically handled in the existing mechanism in pyfluent.

@hpohekar
Copy link
Collaborator Author

@hpohekar Do we receive anything via transcript-streaming or errorevent in event-streaming? Licensing error would be a fatal error in server which should be automatically handled in the existing mechanism in pyfluent.

I will investigate it and update you soon. Thank you.

@hpohekar
Copy link
Collaborator Author

@cj-hodgson We have discussed that handling this from the server side is better approach [T1141006].

@hpohekar hpohekar closed this Sep 30, 2024
@raj366v
Copy link

raj366v commented Oct 16, 2024

do we have solution for this..
also getting similar error while launching, only for 24R2.
for 24R1 working fine.
thanks in advance for any suggestions.

@hpohekar hpohekar reopened this Oct 21, 2024
@hpohekar
Copy link
Collaborator Author

do we have solution for this.. also getting similar error while launching, only for 24R2. for 24R1 working fine. thanks in advance for any suggestions.

Please refer Ansys documentation.

@raj366v
Copy link

raj366v commented Oct 21, 2024

do we have solution for this.. also getting similar error while launching, only for 24R2. for 24R1 working fine. thanks in advance for any suggestions.

Please refer Ansys documentation.

hi @hpohekar , can you please ping me how can i resolve it
already gone through the pyfluent docs not found any solution for this

@hpohekar hpohekar changed the title feat: License error handling feat: Raise appropriate exception if License is inaccessible Oct 21, 2024
@hpohekar hpohekar changed the title feat: Raise appropriate exception if License is inaccessible feat: Raise an exception if License is inaccessible Oct 21, 2024
@hpohekar hpohekar marked this pull request as draft October 21, 2024 13:10
@hpohekar hpohekar marked this pull request as ready for review October 22, 2024 08:00
@hpohekar hpohekar marked this pull request as draft October 22, 2024 08:00
@hpohekar hpohekar marked this pull request as ready for review October 22, 2024 10:17
@hpohekar hpohekar changed the title feat: Raise an exception if License is inaccessible feat: Raise an exception if license is inaccessible Oct 22, 2024
@hpohekar hpohekar closed this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output not helpful when no license is available
6 participants