Getting OpenSSL error: failed to load certificates: error:00000000:lib(0):func(0):reason(0)
See original GitHub issueI 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
Issue Analytics
- State:
- Created a year ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
GitHub Desktop / Git Shell: SSL read: error:00000000:lib(0)
I have got an SSL read: error.... (identical to yours) returned as well when I was trying to push a commit. The reason...
Read more >K46853274: curl: (56) SSL read: error:00000000:lib(0)
Cause Connection failure either to the BIG-IP Virtual Server or an issue to the pool member. This could be related to an SSL...
Read more >E-REN: REN Server Fails to Start after Configuring SSL. REN ...
REN Server Log shows "error loading CA certificates - error:00000000:lib(0):func(0):reason(0))" (Doc ID 1623097.1).
Read more >Collector Failed to Accept SSL Connect from Client, ...
The ssl certificate present of the firewall got expired which may cause ... 10.1.1.1), SSL error: error:00000000:lib(0):func(0):reason(0)(0)
Read more >KB440877: “SSL accept error : error:00000000:lib(0):func(0 ...
KB440877: “SSL accept error : error:00000000:lib(0):func(0):reason(0) ” error appears in the DSSErrors.log while the SSL authentication works ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just reinstalled
dvc[s3]==2.1.0and now the error is gone.@abhishekPurandare-obs, do you have
SSL_CERT_DIRorSSL_CERT_FILEenvironment variables set?