DLR-RM / BlenderProc

A procedural Blender pipeline for photorealistic training image generation
GNU General Public License v3.0
2.76k stars 445 forks source link

SSL certificate verification error #1094

Open m-ali-awan opened 4 months ago

m-ali-awan commented 4 months ago

Describe the issue

on running quickstart script getting following error:


muhammadali@MacBook-Pro BlenderProc % /Applications/Blender\ 2.app/Contents/Resources/4.0/python/bin/python3.10 blenderproc quickstart
Warning: Changed install path from /home_local/muhammadali... to /Users/muhammadali..., there is no /home_local/ on this machine.
Downloading blender from https://download.blender.org/release/Blender3.5/blender-3.5.1-macos-arm64.dmg
Traceback (most recent call last):
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/http/client.py", line 1455, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/ssl.py", line 1104, in _create
    self.do_handshake()
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/ssl.py", line 1375, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/muhammadali/D/ClientsWork/MisterWhisper/BlenderWork/Addons/BlenderProc/blenderproc/__main__.py", line 11, in <module>
    cli()
  File "/Users/muhammadali/D/ClientsWork/MisterWhisper/BlenderWork/Addons/BlenderProc/blenderproc/command_line.py", line 136, in cli
    blender_run_path, major_version = InstallUtility.make_sure_blender_is_installed(custom_blender_path,
  File "/Users/muhammadali/D/ClientsWork/MisterWhisper/BlenderWork/Addons/BlenderProc/blenderproc/python/utility/InstallUtility.py", line 174, in make_sure_blender_is_installed
    raise e
  File "/Users/muhammadali/D/ClientsWork/MisterWhisper/BlenderWork/Addons/BlenderProc/blenderproc/python/utility/InstallUtility.py", line 158, in make_sure_blender_is_installed
    file_tmp = urlretrieve(url, None, DownloadProgressBar())[0]
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/Applications/Blender 2.app/Contents/Resources/4.0/python/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:1007)>

I am on MacOS...

Minimal code example

# I am just running script from blender python executable

Files required to run the code

No response

Expected behavior

have pasted error above

BlenderProc version

Github Main branch

cornerfarmer commented 4 months ago

Hey @m-ali-awan

this error seems to be specific to your system. Apparently your certificates are missing. Have you tried this: https://stackoverflow.com/questions/68275857/urllib-error-urlerror-urlopen-error-ssl-certificate-verify-failed-certifica ?

m-ali-awan commented 4 months ago

Thanks @cornerfarmer for helping me..

You are right.. I am able to solve it by specifically adding path to environment variable

export SSL_CERT_FILE=/path/to/cacert.pem

Maybe I am having multiple versions of blenders and that is messing up.. But, certificates were installed already..