Skip to content

Add openssl pkg to alpine to provide libcrypto#2116

Open
heewa wants to merge 1 commit into
saltstack:developfrom
heewa:fix-alpine-libcrypto-dep
Open

Add openssl pkg to alpine to provide libcrypto#2116
heewa wants to merge 1 commit into
saltstack:developfrom
heewa:fix-alpine-libcrypto-dep

Conversation

@heewa

@heewa heewa commented Jun 3, 2026

Copy link
Copy Markdown

What does this PR do?

Adds the openssl-dev package to alpine installs, which salt needs to run.

What issues does this PR fix or reference?

After an install on alpine linux, salt throws errors due to missing crypto libs:

error output
Traceback (most recent call last):
  File "/usr/local/bin/salt-master", line 6, in <module>
    sys.exit(salt_master())
             ~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/salt/scripts.py", line 124, in salt_master
    import salt.cli.daemons
  File "/usr/local/lib/python3.13/site-packages/salt/cli/daemons.py", line 46, in <module>
    import salt.utils.parsers
  File "/usr/local/lib/python3.13/site-packages/salt/utils/parsers.py", line 26, in <module>
    import salt.config as config
  File "/usr/local/lib/python3.13/site-packages/salt/config/__init__.py", line 16, in <module>
    import salt.crypt
  File "/usr/local/lib/python3.13/site-packages/salt/crypt.py", line 39, in <module>
    import salt.utils.rsax931
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 172, in <module>
    libcrypto = _init_libcrypto()
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 125, in _init_libcrypto
    libcrypto = _load_libcrypto()
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 118, in _load_libcrypto
    return cdll.LoadLibrary(_find_libcrypto())
                            ~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 110, in _find_libcrypto
    raise OSError("Cannot locate OpenSSL libcrypto")
OSError: Cannot locate OpenSSL libcrypto
[ERROR   ] An un-handled exception was caught by Salt's global exception handler:
OSError: Cannot locate OpenSSL libcrypto
Traceback (most recent call last):
  File "/usr/local/bin/salt-master", line 6, in <module>
    sys.exit(salt_master())
             ~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/salt/scripts.py", line 124, in salt_master
    import salt.cli.daemons
  File "/usr/local/lib/python3.13/site-packages/salt/cli/daemons.py", line 46, in <module>
    import salt.utils.parsers
  File "/usr/local/lib/python3.13/site-packages/salt/utils/parsers.py", line 26, in <module>
    import salt.config as config
  File "/usr/local/lib/python3.13/site-packages/salt/config/__init__.py", line 16, in <module>
    import salt.crypt
  File "/usr/local/lib/python3.13/site-packages/salt/crypt.py", line 39, in <module>
    import salt.utils.rsax931
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 172, in <module>
    libcrypto = _init_libcrypto()
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 125, in _init_libcrypto
    libcrypto = _load_libcrypto()
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 118, in _load_libcrypto
    return cdll.LoadLibrary(_find_libcrypto())
                            ~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/salt/utils/rsax931.py", line 110, in _find_libcrypto
    raise OSError("Cannot locate OpenSSL libcrypto")
OSError: Cannot locate OpenSSL libcrypto

@twangboy twangboy self-assigned this Jun 26, 2026
@twangboy twangboy force-pushed the fix-alpine-libcrypto-dep branch from 24f5730 to b7cde8b Compare July 9, 2026 20:16
Comment thread bootstrap-salt.sh
__git_clone_and_checkout || return 1

apk -U add python3 python3-dev py3-pip py3-setuptools g++ linux-headers zeromq-dev openrc || return 1
apk -U add python3 python3-dev py3-pip py3-setuptools g++ linux-headers zeromq-dev openrc openssl-dev || return 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocker: The PR title and description state that this is adding the openssl package to provide libcrypto for a runtime dependency. However, the code adds openssl-dev instead of openssl.

If the goal is strictly to provide the libcrypto shared library for runtime execution, we should just install openssl (or libcrypto3/libcrypto1.1 explicitly depending on the Alpine version) to keep the bootstrap footprint minimal. Adding -dev headers introduces unnecessary build dependencies unless we are explicitly compiling a Python wheel against OpenSSL headers during this git dependency installation phase.

If we do need the development headers for a compilation step here, the PR title should be updated to reflect that, but otherwise, this should be switched to the runtime package.

Suggested Change:

apk -U add python3 python3-dev py3-pip py3-setuptools g++ linux-headers zeromq-dev openrc openssl || return 1

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

Successfully merging this pull request may close these issues.

2 participants