You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On launch salt {minion} state.sls php.modules (php.apcu) and/or salt {minion} php.fpm, they both failed by trying to install duplicate package.
Steps to reproduce the bug
salt {minion} state.sls php.modules produce only this error :
ID: php_install_apcu
Function: pkg.installed
Name: apcu
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/state.py", line 2424, in call
ret = self.states[cdata["full"]](
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
ret = self.loader.run(run_func, *args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1293, in wrapper
return f(*args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 1704, in installed
result = _find_install_targets(
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 585, in _find_install_targets
desired = _repack_pkgs(pkgs, normalize=normalize)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/pkg_resource.py", line 38, in _repack_pkgs
raise SaltInvocationError(
salt.exceptions.SaltInvocationError: You are passing a list of packages that contains duplicated packages names: ['php-apcu-bc', 'php-apcu-bc', 'php-apcu-bc', 'php-apcu-bc']. This cannot be processed. In case you are targeting different versions of the same package, please target them individually
Started: 09:01:05.683666
Duration: 9.847 ms
Changes:
salt {minion} state.sls php.fpm produce this error :
ID: php_install_fpm
Function: pkg.installed
Name: fpm
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/state.py", line 2424, in call
ret = self.states[cdata["full"]](
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
ret = self.loader.run(run_func, *args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1293, in wrapper
return f(*args, **kwargs)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 1704, in installed
result = _find_install_targets(
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pkg.py", line 585, in _find_install_targets
desired = _repack_pkgs(pkgs, normalize=normalize)
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/pkg_resource.py", line 38, in _repack_pkgs
raise SaltInvocationError(
salt.exceptions.SaltInvocationError: You are passing a list of packages that contains duplicated packages names: ['php7.4-fpm', 'php7.4-fpm', 'php8.1-fpm', 'php8.2-fpm', 'php8.3-fpm']. This cannot be processed. In case you are targeting different versions of the same package, please target them individually
Started: 09:04:42.869406
Duration: 24.721 ms
Changes:
Expected behaviour
This 2 errors didn't appear when the same pillar is launched on older sminions server (salt-minion 3002.9+ds-1). There is not any duplicates packages in queue.
Attempts to fix the bug
In installed.jinja, i've write
line 23:
{% if other_version_str != first_version %}
{% do pkgs.append(pkg.replace(first_version, other_version_str)) %}
{% endif %}
and line 36:
{% if other_version_str != first_version %}
{% do pkgs.append(pkginfo.replace(first_version, other_version_str)) %}
{% endif %}
And it seems to correct salt state.sls php.fpm error.
But i didn't yet identified the problem with php.apcu or php.modules state.
Additional context
Same error fro php.apc state...
Maybe upgrade the default php version 7.0 in jinja's files to 8.x...
Thanks
The text was updated successfully, but these errors were encountered:
Hello there! I've found a temporal solution for this problem. In the installed.jinja file, after looping through all the different versions to create the pkgs and specials arrays, you can use the unique Jinja filter to remove duplicates.
line 39, add this piece of code.
{% set pkgs = pkgs | unique %}
{% set specials = specials | unique %}
After applying the fix, no more duplicate packages errors appear while calling php.modules, php.ini or php.fpm.
Your setup
Formula commit hash / release tag
I'm using php-formula 9c69a4e. the last one on master branch
Versions reports (master & minion)
Master :
Minion server:
Pillar / config used
Bug details
Describe the bug
On launch salt {minion} state.sls php.modules (php.apcu) and/or salt {minion} php.fpm, they both failed by trying to install duplicate package.
Steps to reproduce the bug
salt {minion} state.sls php.modules produce only this error :
salt {minion} state.sls php.fpm produce this error :
Expected behaviour
This 2 errors didn't appear when the same pillar is launched on older sminions server (salt-minion 3002.9+ds-1). There is not any duplicates packages in queue.
Attempts to fix the bug
In installed.jinja, i've write
line 23:
and line 36:
And it seems to correct salt state.sls php.fpm error.
But i didn't yet identified the problem with php.apcu or php.modules state.
Additional context
Thanks
The text was updated successfully, but these errors were encountered: