The state pkg.installed works as expected and installs package from external source, but it returns true which prevents depending states from being executed.
This issue has just popped out on our older code base, which was not changed last days and used to work with previous releases of saltstack.
State:
jenkins:
pkg.installed:
- hold: True
- sources:
- jenkins: https://jenkins.korekontrol.net/get/package/jenkins_1.651.3_all.deb
disable-jenkins-service:
service.dead:
- name: jenkins
- enable: False
- require:
- pkg: jenkins
[DEBUG ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[DEBUG ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[DEBUG ] Requesting URL https://jenkins.korekontrol.net/get/package/jenkins_1.651.3_all.deb using GET method
[DEBUG ] Using backend: tornado
[INFO ] Executing command [u'dpkg', u'-I', u'/var/cache/salt/minion/extrn_files/dev/jenkins.korekontrol.net/get/package/jenkins_1.651.3_all.deb'] in directory '/root'
[INFO ] Executing command [u'apt-get', u'-q', u'-y', u'-o', u'DPkg::Options::=--force-confold', u'-o', u'DPkg::Options::=--force-confdef', u'install', 'daemon', 'net-tools'] in directory '/root'
[DEBUG ] stdout: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
daemon net-tools
0 upgraded, 2 newly installed, 0 to remove and 67 not upgraded.
Need to get 344 kB of archives.
After this operation, 1244 kB of additional disk space will be used.
Get:1 http://cloudfront.debian.net/debian stretch/main amd64 daemon amd64 0.6.4-1+b2 [96.0 kB]
Get:2 http://cloudfront.debian.net/debian stretch/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1 [248 kB]
Fetched 344 kB in 0s (773 kB/s)
Selecting previously unselected package daemon.
(...)
(Reading database ... 74092 files and directories currently installed.)
Preparing to unpack .../daemon_0.6.4-1+b2_amd64.deb ...
Unpacking daemon (0.6.4-1+b2) ...
Selecting previously unselected package net-tools.
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up daemon (0.6.4-1+b2) ...
Setting up net-tools (1.60+git20161116.90da8a0-1) ...
[INFO ] Executing command [u'apt-mark', u'auto', 'daemon', 'net-tools'] in directory '/root'
[DEBUG ] stdout: daemon set to automatically installed.
net-tools set to automatically installed.
[DEBUG ] output: daemon set to automatically installed.
net-tools set to automatically installed.
[INFO ] Executing command [u'dpkg', u'--get-selections', u'*'] in directory '/root'
[INFO ] Executing command [u'systemd-run', u'--scope', u'dpkg', u'-i', u'--force-confold', u'/var/cache/salt/minion/extrn_files/dev/jenkins.korekontrol.net/get/package/jenkins_1.651.3_all.deb'] in directory '/root'
[INFO ] Executing command [u'dpkg-query', u'--showformat', u'${Status} ${Package} ${Version} ${Architecture}', u'-W'] in directory '/root'
[ERROR ] {u'installed': {u'jenkins': {u'new': u'1.651.3', u'old': u''}, u'daemon': {u'new': u'0.6.4-1+b2', u'old': u''}, u'net-tools': {u'new': u'1.60+git20161116.90da8a0-1', u'old': u''}}}
jenkins failed and other states, which depend on it, were not executed: ID: jenkins
Function: pkg.installed
Result: False
Comment: Only one of pkgs or sources can be specified.
Started: 13:31:27.502811
Duration: 13049.857 ms
Changes:
----------
installed:
----------
daemon:
----------
new:
0.6.4-1+b2
old:
jenkins:
----------
new:
1.651.3
old:
net-tools:
----------
new:
1.60+git20161116.90da8a0-1
old:
----------
ID: disable-jenkins-service
Function: service.dead
Name: jenkins
Result: False
Comment: One or more requisite failed: jenkins.install.jenkins
Started: 13:31:41.965941
Duration: 0.047 ms
Changes:
Masterless setup
Salt Version: 2018.3.3
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.5.3
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.13 (default, Nov 24 2017, 17:33:09)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.4.3
ZMQ: 4.2.1
System Versions:
dist: debian 9.5
locale: UTF-8
machine: x86_64
release: 4.9.0-7-amd64
system: Linux
version: debian 9.5
looks like i'm able to replcate this and git bisect shows 998651102d128e26b4163816bafca58a17896209 which is from this PR https://github.com/saltstack/salt/pull/48426
ping @garethgreenaway can you take a look here?
@Ch3LL On it.
I've checked branch 2018.3 and it worked well for me.
Hi,
seems that this problem also occurs to 2017.7.8 ... is there a backport planned/done?
@Reiner030 until fix gets released, I'm manually pinpointing apt packages / vagrant to use 2017.7.7... hope it helps :)
Thx @marek-obuchowicz for common fix but luckily no problem here;
2nd call gone through because package is found and since we have not every day new instances to setup I can do this manually. But would be nice to be fixed also in old version.
@Reiner030 Thanks, I've marked it to be back-ported to 2017.7.
Hello!
I'm not really into your release life cycles, could anybody say when this fix will be released in 2018.3?
@Magomogo This fix will be available in 2018.3.4 which we're hoping to release soon. Unfortunately, we do not have a concrete date yet.