Closed xkisu closed 4 years ago
@xkisu Thanks for the report. I wonder this is related to the fact that we've dropped support for virtual packages in the Fluorine release. Do you know if the celph-common
package is a virtual package?
/cc @saltstack/team-core
@garethgreenaway You may be onto something there since this problem is only with certain packages, I'll check the ceph packages when I get a chance. I'm also having the same problem with Openstack packages which I believe are virtual packages so that would make sense.
I did a bunch of checking and the packages I'm having problems with do not appear to be virtual packages.
It seems like it's might just be a problem with packages that are managed with the pkgrepo.managed
state. I'm able to install packages from other repositories perfectly fine in my formulas, only the pkg.installed
states for packages that are in a managed repo fail.
I just noticed in the error output that pkg.installed
seems to think the package name is literally u'ceph-common'
, I'm not sure where it's getting that since the package name is correctly formatted.
Hi @Ch3LL and @garethgreenaway ... again,
this could be related:
I setup states to replace Oracle Java with OpenJDK for new developer/production instances because of Oracle license / removed archives of old java packages.
But the new packages weren't installed because saltstack is sure that it's already setup:
Here the partial output of generated state file and command calls:
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/java/openjdk.sls' using 'jinja' renderer: 0.0140619277954
[DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/java/openjdk.sls:
#
# Install Java Runtime Environment - OpenJDK version 8
#
openjdk-8-jre-headless:
pkg.installed:
- name: openjdk-8-jre-headless
- retry:
attempts: 20 # default: 2
until: True # default: True
interval: 10 # default: 30
splay: 10 # default: 0
# path to binary is automatically set so not need to define:
# # update-alternatives --list java
# /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
# path of JAVA_HOME is then:
# # update-alternatives --query java | sed -ne 's#^Value: \(.\+\)/jre/bin/java#\1#p'
# /usr/lib/jvm/java-8-openjdk-amd64
#alternatives.set:
# - name: java
# - path: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
# - require:
# - pkg: openjdk-8-jre-headless
java-package:
test.nop:
- require:
- pkg: openjdk-8-jre-headless
[DEBUG ] Results of YAML rendering:
OrderedDict([(u'openjdk-8-jre-headless', OrderedDict([(u'pkg.installed', [OrderedDict([(u'name', u'openjdk-8-jre-headless')]), OrderedDict([(u'retry', OrderedDict([(u'attempts', 20), (u'until', True), (u'interval', 10), (u'splay', 10)]))])])])), (u'java-package', OrderedDict([(u'test.nop', [OrderedDict([(u'require', [OrderedDict([(u'pkg', u'openjdk-8-jre-headless')])])])])]))])
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/java/openjdk.sls' using 'yaml' renderer: 0.00391411781311
[DEBUG ] LazyLoaded config.option
[DEBUG ] LazyLoaded pkg.install
[DEBUG ] LazyLoaded pkg.installed
[DEBUG ] LazyLoaded systemd.booted
[DEBUG ] DSC: Only available on Windows systems
[DEBUG ] Module PSGet: Only available on Windows systems
[DEBUG ] LazyLoaded platform.is_windows
[DEBUG ] Could not LazyLoad pkg.ex_mod_init: 'pkg.ex_mod_init' is not available.
[INFO ] Running state [openjdk-8-jre-headless] at time 18:47:51.835993
[INFO ] Executing state pkg.installed for [openjdk-8-jre-headless]
[DEBUG ] Could not LazyLoad pkg.resolve_capabilities: 'pkg.resolve_capabilities' is not available.
[INFO ] Executing command [u'dpkg-query', u'--showformat', u'${Status} ${Package} ${Version} ${Architecture}', u'-W'] in directory '/root'
[DEBUG ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[INFO ] All specified packages are already installed
[INFO ] Completed state [openjdk-8-jre-headless] at time 18:47:52.610427 (duration_in_ms=774.436)
[DEBUG ] LazyLoaded test.nop
[INFO ] Running state [java-package] at time 18:47:52.612283
[INFO ] Executing state test.nop for [java-package]
[INFO ] Success!
[INFO ] Completed state [java-package] at time 18:47:52.613060 (duration_in_ms=0.777)
BTW:
root@ci-nb1dc03-01 ~ # dpkg-query --showformat '${Status} ${Package} ${Version} ${Architecture}' -W | wc
0 4831 51200
root@ci-nb1dc03-01 ~ # dpkg-query --showformat '${Status} ${Package} ${Version} ${Architecture}\n' -W | grep -e jdk -e java -e oracle
install ok installed java-common 0.58 all
install ok installed oracle-java8-installer 8u201-1~webupd8~1 all
install ok installed oracle-java8-unlimited-jce-policy 8u201-1~webupd8~1 all
-hold: True
the first call is every time failing (which I need on some packages).It's like in https://github.com/saltstack/salt/issues/52165#issuecomment-484955181 where I forgot to mentioned it: Even after years of Saltstack development there isn't a correct testing procedure setup by the company so even basic modules/states breaks in updates even they are available since beginning! Perhaps there is a test system partly build up because I see testing states updates and from time to time a "Go go jenkins" comment but they are still too few to name it as good working QA check.
Happy Easter and also Kind Regards to all developers.
Only possible workaround for my problem: Manually purging old packages:
root@ci-nb1dc03-01 ~ # aptitude purge oracle-java8-installer oracle-java8-unlimited-jce-policy
The following packages will be REMOVED:
java-common{u} oracle-java8-installer{p} oracle-java8-unlimited-jce-policy{p}
0 packages upgraded, 0 newly installed, 3 to remove and 2 not upgraded.
Need to get 0 B of archives. After unpacking 179 kB will be freed.
The following packages have unmet dependencies:
oracle-java8-set-default : PreDepends: oracle-java8-installer but it is not going to be installed
The following actions will resolve these dependencies:
Remove the following packages:
1) oracle-java8-set-default [8u201-1~webupd8~1 (now)]
Accept this solution? [Y/n/q/?]
The following packages will be REMOVED:
java-common{u} oracle-java8-installer{p} oracle-java8-set-default{a} oracle-java8-unlimited-jce-policy{p}
0 packages upgraded, 0 newly installed, 4 to remove and 2 not upgraded.
Need to get 0 B of archives. After unpacking 200 kB will be freed.
Do you want to continue? [Y/n/?]
(Reading database ... 87935 files and directories currently installed.)
Removing oracle-java8-unlimited-jce-policy (8u201-1~webupd8~1) ...
Removing oracle-java8-set-default (8u201-1~webupd8~1) ...
Removing oracle-java8-installer (8u201-1~webupd8~1) ...
update-alternatives: removing manually selected alternative - switching appletviewer to auto mode
update-alternatives: removing manually selected alternative - switching extcheck to auto mode
update-alternatives: removing manually selected alternative - switching idlj to auto mode
update-alternatives: removing manually selected alternative - switching jar to auto mode
update-alternatives: removing manually selected alternative - switching jarsigner to auto mode
update-alternatives: removing manually selected alternative - switching javac to auto mode
update-alternatives: removing manually selected alternative - switching javadoc to auto mode
update-alternatives: removing manually selected alternative - switching javafxpackager to auto mode
update-alternatives: removing manually selected alternative - switching javah to auto mode
update-alternatives: removing manually selected alternative - switching javap to auto mode
update-alternatives: removing manually selected alternative - switching javapackager to auto mode
update-alternatives: removing manually selected alternative - switching jcmd to auto mode
update-alternatives: removing manually selected alternative - switching jconsole to auto mode
update-alternatives: removing manually selected alternative - switching jdb to auto mode
update-alternatives: removing manually selected alternative - switching jdeps to auto mode
update-alternatives: removing manually selected alternative - switching jhat to auto mode
update-alternatives: removing manually selected alternative - switching jinfo to auto mode
update-alternatives: removing manually selected alternative - switching jmap to auto mode
update-alternatives: removing manually selected alternative - switching jmc to auto mode
update-alternatives: removing manually selected alternative - switching jps to auto mode
update-alternatives: removing manually selected alternative - switching jrunscript to auto mode
update-alternatives: removing manually selected alternative - switching jsadebugd to auto mode
update-alternatives: removing manually selected alternative - switching jstack to auto mode
update-alternatives: removing manually selected alternative - switching jstat to auto mode
update-alternatives: removing manually selected alternative - switching jstatd to auto mode
update-alternatives: removing manually selected alternative - switching jvisualvm to auto mode
update-alternatives: removing manually selected alternative - switching native2ascii to auto mode
update-alternatives: removing manually selected alternative - switching rmic to auto mode
update-alternatives: removing manually selected alternative - switching schemagen to auto mode
update-alternatives: removing manually selected alternative - switching serialver to auto mode
update-alternatives: removing manually selected alternative - switching wsgen to auto mode
update-alternatives: removing manually selected alternative - switching wsimport to auto mode
update-alternatives: removing manually selected alternative - switching xjc to auto mode
update-alternatives: removing manually selected alternative - switching jexec to auto mode
update-alternatives: removing manually selected alternative - switching java to auto mode
update-alternatives: removing manually selected alternative - switching mozilla-javaplugin.so to auto mode
Removing java-common (0.58) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for shared-mime-info (1.8-1+deb9u1) ...
(Reading database ... 87884 files and directories currently installed.)
Purging configuration files for oracle-java8-installer (8u201-1~webupd8~1) ...
Purging configuration files for oracle-java8-unlimited-jce-policy (8u201-1~webupd8~1) ...
Then the state runs fine:
root@ci-nb1dc03-01 ~ # salt-call state.apply java
local:
----------
ID: openjdk-8-jre-headless
Function: pkg.installed
Result: True
Comment: 1 targeted package was installed/updated.
Started: 15:24:42.595589
Duration: 15203.377 ms
Changes:
----------
ca-certificates-java:
----------
new:
20170929~deb9u1
old:
java-common:
----------
new:
0.58
old:
java2-runtime-headless:
----------
new:
1
old:
java5-runtime-headless:
----------
new:
1
old:
java6-runtime-headless:
----------
new:
1
old:
java7-runtime-headless:
----------
new:
1
old:
java8-runtime-headless:
----------
new:
1
old:
libpcsclite1:
----------
new:
1.8.20-1
old:
libxtst6:
----------
new:
2:1.2.3-1
old:
openjdk-8-jre-headless:
----------
new:
8u212-b01-1~deb9u1
old:
Summary for local
------------
Succeeded: 2 (changed=1)
Failed: 0
------------
Total states run: 2
Total run time: 15.204 s
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Saltstack is failing to install a package, but said package can be manually installed perfectly fine
Last week one of our formulas that was working fine suddenly stopped properly installing required packages.
Because this just suddenly started happening in the last week or two and happens on 2 completely different vagrant setups it leads me to assume that it must be caused by an updated version of something, but I can't find anything that's been updated in the last couple weeks.
Here is the relevant error output from attempting to apply our topstate:
Setup
Centos 7 Vagrant 2.2.4 Virtualbox 5.2.26
Steps to Reproduce Issue
Test case Vagrantfile:
Test case sls:
Output from running the test case:
Versions Report
Versions from the test case Vagrant box: