{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/30937","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/30937/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/30937/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/30937/events","html_url":"https://github.com/saltstack/salt/issues/30937","id":131644121,"number":30937,"title":"Debian: upgrading from 2015.8.3 with pkg.install fails","user":{"login":"anlutro","id":163093,"avatar_url":"https://avatars.githubusercontent.com/u/163093?v=3","gravatar_id":"","url":"https://api.github.com/users/anlutro","html_url":"https://github.com/anlutro","followers_url":"https://api.github.com/users/anlutro/followers","following_url":"https://api.github.com/users/anlutro/following{/other_user}","gists_url":"https://api.github.com/users/anlutro/gists{/gist_id}","starred_url":"https://api.github.com/users/anlutro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anlutro/subscriptions","organizations_url":"https://api.github.com/users/anlutro/orgs","repos_url":"https://api.github.com/users/anlutro/repos","events_url":"https://api.github.com/users/anlutro/events{/privacy}","received_events_url":"https://api.github.com/users/anlutro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Critical","name":"Critical","color":"e95800"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Packaging","name":"Packaging","color":"006b75"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2858,"closed_issues":3300,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-02-06T00:29:05Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-02-05T13:28:00Z","updated_at":"2016-02-07T17:40:20Z","closed_at":null,"body":"```\r\nandeas@orch:~$ salt 'elk*' pkg.install salt-minion refresh=True\r\nelk.test.infra.vagrant.local:\r\n    Minion did not return. [No response]\r\n\r\nroot@elk:/var/log/apt# apt-get install\r\nE: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.\r\n\r\nroot@elk:/var/log/apt# dpkg --configure -a\r\nSetting up python-tz (2012c+dfsg-0.1) ...\r\ndpkg: error processing package salt-minion (--configure):\r\n package is in a very bad inconsistent state; you should\r\n reinstall it before attempting configuration\r\nSetting up python-croniter (0.3.4-1) ...\r\nErrors were encountered while processing:\r\n salt-minion\r\n\r\nroot@elk:/var/log/apt# apt-get install\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nYou might want to run 'apt-get -f install' to correct these.\r\nThe following packages have unmet dependencies:\r\nE: Unmet dependencies. Try using -f.\r\n\r\nroot@elk:/var/log/apt# apt-get install -f\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nCorrecting dependencies... Done\r\nThe following packages were automatically installed and are no longer required:\r\n  python-mako\r\nUse 'apt-get autoremove' to remove them.\r\nThe following extra packages will be installed:\r\n  salt-common salt-minion\r\nSuggested packages:\r\n  python-augeas\r\nThe following packages will be upgraded:\r\n  salt-common salt-minion\r\n2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\r\n1 not fully installed or removed.\r\nNeed to get 0 B/3,132 kB of archives.\r\nAfter this operation, 569 kB of additional disk space will be used.\r\nDo you want to continue? [Y/n] n\r\nAbort.\r\n```\r\n\r\nOddly enough, if I SSH into the box and manually run the exact same `apt-get install` command that salt does (based on the minion logs), the package installs just fine.\r\n\r\n```\r\n$ apt-get -q -y -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-confdef install salt-minion\r\n```\r\n\r\nThis happens when upgrading from 2015.8.3 to .4 or .5. Upgrading from .4 to .5 went fine.\r\n\r\ndpkg.log:\r\n```\r\n2016-02-05 14:40:42 startup archives unpack\r\n2016-02-05 14:40:42 upgrade salt-minion:all 2015.8.3+ds-1 2015.8.5+ds-1\r\n2016-02-05 14:40:42 status half-configured salt-minion:all 2015.8.3+ds-1\r\n```\r\n\r\napt/history.log:\r\n```\r\nStart-Date: 2016-02-05  14:40:42\r\nCommandline: apt-get -q -y -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-confdef install salt-minion\r\nUpgrade: salt-minion:amd64 (2015.8.3+ds-1, 2015.8.5+ds-1), salt-common:amd64 (2015.8.3+ds-1, 2015.8.5+ds-1)\r\n```\r\n\r\napt/term.log:\r\n```\r\nLog started: 2016-02-05  14:40:42\r\n(Reading database ... 55552 files and directories currently installed.)\r\nPreparing to unpack .../salt-minion_2015.8.5+ds-1_all.deb ...\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/181058746","html_url":"https://github.com/saltstack/salt/issues/30937#issuecomment-181058746","issue_url":"https://api.github.com/repos/saltstack/salt/issues/30937","id":181058746,"user":{"login":"cmarzullo","id":5658388,"avatar_url":"https://avatars.githubusercontent.com/u/5658388?v=3","gravatar_id":"","url":"https://api.github.com/users/cmarzullo","html_url":"https://github.com/cmarzullo","followers_url":"https://api.github.com/users/cmarzullo/followers","following_url":"https://api.github.com/users/cmarzullo/following{/other_user}","gists_url":"https://api.github.com/users/cmarzullo/gists{/gist_id}","starred_url":"https://api.github.com/users/cmarzullo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmarzullo/subscriptions","organizations_url":"https://api.github.com/users/cmarzullo/orgs","repos_url":"https://api.github.com/users/cmarzullo/repos","events_url":"https://api.github.com/users/cmarzullo/events{/privacy}","received_events_url":"https://api.github.com/users/cmarzullo/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T17:40:19Z","updated_at":"2016-02-07T17:40:19Z","body":"I've solved this issue by scheduling the upgrade with at. Suboptimal, but it does work. It won't fix your broken installs though.\r\n```\r\n# jobs/schedule_salt_upgrade.sls\r\njobs_salt_upgrade_script:\r\n  file.managed:\r\n    - name: '/tmp/salt_upgrade.sh'\r\n    - source: 'salt://jobs/files/salt_upgrade.sh'\r\n    - mode: 0700\r\n    - user: root\r\n    - group: root\r\n\r\njobs_salt_upgrade_schedule:\r\n  at.present:\r\n    - job: '/tmp/salt_upgrade.sh'\r\n    - timespec: 'now +5 min'\r\n    - user: root\r\n```\r\n```\r\n#jobs/files/salt_upgrade.sh\r\n#!/bin/bash\r\n# Find salt packages to upgrade\r\nsalt_pkgs=$(dpkg-query -l 'salt*' | egrep '^ii' | awk  '{print $2}' | tr '\\n' ' ')\r\n\r\n# Upgrade salt packages\r\napt-get install -o Dpkg::Options::=\"--force-confold\" $salt_pkgs -y\r\n\r\n# remove any unused packages\r\napt-get autoremove -y\r\n\r\n# clean up\r\nrm /tmp/salt_upgrade.sh\r\n```"}}