latenighttales / alcali

Featureful Saltstack GUI
https://alcali.dev
MIT License
356 stars 61 forks source link

Bump master Dockerfile to salt version 3006 failed #501

Closed schka17 closed 11 months ago

schka17 commented 1 year ago

Tried to update the salt master to 3006. this failed because of missing dependencies in alcali_postgres.py, line 143 from salt.ext import six ImportError: cannot import name 'six' from 'salt.ext' (/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/init.py) [DEBUG ] Could not LazyLoad alcali.prep_jid: 'alcali' virtual returned False: cannot import name 'six' from 'salt.ext'/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/init.py) [ERROR ] Returner 'alcali' does not support function prep_jid [ERROR ] An un-handled exception was caught by Salt's global exception handler: KeyError: "Returner 'alcali' does not support function prep_jid"

To Reproduce Steps to reproduce the behavior:

  1. update the Dockerfile file `FROM python:3.7-slim-buster

Upgrade System and Install dependencies

RUN apt-get update && \ apt-get upgrade -y -o DPkg::Options::=--force-confold && \ apt-get install -y -o DPkg::Options::=--force-confold curl python3-mysqldb netcat

Install Latest Salt from the stable Branch

RUN curl -L https://bootstrap.saltstack.com | sh -s -- -X -M -x python3 stable latest

RUN curl -L https://bootstrap.saltstack.com | sh -s -- -X -M -x python3 stable 3006

Set master and id

COPY saltconfig/etc/minion /etc/salt/minion RUN echo "id: master">>/etc/salt/minion

Install python dependencies

RUN apt-get install -y -o DPkg::Options::=--force-confold salt-api python3-openssl RUN pip install honcho

Copy needed files

COPY saltconfig/etc/master /etc/salt/master COPY saltconfig/salt /srv/salt COPY saltconfig/pillar /srv/pillar COPY utils/wait-for . COPY utils/Procfile . COPY utils/entrypoint-master.sh .

Sync auth and returners

RUN salt-run saltutil.sync_all

Create salt-api certs

RUN salt-call --local tls.create_self_signed_cert cacert_path='/etc/pki'

ENTRYPOINT ["./entrypoint-master.sh"] `

  1. run docker build, this creates this error: `#0 6.003 Traceback (most recent call last):

    0 6.003 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 772, in _load_module

    0 6.003 mod = self.run(spec.loader.load_module)

    0 6.003 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1232, in run

    0 6.003 return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)

    0 6.003 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1247, in _run_as

    0 6.003 return _func_or_method(*args, **kwargs)

    0 6.003 File "", line 548, in _check_name_wrapper

    0 6.003 File "", line 1063, in load_module

    0 6.003 File "", line 888, in load_module

    0 6.003 File "", line 290, in _load_module_shim

    0 6.003 File "", line 719, in _load

    0 6.003 File "", line 688, in _load_unlocked

    0 6.003 File "", line 883, in exec_module

    0 6.003 File "", line 241, in _call_with_frames_removed

    0 6.003 File "/var/cache/salt/master/extmods/returners/alcali.py", line 157, in

    0 6.003 from salt.ext import six

    0 6.003 ImportError: cannot import name 'six' from 'salt.ext' (/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/init.py)

    0 6.004 [DEBUG ] Failed to import returner alcali_postgres:

    0 6.004 Traceback (most recent call last):

    0 6.004 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 772, in _load_module

    0 6.004 mod = self.run(spec.loader.load_module)

    0 6.004 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1232, in run

    0 6.004 return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)

    0 6.004 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1247, in _run_as

    0 6.004 return _func_or_method(*args, **kwargs)

    0 6.004 File "", line 548, in _check_name_wrapper

    0 6.004 File "", line 1063, in load_module

    0 6.004 File "", line 888, in load_module

    0 6.004 File "", line 290, in _load_module_shim

    0 6.004 File "", line 719, in _load

    0 6.004 File "", line 688, in _load_unlocked

    0 6.004 File "", line 883, in exec_module

    0 6.004 File "", line 241, in _call_with_frames_removed

    0 6.004 File "/var/cache/salt/master/extmods/returners/alcali_postgres.py", line 143, in

    0 6.004 from salt.ext import six

    0 6.004 ImportError: cannot import name 'six' from 'salt.ext' (/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/init.py)

    0 6.004 [DEBUG ] Could not LazyLoad alcali.prep_jid: 'alcali' virtual returned False: cannot import name 'six' from 'salt.ext' (/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/init.py)

    0 6.004 [ERROR ] Returner 'alcali' does not support function prep_jid

    0 6.005 [ERROR ] An un-handled exception was caught by Salt's global exception handler:

    0 6.005 KeyError: "Returner 'alcali' does not support function prep_jid"

    0 6.005 Traceback (most recent call last):

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/job.py", line 72, in store_job

    0 6.005 mminion.returners[jidstore_fstr](False, passed_jid=load["jid"])

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 336, in getitem

    0 6.005 super().getitem(item) # try to get the item from the dictionary

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/lazy.py", line 105, in getitem

    0 6.005 raise KeyError(key)

    0 6.005 KeyError: 'alcali.prep_jid'

    0 6.005

    0 6.005 During handling of the above exception, another exception occurred:

    0 6.005

    0 6.005 Traceback (most recent call last):

    0 6.005 File "/usr/bin/salt-run", line 11, in

    0 6.005 sys.exit(salt_run())

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/scripts.py", line 457, in salt_run

    0 6.005 client.run()

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/cli/run.py", line 34, in run

    0 6.005 ret = runner.run()

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/runner.py", line 300, in run

    0 6.005 ret = self._proc_function(

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/client/mixins.py", line 540, in _proc_function

    0 6.005 return instance.low(fun, low)

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/client/mixins.py", line 418, in low

    0 6.005 salt.utils.job.store_job(

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/job.py", line 76, in store_job

    0 6.005 raise KeyError(emsg)

    0 6.005 KeyError: "Returner 'alcali' does not support function prep_jid"

    0 6.005 Traceback (most recent call last):

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/job.py", line 72, in store_job

    0 6.005 mminion.returners[jidstore_fstr](False, passed_jid=load["jid"])

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 336, in getitem

    0 6.005 super().getitem(item) # try to get the item from the dictionary

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/lazy.py", line 105, in getitem

    0 6.005 raise KeyError(key)

    0 6.005 KeyError: 'alcali.prep_jid'

    0 6.005

    0 6.005 During handling of the above exception, another exception occurred:

    0 6.005

    0 6.005 Traceback (most recent call last):

    0 6.005 File "/usr/bin/salt-run", line 11, in

    0 6.005 sys.exit(salt_run())

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/scripts.py", line 457, in salt_run

    0 6.005 client.run()

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/cli/run.py", line 34, in run

    0 6.005 ret = runner.run()

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/runner.py", line 300, in run

    0 6.005 ret = self._proc_function(

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/client/mixins.py", line 540, in _proc_function

    0 6.005 return instance.low(fun, low)

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/client/mixins.py", line 418, in low

    0 6.005 salt.utils.job.store_job(

    0 6.005 File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/job.py", line 76, in store_job

    0 6.005 raise KeyError(emsg)

    0 6.005 KeyError: "Returner 'alcali' does not support function prep_jid"


    Dockerfile-master:29

    27 |
    28 | # Sync auth and returners 29 | >>> RUN salt-run saltutil.sync_all 30 |
    31 | # Create salt-api certs

    ERROR: failed to solve: process "/bin/sh -c salt-run saltutil.sync_all" did not complete successfully: exit code: 1`

Running the same Dockerfile with salt version 3005 is succesful

Expected behavior Bump salt master version to 3006

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

NA

Desktop (please complete the following information):

NA

Additional context Add any other context about the problem here.

mattLLVW commented 11 months ago

fixed by #507