Skip to content

Getting OpenSSL error: failed to load certificates: error:00000000:lib(0):func(0):reason(0) #7498

@abhishekPurandare-obs

Description

@abhishekPurandare-obs

I have installed DVC using
pip install dvc[s3] boto3

I was able to use CLI, and did some basic pulling and pushing on my datasets. However, when I wanted to use the Python API. I have been getting some SSL certificates not found errors from pygit.

Code

import dvc.api

resource_url = dvc.api.get_url(
    path="dataset",
    repo="https://github.com/abhishekPurandare-obs/mlops.git",
    rev="d2.0_c1.0"
)

print(resource_url)

Output

Traceback (most recent call last):                                                                                     
  File "test.py", line 3, in <module>
    resource_url = dvc.api.get_url(
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/api.py", line 21, in get_url
    with Repo.open(repo, rev=rev, subrepos=True, uninitialized=True) as _repo:
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/external_repo.py", line 72, in external_repo
    repo = Repo(**repo_kwargs)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/repo/__init__.py", line 176, in __init__
    self.root_dir, self.dvc_dir, self.tmp_dir = self._get_repo_dirs(
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/repo/__init__.py", line 95, in _get_repo_dirs
    root_dir = self.find_root(root_dir, fs)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/repo/__init__.py", line 321, in find_root
    if not fs.isdir(root_dir):
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/fs/fsspec_wrapper.py", line 53, in isdir
    return self.fs.isdir(path)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/funcy/objects.py", line 50, in __get__
    return prop.__get__(instance, type)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/funcy/objects.py", line 28, in __get__
    res = instance.__dict__[self.fget.__name__] = self.fget(instance)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/fs/git.py", line 48, in fs
    return FsspecGitFileSystem(**self.fs_args)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/fsspec/spec.py", line 68, in __call__
    obj = super().__call__(*args, **kwargs)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/scmrepo/fs.py", line 53, in __init__
    resolved = resolver(scm, rev or "HEAD")
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/dvc/scm.py", line 117, in resolve_rev
    return scm.resolve_rev(fix_exp_head(scm, rev))
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/scmrepo/git/__init__.py", line 250, in _backend_func
    for backend in self.backends.values():
  File "/usr/lib/python3.8/_collections_abc.py", line 762, in __iter__
    yield self._mapping[key]
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/scmrepo/git/__init__.py", line 45, in __getitem__
    initialized = backend(*self.args, **self.kwargs)
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/scmrepo/git/backend/pygit2.py", line 77, in __init__
    import pygit2
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/pygit2/__init__.py", line 230, in <module>
    settings = Settings()
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/pygit2/settings.py", line 55, in __init__
    self._initialize_tls_certificate_locations()
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/pygit2/settings.py", line 61, in _initialize_tls_certificate_locations
    self.set_ssl_cert_locations(
  File "/home/laptop-obs-65/venvs/mlops/lib/python3.8/site-packages/pygit2/settings.py", line 191, in set_ssl_cert_locations
    option(_pygit2.GIT_OPT_SET_SSL_CERT_LOCATIONS, cert_file, cert_dir)
_pygit2.GitError: OpenSSL error: failed to load certificates: error:00000000:lib(0):func(0):reason(0)

dvc doctor

(mlops) laptop-obs-65@Laptop-OBS-65:~/Projects/mlops$ dvc doctor
DVC version: 2.9.5 (pip)
---------------------------------
Platform: Python 3.8.10 on Linux-5.13.0-35-generic-x86_64-with-glibc2.29
Supports:
        webhdfs (fsspec = 2022.2.0),
        http (aiohttp = 3.8.1, aiohttp-retry = 2.4.6),
        https (aiohttp = 3.8.1, aiohttp-retry = 2.4.6),
        s3 (s3fs = 2022.2.0, boto3 = 1.21.25)
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/sda2
Caches: local
Remotes: s3
Workspace directory: ext4 on /dev/sda2
Repo: dvc, git

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responsewe are waiting for your reply, please respond! :)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions