Bug 284715 - sysutils/py-salt: Add missing dependancy
Summary: sysutils/py-salt: Add missing dependancy
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Xavier Beaudouin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-10 16:46 UTC by Matthew D. Fuller
Modified: 2025-05-26 11:13 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (krion)


Attachments
Add crytography to PYTHON_USES (1.03 KB, patch)
2025-02-10 16:46 UTC, Matthew D. Fuller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew D. Fuller 2025-02-10 16:46:44 UTC
Created attachment 257385 [details]
Add crytography to PYTHON_USES

Salt requires the cryptography library, and will happily fill up your disk with backtraces in the minion log if it doesn't have it:

  File "/usr/local/lib/python3.11/site-packages/salt/crypt.py", line 235, in __init__
    self.key = get_rsa_key(path, passphrase)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/crypt.py", line 351, in get_rsa_key
    return _get_key_with_evict(path, str(os.path.getmtime(path)), passphrase)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/utils/decorators/__init__.py", line 296, in _memoize
    cache[args_] = func(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/salt/crypt.py", line 333, in _get_key_with_evict
    return serialization.load_pem_private_key(
           ^^^^^^^^^^^^^
NameError: name 'serialization' is not defined


So...   add it   :)
Comment 1 Alan Hicks 2025-03-16 13:56:31 UTC
I confirm without py311-cryptography in a newly created 14.2 jail, salt is unable to create a private key to offer to the salt_master with the following error:
[DEBUG   ] salt.crypt.get_rsa_key: Loading private key
[DEBUG   ] salt.crypt._get_key_with_evict: Loading private key
[CRITICAL] Unexpected error while connecting to verdi.p-o.co.uk

After installing py311-cryptography salt creates a key and salt minion connects as normal.
Comment 2 Sebastian S 2025-05-24 12:50:51 UTC
I can confirm that installing cryptography solves this problem, but I can imagine the issue is related to 

https://github.com/saltstack/salt/issues/68024
https://github.com/saltstack/salt/issues/68036
Comment 3 Xavier Beaudouin freebsd_committer freebsd_triage 2025-05-26 07:23:16 UTC
I can confirm this as well.
Comment 4 Xavier Beaudouin freebsd_committer freebsd_triage 2025-05-26 07:37:31 UTC
Will work on it.
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-05-26 09:57:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5f890d753f568452ab44a551dbabd5878cea99f1

commit 5f890d753f568452ab44a551dbabd5878cea99f1
Author:     fullermd@over-yonder.net <fullermd@over-yonder.net>
AuthorDate: 2025-05-26 07:42:28 +0000
Commit:     Xavier Beaudouin <kiwi@FreeBSD.org>
CommitDate: 2025-05-26 09:56:09 +0000

    sysutils/py-salt: Add missing cryptography dependancy

    Add cryptography to PYTHON_USES.
    Salt requires the cryptography library, and will happily
    fill up /var/log/salt with backtraces in the minion log
    if it doesn't have it.

    PR:     284715
    Approved by:    0mp (mentor)
    Approved by:    maintainer timeout
    Differential Revision:  https://reviews.freebsd.org/D50530

 sysutils/py-salt/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 Xavier Beaudouin freebsd_committer freebsd_triage 2025-05-26 11:13:01 UTC
Hi!

The fix has been commited!

Thanks