Skip to content

Adding debugging information #1660

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

Merged
merged 14 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ body:
id: new-bug
attributes:
label: Before submitting the issue
description: Please, make sure the following conditions are met
description: Ensure that the following conditions are met:
options:
- label: I have searched among the existing issues
- label: I have visited the [Troubleshooting section](https://mapdl.docs.pyansys.com/troubleshoot/index.html).
required: true
- label: I am using a Python virtual environment
- label: I have searched among the existing issues.
required: true
- label: I am using a Python virtual environment.
required: true
- label: I have a fully updated virtual environment (i.e. ``pip install --upgrade --upgrade-strategy eager ansys-mapdl-core``)
required: true
Expand Down Expand Up @@ -134,4 +136,28 @@ body:
</details>

validations:
required: true
required: true

- type: textarea
id: logger_log
attributes:
label: Logger output file
description: |
Attach the logger output file. For more information on how to set the logger and
attach its output file, see the [Troubleshooting section]
(https://mapdl.docs.pyansys.com/troubleshoot/index.html).

value: |
<details><summary>
Show the logger output file.
</summary>

```text

# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.

```
</details>

validations:
required: false
27 changes: 27 additions & 0 deletions doc/source/troubleshoot/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,33 @@ some of the most common problems and frequently asked questions are posted here.
faq


Debug in PyMAPDL
----------------

If you are having trouble with PyMAPDL, you can examine the content
of the output file to help to identify any issue.

You can set the logger output file to be ``mylog.log`` by
running the following commands in a Python terminal or at the beginning of your
script:

.. code:: python

from ansys.mapdl.core import LOG
LOG.setLevel("DEBUG")
LOG.log_to_file("mylog.log")

from ansys.mapdl.core import launch_mapdl

mapdl = launch_mapdl(loglevel="DEBUG")

You can attach this file to a bug report in the PyMAPDL GitHub repository for further investigation.
If you are not able to identify the issue, you can open a discussion on the
`PyMAPDL Discussions page <pymapdl_discussions_>`_.
If you believe you have found a bug, open an issue on the
`PyMAPDL Issues page <pymapdl_issues_>`_.



More help needed?
-----------------
Expand Down
3 changes: 3 additions & 0 deletions src/ansys/mapdl/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

_LOCAL_PORTS = []

LINUX_DEFAULT_DIRS = [["/", "usr", "ansys_inc"], ["/", "ansys_inc"]]
LINUX_DEFAULT_DIRS = [os.path.join(*each) for each in LINUX_DEFAULT_DIRS]

# Per contract with Sphinx-Gallery, this method must be available at top level
try:
from pyvista.utilities.sphinx_gallery import _get_sg_image_scraper
Expand Down
9 changes: 8 additions & 1 deletion src/ansys/mapdl/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,15 @@ def __init__(self, msg=""):
RuntimeError.__init__(self, msg)


class MapdlConnectionError(RuntimeError):
"""Provides the error when connecting to the MAPDL instance fails."""

def __init__(self, msg=""):
RuntimeError.__init__(self, msg)


class LicenseServerConnectionError(MapdlDidNotStart):
"""Error when the license server is not available."""
"""Provides the error when the license server is not available."""

def __init__(self, msg=""):
MapdlDidNotStart.__init__(self, msg)
Expand Down
Loading