ansys / ansys/pyfluent-parametric

Ansys CPython SSL: CERTIFICATE_VERIFY_FAILED error when downloading files from "examples"

Open
#139 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
29
Forks
6
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

Fluent build is 2023 R1 RC2 on Linux. Problem is reproducible in R22.2 too.

The following fails on Linux:

import_filename = examples.download_file(
"Static_M... ixer_main.cas.h5", "pyfluent/static_mixer"
)

```
################# LOG ###################
... ... ... ... ... ... '.. _ref_parametric_static_mixer_1:Parametric study workflow\n-------------------------This example shows how you can use the parametric study workflow to analyze a\nstatic mixer.
>>> >>> >>> /net/nfs.lebisilon/home/egravenh/PyFluent_222/.venv/lib/python3.7/site-packages/pandas/compat/__init__.py:124: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
warnings.warn(msg)
... ... Traceback (most recent call last):
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/urllib/request.py", line 1350, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/http/client.py", line 1281, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/http/client.py", line 1327, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/http/client.py", line 1276, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/http/client.py", line 1036, in _send_output
self.send(msg)
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/http/client.py", line 976, in send
self.connect()
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/http/client.py", line 1451, in connect
server_hostname=server_hostname)
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/ssl.py", line 423, in wrap_socket
session=session
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/ssl.py", line 870, in _create
self.do_handshake()
File "/net/lebqa02/fluent_testing/packages/wb-fluent/WB222_RC2/ansys_inc/v222/commonfiles/CPython/3_7/linx64/Release/python/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)
```

### 📝 Steps to reproduce

To reproduce:

1. setenv LD_LIBRARY_PATH /net/lebqa02/fluent_testing/packages/wb-fluent/WB231_RC2/ansys_inc/v231/commonfiles/CPython/3_7/linx64/Release/python/lib
2. setenv AWP_ROOT231 /net/lebqa02/fluent_testing/packages/wb-fluent/WB231_RC2/ansys_inc/v231/
3. setenv PYFLUENT_FLUENT_ROOT /net/lebqa02/fluent_testing/packages/wb-fluent/WB231_RC2/ansys_inc/v231/fluent/
4. setenv PYFLUENT_SHOW_SERVER_GUI 1
5. Create venv using Ansys CPython (e.g "/ansys_inc/v231/commonfiles/CPython/3_7/linx64/Release/python/bin/python3.7 -m venv .venv)
6. Install PyFluent and PyFluent Parametric using above venv:
.venv/bin/pip install ansys-fluent-core --pre
.venv/bin/pip install ansys-fluent-parametric --pre
9. Start Python using this venv: .venv/bin/python3.7
10. Enter the following:

from pathlib import Path
import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.parametric import ParametricProject, ParametricStudy
solver_session = pyfluent.launch_fluent(
precision="double", processor_count=2, mode="solver"
)
import_filename = examples.download_file(
"Static_Mixer_main.cas.h5", "pyfluent/static_mixer"
)

### 💻 Which operating system are you using?

Linux

### 🐍 Which Python version are you using?

3.7

### 📦 Installed packages

```shell
ansys-fluent-core --pre
ansys-fluent-parametric --pre
ansys-fluent-visualization --pre

ansys-fluent-core 0.12.dev14
ansys-fluent-parametric 0.6.dev1
ansys-fluent-visualization 0.6.dev4
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing examples.download_file("Static_Mixer_main.cas.h5", "pyfluent/static_mixer") in the documented Ansys CPython 3.7 Linux virtual environment and inspect the urllib.request and ssl traceback. Check how the download entry point obtains certificate authorities; done means the example file downloads successfully without disabling certificate verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.