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] sync_renderers fails when the custom renderer is specified via config #66453

Open
nicholasmhughes opened this issue Apr 29, 2024 · 0 comments · May be fixed by #66454
Open

[BUG] sync_renderers fails when the custom renderer is specified via config #66453

nicholasmhughes opened this issue Apr 29, 2024 · 0 comments · May be fixed by #66454
Assignees
Labels
Bug broken, incorrect, or confusing behavior Loader Renderers

Comments

@nicholasmhughes
Copy link
Collaborator

Description
If attempting to sync a custom renderer when that renderer is already in the render pipeline via the renderer configuration options, the operation will fail with the following error:

salt.exceptions.LoaderError: The renderer some_custom_thing|jinja|yaml is unavailable, this error is often because the needed software is unavailable

This creates a "chicken and egg" scenario where the minion configuration needs to be temporarily modified until after the custom renderer has been synced.

Steps to Reproduce the behavior

mkdir -p /srv/salt/_renderers
cp /opt/saltstack/salt/lib/python3.10/site-packages/salt/renderers/yaml.py /srv/salt/_renderers/some_custom_thing.py
echo 'renderer: some_custom_thing|jinja|yaml' > /etc/salt/minion.d/custom_renderer.conf
salt-call saltutil.sync_renderers

Expected behavior
When specifying a renderer that doesn't exist (or doesn't exist yet), we should fall back to the default renderer much like we do when a non-existent outputter is specified:

root@u22-party-01:~# salt-call test.ping --output some_custom_thing
[ERROR   ] Invalid outputter some_custom_thing specified, fall back to nested
local:
    True

This would allow the saltutil.sync_renderers execution to run successfully and sync any custom renderers that might be configured.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
               Salt: 3007.0
 
Python Version:
             Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0]
 
Dependency Versions:
               cffi: 1.16.0
           cherrypy: 18.8.0
           dateutil: 2.8.2
          docker-py: Not Installed
              gitdb: Not Installed
          gitpython: Not Installed
             Jinja2: 3.1.3
            libgit2: Not Installed
       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: Not Installed
       python-gnupg: 0.5.2
             PyYAML: 6.0.1
              PyZMQ: 25.1.2
             relenv: 0.15.1
              smmap: Not Installed
            timelib: 0.3.0
            Tornado: 6.3.3
                ZMQ: 4.3.4
 
Salt Extensions:
 saltext.prometheus: 2.0.3
     saltext.vmware: 23.6.29.0rc1
 
Salt Package Information:
       Package Type: onedir
 
System Versions:
               dist: ubuntu 22.04.4 jammy
             locale: utf-8
            machine: x86_64
            release: 5.15.0-101-generic
             system: Linux
            version: Ubuntu 22.04.4 jammy
@nicholasmhughes nicholasmhughes added Bug broken, incorrect, or confusing behavior Renderers Loader labels Apr 29, 2024
@nicholasmhughes nicholasmhughes self-assigned this Apr 29, 2024
nicholasmhughes added a commit to nicholasmhughes/salt that referenced this issue Apr 29, 2024
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 Loader Renderers
Projects
None yet
1 participant