Skip to content
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

[BUG] key_cache: sched throws exceptions on 3007.x as pki_dir is not accessible from the function #67185

Open
akrus opened this issue Jan 22, 2025 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@akrus
Copy link

akrus commented Jan 22, 2025

Description
When key_cache: sched is enabled in the configuration, Salt Master process throws unhandled exception in the logs every 10 seconds:

2025-01-22 08:19:16,192 [salt.utils.process:1000][ERROR   ][40178] An un-handled exception from the multiprocessing process 'Maintenance' was caught:
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/process.py", line 995, in wrapped_run_func
    return run_func()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/master.py", line 312, in run
    self.handle_key_cache()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/master.py", line 339, in handle_key_cache
    os.path.join(self.pki_dir, acc, ".key_cache"), mode="wb"
AttributeError: 'Maintenance' object has no attribute 'pki_dir'

Setup
Nothing is needed in particular, simply specify key_cache: sched.

Steps to Reproduce the behavior
key_cache: sched in the configuration.

Expected behavior
key_cache is expected to work.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3007.1

Python Version:
        Python: 3.10.14 (main, Apr  3 2024, 21:30:09) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.17.1
      cherrypy: unknown
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       libgit2: 1.9.0
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: 1.17.0
  python-gnupg: 0.5.2
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: 0.16.0
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.3.3
           ZMQ: 4.3.4

Salt Package Information:
  Package Type: onedir

System Versions:
          dist: ubuntu 22.04.5 jammy
        locale: utf-8
       machine: x86_64
       release: 5.15.0-130-generic
        system: Linux
       version: Ubuntu 22.04.5 jammy

Additional context
Adding

self.pki_dir = self.opts["pki_dir"]

to salt/master.py around line 333 fixes the issue, but as it's probably needed for a clustered setup, more work needs to be done.

This was introduced with the commit:
8764aa9
(@dwoz probably can help)

@akrus akrus added Bug broken, incorrect, or confusing behavior needs-triage labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant