keeleysam / munki-exported

Automatically exported from code.google.com/p/munki
Other
0 stars 0 forks source link

Munki 2 - MSC did not refresh update status after multiple software updates #293

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Have several applications requiring updates (I had firefox, Chrome, Skype, 
Office2011 and several others)
2. Perform "update all"
3. Leave the update window visible (monitoring progress)

What is the expected output? What do you see instead?
Expect to see updates removed from this window as they are done. Instead all 
bar one update was still visible as pending update with no way in the GUI to 
force a re-check (issue #281).

Clicking "update" has no effect (in fact in the log it performs 
managedsoftwareupdate run: installwithnologout and finishes straight away)

The updates have been installed, just that MSC does not reflect this without 
looking at the log or restarting MSC (which gives a warning that there are 
pending updates).

What version of the Munki tools/InstallOSpkg tools are you using? On what
version of OS X?
MSU 4.0.1929
OS C 10.9.2

Please provide any additional information below.

Original issue reported on code.google.com by bart.rea...@gmail.com on 7 Mar 2014 at 2:47

GoogleCodeExporter commented 9 years ago
I have verified this on another machine. The only common update was Office 2011 
which disappeared from the update list.

MSC does not reflect the system state until managedsoftwareupdate has run again.

Original comment by bart.rea...@gmail.com on 7 Mar 2014 at 4:44

GoogleCodeExporter commented 9 years ago
Some additional info.

Office2011_update is the only entry in the managed_updates key of my manifest. 
The latest 14.3.9 was imported using autopkg. Office itself is a managed 
install.

All other updates are from apps listed in optional_installs

Original comment by bart.rea...@gmail.com on 7 Mar 2014 at 4:53

GoogleCodeExporter commented 9 years ago
A question that might lead to a factor here:

Why do you have Office2011_update in managed_updates?

managed_updates should be the exact same sort of things that you would put in 
managed_installs -- the big differences is that items listed in managed_updates 
are not installed if they don't exist on the machine, but they are kept 
up-to-date if some version is installed.  Items in managed_installs are not 
only kept updated, but are also installed if not found on the machine.

In either case, things like "Office2011_update" are not normally added to any 
manifest. Instead, they are marked as an update_for some other item; in this 
case "Office2011_update" would be marked as an update_for "Office2011".

Original comment by gregnea...@mac.com on 7 Mar 2014 at 5:01

GoogleCodeExporter commented 9 years ago
> Why do you have Office2011_update in managed_updates?

Probably a hangover of when I had the update in there but not Office (was 
populating the repo from autopkg). After fixing up the dependancies I didn't 
realise the update didn't need to be in managed_updates now the repo for Office 
was complete. I'll take it out and give that a try.

Original comment by bart.rea...@gmail.com on 7 Mar 2014 at 5:27

GoogleCodeExporter commented 9 years ago
Even if taking Office2011_update out of your managed_updates causes the issue 
to go away, I'd still want to understand what's happening. 

Original comment by gregnea...@mac.com on 7 Mar 2014 at 5:30

GoogleCodeExporter commented 9 years ago
Here's my log from the last run. same issue

Mar 07 2014 16:47:09 +1100 ### Starting managedsoftwareupdate run: 
installwithnologout ###
Mar 07 2014 16:47:09 +1100 Starting...
Mar 07 2014 16:47:10 +1100 ### Beginning managed installer session ###
Mar 07 2014 16:47:10 +1100 Processing installs
Mar 07 2014 16:47:10 +1100 Installing Office 2011 14.3.9 Update (1 of 2)
Mar 07 2014 16:47:10 +1100 DEBUG1: suppress_bundle_relocation: False
Mar 07 2014 16:47:10 +1100     Mounting disk image 
Office2011-1439Update_EN-US-14.3.9.dmg
Mar 07 2014 16:47:13 +1100 Installing Office 2011 14.3.9 Update from Office 
2011 14.3.9 Update.pkg
Mar 07 2014 16:47:21 +1100  Package name is Office 2011 14.3.9 Update
Mar 07 2014 16:47:21 +1100  Installing at base path /
Mar 07 2014 16:47:21 +1100     Preparing for installation…
Mar 07 2014 16:47:23 +1100     Preparing the disk…
Mar 07 2014 16:47:23 +1100     Preparing Office 2011 14.3.9 Update…
Mar 07 2014 16:47:28 +1100     Waiting for other installations to complete…
Mar 07 2014 16:47:29 +1100     Configuring the installation…
Mar 07 2014 16:47:29 +1100     Validating packages…
Mar 07 2014 16:47:30 +1100     Validating packages…

… 

Mar 07 2014 16:51:16 +1100     Writing package receipts…
Mar 07 2014 16:51:17 +1100     Validating packages…
Mar 07 2014 16:51:18 +1100     Running installer actions…
Mar 07 2014 16:51:18 +1100     Finishing the Installation…
Mar 07 2014 16:51:18 +1100     The software was successfully installed.
Mar 07 2014 16:51:18 +1100  The install was successful.
Mar 07 2014 16:51:18 +1100 Install of Office 2011 14.3.9 Update was successful.
Mar 07 2014 16:51:18 +1100 Installing VLC Media Player (2 of 2)
Mar 07 2014 16:51:18 +1100     Mounting disk image vlc-2.1.4.dmg
Mar 07 2014 16:51:26 +1100     Copying VLC.app to /Applications/VLC.app
Mar 07 2014 16:51:34 +1100     Setting owner for '/Applications/VLC.app' to 
'root'
Mar 07 2014 16:51:34 +1100     Setting group for '/Applications/VLC.app' to 
'admin'
Mar 07 2014 16:51:34 +1100     Setting mode for '/Applications/VLC.app' to 'o-w'
Mar 07 2014 16:51:34 +1100     The software was successfully installed.
Mar 07 2014 16:51:34 +1100 ERROR: Unexpected error in munkilib.installer:
Mar 07 2014 16:51:34 +1100 Traceback (most recent call last):
  File "/usr/local/munki/managedsoftwareupdate", line 221, in doInstallTasks
    munki_need_to_restart = installer.run(only_unattended=only_unattended)
  File "/usr/local/munki/munkilib/installer.py", line 1237, in run
    for removal in munkicommon.report['RemovalResults']:
KeyError: 'RemovalResults'

Original comment by bart.rea...@gmail.com on 7 Mar 2014 at 5:57

GoogleCodeExporter commented 9 years ago
Tested this again on a clean install of OS X and manifests configured correctly 
this time (Office2011 in managed_updates and Office2011_Update with update_for)

I did not get the error in munkilib.installer as I did previously however the 
following did happen:

MSC reported updated for Office 2011, VLC, Firefox and Citrix Receiver. The 
latter three were updates for optional installs so I added them to the list of 
software to be updated, Office was being updated from 14.2.0 to 14.3.8.

Monitoring the logs, all updates were applied without error.

After the update run, VLC, Firefox and Citrix Receiver still appeared in the 
Updates tab. manually running managedsoftwareupdate forces the gui to update 
and these then disappeared.

Original comment by bart.rea...@gmail.com on 10 Mar 2014 at 11:37

GoogleCodeExporter commented 9 years ago
Please retest your scenarios with the current code.

Original comment by gregnea...@mac.com on 11 Mar 2014 at 11:32

GoogleCodeExporter commented 9 years ago
Tested with Office2011, VLC and Firefox.

Office2011 and VLC disappeared from the updates tab. Firefox remains despite 
having been updated. Disappears once managedsoftwareupdate is run manually.

That was a quick test by uninstalling software and re-installing old versions. 
Will try again from a clean install and report back.

Original comment by bart.rea...@gmail.com on 12 Mar 2014 at 12:22

GoogleCodeExporter commented 9 years ago
I'd really like enough information to be able to attempt to reproduce this sort 
of thing. Can you provide the contents of the relevant manifest?

"Tested with Office2011, VLC and Firefox" could mean many things; a manifest 
would be much more concrete.

Original comment by gregnea...@mac.com on 12 Mar 2014 at 12:32

GoogleCodeExporter commented 9 years ago
ManagedSoftware manifest

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>catalogs</key>
    <array>
        <string>SMP</string>
    </array>
    <key>included_manifests</key>
    <array>
        <string>additionalSoftware</string>
        <string>ADConditionManifest</string>
    </array>
</dict>
</plist>

additionalSoftware manifest

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>catalogs</key>
    <array/>
    <key>managed_installs</key>
    <array/>
    <key>managed_updates</key>
    <array>
        <string>Office2011</string>
    </array>
    <key>optional_installs</key>
    <array>
        <string>AdobeReader</string>
        <string>Chrome</string>
        <string>CiscoJabber</string>
        <string>CitrixReceiver</string>
        <string>Firefox</string>
        <string>Flip4Mac</string>
        <string>Flux</string>
        <string>GIMP</string>
        <string>GoogleEarth</string>
        <string>Handbrake</string>
        <string>Jabber Video</string>
        <string>Mac Game Store</string>
        <string>Office2011</string>
        <string>Skype</string>
        <string>TextWrangler</string>
        <string>Transmit</string>
        <string>VirtualBox</string>
        <string>VLC media player</string>
        <string>XQuartz</string>
    </array>
</dict>
</plist>

Original comment by bart.rea...@gmail.com on 12 Mar 2014 at 12:39

GoogleCodeExporter commented 9 years ago
OK, this is helpful. When you removed Office2011, VLC, and Firefox, and then 
checked for updates, what items showed up? How many items for Office2011+ 
updates? What happens when you click on each update?

Original comment by gregnea...@mac.com on 12 Mar 2014 at 12:41

GoogleCodeExporter commented 9 years ago
initial removal, there were no updates. Then I installed Firefox 16, VLC 2.0.8 
and Office 14.2.0. Updates for this software then appeared in MSC. Only one 
update for Office (14.3.8)

Interestingly, the updates for VLC and Firefox were already selected (added to 
the updates to process). I presume this is a preference cached from the 
previous run where these were selected.

Forgot to mention, all machines get the ManagedSoftware manifest. 
ADConditionalManifest is populated by munkidirectory 
(https://github.com/ofense74/munkidirectory) which does the AD group checking. 
I can remove the manifest if you think it could be a contributing factor 
however the munkidirectory plugin wasn't installed on this run (it was 
installed on another system with the same symptoms)

Original comment by bart.rea...@gmail.com on 12 Mar 2014 at 12:56

GoogleCodeExporter commented 9 years ago
re-ran on the current mac image which requires updates. The issue is still 
present.

Screenshots of the process attached. Let me know if you would like any other 
output or files.

Original comment by bart.rea...@gmail.com on 12 Mar 2014 at 2:18

Attachments:

GoogleCodeExporter commented 9 years ago
I need to be sure about this: you _did_ install _all_ the packages that are 
part of the Munki 2 mpkg? This isn't a session with MSC.app running against the 
1.x command-line tools?

Original comment by gregnea...@mac.com on 12 Mar 2014 at 2:53

GoogleCodeExporter commented 9 years ago
Additionally, it's not clear to me if any of this ever works as expected for 
you, or if you've found an edge case. Have you tested other combinations of 
updates and installs/

Original comment by gregnea...@mac.com on 12 Mar 2014 at 2:56

GoogleCodeExporter commented 9 years ago
this was a clean install of munki 2. The test install has never had munki 1 on 
it.

The update process works fine if I move applications to managed_installs and 
MSC behaves as expected (update happens, view refreshes and no pending 
updates). If the applications are in optional_installs then MSC does not 
reflect that updates for those have been installed, even though they have.

Original comment by bart.rea...@gmail.com on 12 Mar 2014 at 3:27

GoogleCodeExporter commented 9 years ago
jsut to be sure, I'm re-compiling the latest munki2 code in a new clone, rather 
than pull updates to my existing clone.

Original comment by bart.rea...@gmail.com on 12 Mar 2014 at 3:30

GoogleCodeExporter commented 9 years ago
with a fresh build of latest munki2:

Firefox configured as a managed_install
VLC configured as an optional_install

system pre-loaded with older version of each.

MSC lists firefox as a pending update and VLC needs to be added. I add VLC to 
the updates and run update now. Watching the logs I see both apps are updates. 
After the update run, firefox is removed from the updates list, vlc is still 
listed. Manually running managedsoftwareupdate in terminal updates MSC to 
reflect that app updates have been applied.

Other conditions that may be worth noting:
updates in my repo were added using autopkg to keep thinks up to date.
the optional installs being updates were not initially installed by munki, e.g. 
vlc 2.0.8 and firefox were installed via manual drag and drop from a DMG. I 
haven't tested importing older versions into munki, installing them via MSC 
then importing an update and have MSC apply the updates.
most of the packages were originally imported to the repo using munkitools 1.x

Not sure how many of the above are contributing. let me know if you want to see 
pkgsinfo plists etc.

Original comment by bart.rea...@gmail.com on 12 Mar 2014 at 3:59

GoogleCodeExporter commented 9 years ago
Finally got enough time to set things up to reproduce this issue, and I can 
successfully reproduce.

Original comment by gregnea...@mac.com on 14 Mar 2014 at 10:54

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 52695b9c6a76.

Original comment by gregnea...@mac.com on 14 Mar 2014 at 11:25

GoogleCodeExporter commented 9 years ago
This scenario should now behave as expected.

Original comment by gregnea...@mac.com on 14 Mar 2014 at 11:26

GoogleCodeExporter commented 9 years ago
Comment for the record that revision 52695b9c6a76 did fix the issue.

Original comment by bart.rea...@gmail.com on 18 Mar 2014 at 11:34