Repository navigation
Closed
Labels
bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-low4th level, cosemtic problems, work around exists
Milestone
Description
From my debug logs:
[INFO ] Running state [curl] at time 15:52:40.171239
[INFO ] Executing state pkg.installed for curl
[INFO ] Executing command 'apt-get -q update' in directory '/root'
[INFO ] Executing command ['apt-get', '-q', '-y', '-o', 'DPkg::Options::=--force-confold', '-o', 'DPkg::Options::=--force-confdef', 'install', 'curl'] in directory '/root'
[INFO ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version} ${Architecture}\n' -W" in directory '/root'
[ERROR ] The following packages failed to install/update: curl.
The normal output:
----------
ID: curl
Function: pkg.installed
Result: False
Comment: The following packages failed to install/update: curl.
Changes:
----------
Some manual execution to troubleshoot this:
# apt-get -q -y -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-confdef install curl
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ip-10-151-76-86:~#
Also:
# dpkg-query --showformat='${Status} ${Package} ${Version} ${Architecture}\n' -W
...
purge ok installed curl 7.26.0-1+wheezy8 amd64
This situation came about because I wanted to test a state was successfully installing curl (although it must have been baked into the image anyway due to an apt-file dependency). From my xterm history:
# dpkg -P curl capcertificates
dpkg: dependency problems prevent removal of curl:
apt-file depends on curl.
debian-goodies depends on curl.
dpkg: error processing curl (--purge):
dependency problems - not removing
dpkg: warning: ignoring request to remove capcertificates which isn't installed
Errors were encountered while processing:
curl
The workaround was to manually reinstall the curl package:
# apt-get install --reinstall curl
I feel that this is a bug, and that I shouldn't have to do this to prevent a pkg.installed state failure.
# salt-call --versions-report
Salt: 2014.1.0-1-gf5d103f
Python: 2.7.3 (default, Jan 2 2013, 13:56:14)
Jinja2: 2.6
M2Crypto: 0.21.1
msgpack-python: 0.1.10
msgpack-pure: Not Installed
pycrypto: 2.6
PyYAML: 3.10
PyZMQ: 13.1.0
ZMQ: 3.2.3
Metadata
Metadata
Assignees
Labels
bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-low4th level, cosemtic problems, work around exists
Activity
basepi commentedon Feb 26, 2014
Can you clarify exactly what was wrong with the curl install? Seems like handling edge cases in non-standard installs is heading down a rabbit hole. Just trying to clarify exactly what went wrong and what we could have done differently.
boltronics commentedon Feb 27, 2014
The problem is that, even though I have a pkg.installed Salt state that says to install curl, it fails when the current dpkg selection state is set to purge. Note that by "fails", I mean the Salt state (and hence all dependencies) error out - this is not just a case of Salt not doing the right thing.
This situation should be trivial to reproduce with
dpkg -P curlon a Debian-based system, but of course the problem isn't package-specific.dpkg -P x11-commonor the attempt at uninstalling any other package which has installed dependencies would result in the same Salt breakage, where the package is specified using pkg.installed.Essentially, this means that we have indicated to dpkg that we wish to purge the package, but it is unable to do so at this time due to other installed packages depending on it. It is a perfectly valid state as far as the package manager is concerned - nothing non-standard about it - but Salt should be overriding this. If we tell Salt that we want a specified package to be installed, Salt should install it (if it is not already) and set the dpkg status to installed. That is the expected behavior.
Note that the presence of the dpkg purge selection status indicates that the package is already installed, so for illustration purposes, here's how you might solve this in bash:
I hope that makes a bit more sense.
basepi commentedon Feb 27, 2014
Ah, yes, that was exactly what I needed. I wasn't familiar with the "purge" state of a package under dpkg.
We definitely should handle this case, thanks!
"unpurge" packages marked for purge in pkg.installed states
terminalmage commentedon Mar 6, 2014
@boltronics Can you test from develop? I submitted a change yesterday which should handle this, and it was merged a few hours ago.
boltronics commentedon Mar 6, 2014
Thanks @terminalmage! I can't test develop immediately, but will try to find time over the weekend.
terminalmage commentedon Mar 6, 2014
Thanks. Regression tests on pkg installation passed, but we're not testing the edge case you brought up yet. In my testing though, on 12.04 LTS, I was able to confirm that a package marked
purgeis successfully set back toinstall."unpurge" packages marked for purge in pkg.installed states
basepi commentedon Mar 12, 2014
I'm going to close this one. But if it's still an issue, @boltronics, don't hesitate to comment and we'll re-open.
"unpurge" packages marked for purge in pkg.installed states
boltronics commentedon Mar 12, 2014
No worries @basepi, that's fine. Perhaps needless to say, I didn't get around to testing this yet as I had anticipated - sorry.
terminalmage commentedon Mar 12, 2014
@boltronics We're preparing for a 2014.1.1 release, so it'll be easier for you to test soon.
I did test quite a bit in my dev environment, so I'm confident this is resolved. If you notice that this doesn't appear to be fixed in 2014.1.1, please do not hesitate to let us know.
boltronics commentedon Mar 12, 2014
Nice one - thanks! Will do.