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

Bump master Dockerfile to salt version 3006 failed #501

Closed
schka17 opened this issue May 17, 2023 · 1 comment
Closed

Bump master Dockerfile to salt version 3006 failed #501

schka17 opened this issue May 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@schka17
Copy link

schka17 commented May 17, 2023

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"]
2. 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):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

NA

Additional context
Add any other context about the problem here.

@schka17 schka17 added the bug Something isn't working label May 17, 2023
@mattLLVW
Copy link
Contributor

fixed by #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants