Skip to content

test error: No SSL certificates found #3508

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

Closed
mtelka opened this issue Feb 11, 2025 · 5 comments
Closed

test error: No SSL certificates found #3508

mtelka opened this issue Feb 11, 2025 · 5 comments
Assignees

Comments

@mtelka
Copy link

mtelka commented Feb 11, 2025

I'm trying to run tests for version 5.2.1 with -m "not ssl" and I'm getting this error:

_____________ ERROR collecting tests/test_asyncio/test_cluster.py ______________
tests/test_asyncio/test_cluster.py:2888: in <module>
    class TestSSL:
tests/test_asyncio/test_cluster.py:2896: in TestSSL
    CLIENT_CERT, CLIENT_KEY, CA_CERT = get_tls_certificates("cluster")
tests/ssl_utils.py:30: in get_tls_certificates
    raise OSError(f"No SSL certificates found. They should be in {cert_dir}")
E   OSError: No SSL certificates found. They should be in $(BUILD_DIR)/build/dockers/cluster/tls
@vladvildanov
Copy link
Collaborator

Hi! Are you running all tests or just cluster one? I'm trying to reproduce the issue, but it looks like tests with ssl mark is skipped correctly

pytest -m "not ssl" tests/test_asyncio/test_cluster.py::TestSSL

================= 11 deselected in 0.02s =====================

@mtelka
Copy link
Author

mtelka commented Feb 17, 2025

I do see this (please find the pip freeze output below):

$ wget https://github.com/redis/redis-py/archive/refs/tags/v5.2.1.tar.gz
$ gtar xf v5.2.1.tar.gz
$ cd redis-py-5.2.1/
$ env - PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTEST_PLUGINS="asyncio,pytest_cov,timeout" pytest -m "not ssl" tests/test_asyncio/test_cluster.py::TestSSL
/usr/lib/python3.9/vendor-packages/pytest_asyncio/plugin.py:207: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
============================= test session starts ==============================
platform sunos5 -- Python 3.9.21, pytest-8.3.3, pluggy-1.5.0
rootdir: /tmp/redis/redis-py-5.2.1
configfile: pytest.ini
plugins: asyncio-0.25.2, cov-6.0.0, timeout-2.3.1
asyncio: mode=auto, asyncio_default_fixture_loop_scope=None
timeout: 30.0s
timeout method: signal
timeout func_only: False
collected 0 items / 1 error                                                    

==================================== ERRORS ====================================
_____________ ERROR collecting tests/test_asyncio/test_cluster.py ______________
tests/test_asyncio/test_cluster.py:2888: in <module>
    class TestSSL:
tests/test_asyncio/test_cluster.py:2896: in TestSSL
    CLIENT_CERT, CLIENT_KEY, CA_CERT = get_tls_certificates("cluster")
tests/ssl_utils.py:30: in get_tls_certificates
    raise OSError(f"No SSL certificates found. They should be in {cert_dir}")
E   OSError: No SSL certificates found. They should be in /tmp/redis/dockers/cluster/tls
=========================== short test summary info ============================
ERROR tests/test_asyncio/test_cluster.py - OSError: No SSL certificates found. They should be in /tmp/redis/dockers/cl...
=============================== 1 error in 0.13s ===============================
ERROR: found no collectors for /tmp/redis/redis-py-5.2.1/tests/test_asyncio/test_cluster.py::TestSSL

$
pip freeze
aiohappyeyeballs==2.4.6
aiohttp==3.11.9
aiosignal==1.3.2
alabaster==1.0.0
aniso8601==10.0.0
annotated-types==0.7.0
ansi2html==1.9.2
ansible==8.7.0
ansible-core==2.15.12
anyio==4.2.0
apeye==1.4.1
apeye-core==1.1.5
appdirs==1.4.4
argcomplete==3.5.1
argh==0.31.3
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
asgiref==3.8.1
asn1crypto==1.5.1
assertpy==1.1
astor==0.8.1
astroid==3.3.8
asttokens==3.0.0
async-generator==1.10
async-timeout==5.0.1
atomicwrites==1.4.1
attrs==25.1.0
autocommand==2.2.2
Automat==24.8.1
autopage==0.5.2
autopep8==2.3.2
babel==2.17.0
backcall==0.2.0
backports.entry-points-selectable==1.3.0
backports.tarfile==1.2.0
barman==3.12.1
bcrypt==4.2.1
beautifulsoup4==4.13.3
betamax==0.9.0
black==25.1.0
bleach==6.2.0
blessings==1.7
blinker==1.9.0
borgbackup==1.4.0
bottle==0.13.2
bracex==2.5.post1
Brotli==1.1.0
brotlicffi==1.1.0.0
BTrees==6.1
build==1.2.2.post1
CacheControl==0.14.2
cached-property==2.0.1
cachetools==5.5.1
calver==2022.6.26
cattrs==24.1.2
ccsm==0.8.18
certifi==2025.1.31
cffi==1.17.1
cfgv==3.4.0
Chameleon==4.6.0
characteristic==14.3.0
chardet==5.2.0
charset-normalizer==3.4.1
check-manifest==0.50
cheroot==10.0.1
CherryPy==18.10.0
chevron==0.14.0
CJKwrap==2.2
cleo==2.1.0
click==8.1.8
click-help-colors==0.9.4
cliff==4.8.0
cloudpickle==3.1.1
cmarkgfm==2024.11.20
cmd2==2.5.8
codecov==2.1.13
codespell==2.4.1
coincidence==0.6.6
colorama==0.4.6
colorlog==6.9.0
configobj==5.0.9
ConfigUpdater==3.2
consolekit==1.7.2
constantly==23.10.4
contextlib2==21.6.0
contextvars==2.4
covdefaults==2.3.0
coverage==7.6.12
coverage-enable-subprocess==1.0
coveralls==4.0.1
crashtest==0.4.1
crmsh==4.5.0
cryptography==44.0.1
cryptography_vectors==44.0.1
cssselect==1.2.0
cupshelpers==1.0
curio==1.6
Cython==3.0.12
cython-test-exception-raiser==1.0.2
dbus-python==1.3.2
ddt==1.7.2
decorator==5.1.1
defusedxml==0.7.1
dependency-groups==1.3.0
deprecation==2.1.0
deprecation-alias==0.4.0
detect-test-pollution==1.2.0
diff_cover==9.2.2
dill==0.3.9
dirty-equals==0.9.0
dist-meta==0.8.1
distlib==0.3.9
distro==1.9.0
dnspython==2.7.0
docopt==0.6.2
docutils==0.21.2
dogpile.cache==1.3.4
dom_toml==2.0.1
domdf_python_tools==3.9.0
dulwich==0.22.7
dunamai==1.23.0
editables==0.5
elastic-transport==8.15.0
elasticsearch==8.17.1
elementpath==4.7.0
email_validator==2.2.0
ephemeral-port-reserve==1.1.4
eval_type_backport==0.2.2
exceptiongroup==1.2.2
execnet==2.1.1
executing==2.2.0
expandvars==0.12.0
extras==1.0.0
factory_boy==3.3.3
fail2ban==1.1.0
Faker==36.1.1
fastjsonschema==2.21.1
fields==5.0.0
filelock==3.17.0
findpython==0.6.2
first==2.0.2
fixtures==4.2.2
flake8==7.1.1
flake8-2020==1.8.1
flake8-bugbear==24.12.12
flake8-noqa==1.4.0
flake8_typing_imports==1.16.0
flaky==3.8.1
flamegraph==0.1
Flask==3.1.0
flex==6.14.1
flit_core==3.10.1
flit_scm==1.7.0
flufl.flake8==0.10
freezegun==1.5.1
frozendict==2.4.6
frozenlist==1.5.0
fs==2.4.16
func-timeout==4.3.5
funcy==2.0
future==1.0.0
gevent==24.2.1
ghp-import==2.1.0
gi-docgen==2024.1
gitdb==4.0.12
GitPython==3.1.44
gprof2dot==2024.6.6
graphviz==0.20.3
greenlet==3.1.1
gunicorn==23.0.0
h11==0.14.0
h2==4.1.0
handy-archives==0.2.0
hatch-fancy-pypi-readme==24.1.0
hatch-nodejs-version==0.3.2
hatch-requirements-txt==0.4.1
hatch-vcs==0.4.0
hatchling==1.27.0
housekeeping==1.1
hpack==4.1.0
http-parser==0.9.0
httpcore==1.0.7
httplib2==0.22.0
httpx==0.27.2
humanize==4.12.0
hupper==1.12.1
hyperframe==6.1.0
hyperlink==21.0.0
hypothesis==6.123.13
icecream==2.1.4
identify==2.6.7
idna==3.10
imagesize==1.4.1
immutables==0.21
importcheck==0.5.0
importlib_metadata==8.6.1
importlib_resources==6.5.2
incremental==24.7.2
inflect==7.5.0
ini2toml==0.15
iniconfig==2.0.0
inline-snapshot==0.18.2
installer==0.7.0
invocations==3.3.0
invoke==2.2.0
iocapture==0.1.2
ipdb==0.13.13
ipython==8.18.1
iso8601==2.1.0
isort==6.0.0
itsdangerous==2.2.0
jaraco.classes==3.4.0
jaraco.collections==5.1.0
jaraco.context==6.0.1
jaraco.develop==8.17.5
jaraco.env==1.0.0
jaraco.envs==2.6.0
jaraco.functools==4.1.0
jaraco.itertools==6.4.1
jaraco.packaging==10.2.3
jaraco.path==3.7.2
jaraco.test==5.5.1
jaraco.text==4.0.0
jaraco.ui==2.4.0
jaraco.vcs==2.4.0
jaraco.versioning==1.1.0
jedi==0.19.2
Jinja2==3.1.5
jmespath==1.0.1
jsonpointer==3.0.0
jsonrpclib-pelix==0.4.3.3
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter_core==5.7.2
keyring==25.6.0
keyrings.alt==5.0.2
kgb==7.2
lazy==1.6
lazy-object-proxy==1.10.0
libcst==1.6.0
lingua==4.15.0
linkify-it-py==2.0.3
littleutils==0.2.2
looseversion==1.3.0
louis==3.32.0
lxml==5.3.1
lxml-stubs==0.5.1
lxml_html_clean==0.4.1
lz4==4.4.3
maison==2.0.0
Mako==1.3.9
manuel==1.13.0
Markdown==3.7
markdown-it-py==3.0.0
markdown2==2.5.3
MarkupSafe==3.0.2
marshmallow==3.26.1
matplotlib-inline==0.1.7
maturin==1.8.2
mccabe==0.7.0
mdurl==0.1.2
mercurial==6.9.1
mergedeep==1.3.4
meson==1.6.0
meson-python==0.17.1
mistletoe==1.4.0
mistune==3.1.1
mkdocs==1.6.1
mkdocs-bootstrap==1.1.1
mkdocs-bootswatch==1.1
mkdocs-get-deps==0.2.0
mock==5.1.0
more-itertools==10.6.0
msgpack==1.1.0
multidict==6.1.0
mutagen==1.47.0
mypy==1.15.0
mypy-extensions==1.0.0
mysqlclient==2.2.7
named==1.4.2
natsort==8.4.0
nbformat==5.10.4
netsnmp-python==1.0a1
nh3==0.2.20
nose==1.3.7
notify2==0.3.1
nox==2025.2.9
numpy==2.0.2
objgraph==3.6.2
olefile==0.47
outcome==1.3.0.post0
packaging==24.2
parameterized==0.9.0
paramiko==3.4.0
parso==0.8.4
passlib==1.7.4
Paste==3.10.1
PasteDeploy==3.1.0
path==17.1.0
pathlib2==2.3.7.post1
pathspec==0.12.1
pbr==6.1.1
pdm-backend==2.4.3
pep440==0.1.2
persistent==6.1
pexpect==4.9.0
pickleshare==0.7.5
pillow==11.1.0
pip-run==13.0.0
pipdeptree==2.25.0
pipenv==2024.4.1
pkg==0.1
pkgconfig==1.5.5
pkginfo==1.12.0
pkgutil_resolve_name==1.3.10
plaster==1.1.2
plaster-pastedeploy==1.0.1
platformdirs==4.3.6
pluggy==1.5.0
ply==3.11
poetry-core==2.1.0
poetry-dynamic-versioning==1.7.1
polib==1.2.0
portend==3.2.0
powerline-status==2.8.4
pretend==1.0.9
prettytable==3.14.0
process-tests==3.0.0
prompt_toolkit==3.0.50
propcache==0.2.1
psutil==6.0.0
psycopg2==2.9.10
ptyprocess==0.7.0
pure_eval==0.2.3
py==1.11.0
py-cpuinfo==9.0.0
py3c==1.4
pyasn1==0.6.1
pyasn1_modules==0.4.1
pybind11==2.13.6
pybonjour==1.1.1
pycairo==1.26.1
pycmd==1.2
pycodestyle==2.12.1
pycparser==2.22
pycryptodome==3.21.0
pycryptodome-test-vectors==1.0.20
pycryptodomex==3.21.0
pycups==2.0.4
pycurl==7.45.4
pydantic==2.10.6
pydantic_core==2.29.0
pydiff==0.2
pydiffx==1.1
pyfakefs==5.7.4
pyflakes==3.2.0
pyftpdlib==2.0.1
Pygments==2.19.1
PyGObject==3.50.0
PyHamcrest==2.1.0
PyJWT==2.10.1
pylint==3.3.4
pymongo==4.11.1
PyNaCl==1.5.0
PyNUTClient==2.8.2
pyOpenSSL==25.0.0
pyparsing==3.2.1
pyperclip==1.9.0
pypi-json==0.4.0
pyproject-api==1.9.0
pyproject-examples==2023.6.30
pyproject-fmt==2.3.1
pyproject-fmt-rust==1.2.1
pyproject-installer==0.5.5
pyproject-metadata==0.9.0
pyproject-parser==0.11.1
pyproject_hooks==1.2.0
PyQt-builder==1.18.0
PyQt5==5.15.11
PyQt5_sip==12.17.0
pyramid==2.0.1
pyroma==4.2
pyrsistent==0.20.0
PySocks==1.7.1
pytest==8.3.3
pytest-asyncio==0.25.2
pytest-benchmark==5.1.0
pytest-black==0.6.0
pytest-check==2.5.0
pytest-checkdocs==2.13.0
pytest-console-scripts==1.4.1
pytest-cov==6.0.0
pytest-custom-exit-code==0.3.0
pytest-datadir==1.6.1
pytest-enabler==3.3.0
pytest-env==1.1.5
pytest-expect==1.1.0
pytest-fixture-config==1.8.0
pytest-flake8==1.3.0
pytest-forked==1.6.0
pytest-helpers-namespace==2021.12.29
pytest-home==0.6.0
pytest-ignore-flaky==2.2.1
pytest-lazy-fixtures==1.1.2
pytest-metadata==3.1.1
pytest-mock==3.14.0
pytest-mypy==0.10.3
pytest-mypy-plugins==3.2.0
pytest-perf==0.15.0
pytest-randomly==3.16.0
pytest-regressions==2.7.0
pytest-relaxed==2.0.2
pytest-reporter==0.5.3
pytest-rerunfailures==15.0
pytest-salt-factories==1.0.4
pytest-shell-utilities==1.9.7
pytest-skip-markers==1.5.2
pytest-socket==0.7.0
pytest-subprocess==1.5.3
pytest-subtests==0.14.1
pytest-system-statistics==1.0.2
pytest-timeout==2.3.1
pytest-travis-fold==1.3.0
pytest-xdist==3.6.1
pytest-xprocess==1.0.2
pytest_freezer==0.4.9
pytest_httpserver==1.1.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-magic==0.4.27
python-rapidjson==1.20
python-subunit==1.4.4
python-xlib==0.33
pytidylib==0.3.2
pytoml==0.1.21
pytoolconfig==1.3.1
pytz==2025.1
pyxdg==0.28
PyYAML==6.0.1
pyyaml_env_tag==0.1
pyzmq==26.2.0
qualname==0.1.0
railroad-diagrams==3.0.1
RapidFuzz==3.12.1
RBTools==5.0
rdiff-backup==2.2.6
re-assert==1.1.0
readme_renderer==44.0
readthedocs-sphinx-ext==2.2.5
redis==5.2.1
referencing==0.36.2
regex==2024.11.6
releases==2.1.1
repoze.lru==0.7
repoze.sphinx.autointerface==1.0.0
requests==2.32.3
requests-file==2.1.0
requests-toolbelt==1.0.0
requests-wsgi-adapter==0.4.1
resolvelib==1.1.0
rfc3986==2.0.0
rfc3987==1.3.8
rich==13.9.4
Routes==2.5.1
rpds-py==0.22.3
rrdtool==0.1.10
ruamel.yaml==0.18.10
ruamel.yaml.clib==0.2.12
ruyaml==0.91.0
salt==3007.1
schema==0.7.7
scikit-build==0.18.1
scikit_build_core==0.10.7
SCons==4.8.1
scour==0.38.2
scripttest==1.3
sdjson==0.5.0
seedir==0.5.0
semantic_version==2.10.0
serpent==1.41
service-identity==24.2.0
setuptools-declarative-requirements==1.3.0
setuptools-rust==1.10.2
setuptools-scm==8.1.0
sh==1.14.3
shellingham==1.5.4
shippinglabel==2.1.0
simplegeneric==0.8.1
simplejson==3.20.1
sip==6.10.0
six==1.17.0
smartypants==2.0.1
smmap==5.0.2
sniffio==1.3.1
snowballstemmer==2.2.0
socksio==1.0.0
sortedcontainers==2.4.0
soupsieve==2.6
spec==1.4.1
Sphinx==7.4.7
sphinx-autodoc-typehints==2.3.0
sphinx-issues==5.0.0
sphinx_rtd_theme==3.0.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
sphobjinv==2.3.1.2
sqlparse==0.5.3
stack-data==0.6.3
stdio-mgr==1.0.1
stestr==4.1.0
stevedore==5.4.0
StrEnum==0.4.15
strict-rfc3339==0.7
strictyaml==1.7.3
subprocess-tee==0.4.2
sure==2.0.1
sybil==9.0.0
tabulate==0.9.0
tempora==5.8.0
termcolor==2.5.0
terminator==2.1.3
termstyle==0.1.11
testfixtures==8.3.0
testpath==0.6.0
testresources==2.0.1
testscenarios==0.5.0
testtools==2.7.2
texttable==1.7.0
time-machine==2.16.0
tokenize_rt==6.1.0
toml==0.10.2
tomli==2.2.1
tomli_w==1.2.0
tomlkit==0.13.2
tornado==6.4.2
tox==4.24.1
tox-current-env==0.0.14
tqdm==4.67.1
traitlets==5.14.3
transaction==5.0
translationstring==1.4
trove-classifiers==2025.1.15.22
trustme==1.2.1
twine==6.0.1
Twisted==24.11.0
typeguard==4.4.1
typer==0.12.4
types-decorator==5.1.8.20250215
types-docutils==0.21.0.20241128
types-mock==5.1.0.20240425
types-paramiko==3.5.0.20240928
types-psutil==6.1.0.20241221
types-python-dateutil==2.9.0.20241206
types-pytz==2025.1.0.20250204
types-PyYAML==6.0.12.20241230
types-requests==2.32.0.20241016
types-setuptools==75.8.0.20250210
types-six==1.17.0.20241205
types-toml==0.10.8.20240310
typing-inspect==0.9.0
typing_extensions==4.12.2
typogrify==2.1.0
tzdata==2025.1
u-msgpack-python==2.8.0
uc-micro-py==1.0.3
ukkonen==1.0.1
UkPostcodeParser==1.1.2
unearth==0.17.2
Unidecode==1.3.8
urllib3==2.1.0
uvicorn==0.31.1
validate-email==1.3
validate-pyproject==0.16
validators==0.34.0
venusian==3.1.1
versioneer==0.29
virtualenv==20.29.2
voluptuous==0.15.2
waitress==3.0.2
watchdog==6.0.0
wcag-contrast-ratio==0.9
wcmatch==10.0
wcwidth==0.2.13
webencodings==0.5.1
WebOb==1.8.9
websockets==14.2
WebTest==3.0.4
Werkzeug==3.1.3
whatever==0.7
whey==0.1.1
wrapt==1.17.2
WSGIProxy2==0.5.1
xmlschema==3.4.3
xmltodict==0.14.2
yamlfix==1.17.0
yamllint==1.35.1
yarl==1.18.3
youtube-dl==2021.12.17
yt-dlp==2025.1.26
zc.lockfile==3.0.post1
ZConfig==4.2
zest.releaser==9.2.0
zipp==3.21.0
ZODB==6.0
zodbpickle==4.2
zope.component==6.0
zope.configuration==6.0
zope.copy==5.0
zope.deferredimport==5.0
zope.deprecation==5.1
zope.event==5.0
zope.exceptions==5.2
zope.hookable==7.0
zope.i18nmessageid==7.0
zope.interface==7.2
zope.location==5.1
zope.proxy==6.1
zope.schema==7.0.1
zope.security==7.3
zope.testing==5.1
zope.testrunner==7.0
zstandard==0.23.0
zstd==1.5.6.2

@petyaslavova petyaslavova self-assigned this Mar 7, 2025
@petyaslavova
Copy link
Collaborator

Hi @mtelka, I was able to reproduce your issue. It occurs when Docker Compose is not used to generate the Docker images for testing, as this process creates the necessary folders containing the certificates.

The issue in our code is that the marker on the TestSSL class only skips the tests within the class, but it does not skip the call to get_tls_certificates("cluster"), which attempts to load the missing certificate files.

We should fix this by ensuring that the function call is also skipped.

@petyaslavova
Copy link
Collaborator

The issue is fixed in master branch as part of PR #3445 (https://github.com/redis/redis-py/pull/3445/files#diff-86b54cd930d82017acd739ba6635fa6ee043ce58e554ae2f3008d61a4daa62a9)

@vladvildanov, should we add a fix for 5.2, or is fixing the problem for the 5.3 code enough?

@vladvildanov
Copy link
Collaborator

@petyaslavova This one isn't a CVE or critical bug, fix for 5.3 is enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants