Looping with HP Printer Software Update-3.1

112 views
Skip to first unread message

Stuart Ramdeen

unread,
Jul 1, 2016, 7:27:31 AM7/1/16
to munk...@googlegroups.com
Thought I'd start a new thread because this isn't Sierra specific, but it was mentioned in that thread.

I've just experienced the HP Printer Drivers 3.1 looping. However, this is under 10.10.5 and 2.7.1.2775

    The following Apple Software Updates are available to install:
        + OS X Yosemite Recovery Update-1.0
        + iTunes-12.4.1
        + OS X Update Combined-10.10.5
           *Restart required
        + HP Printer Software Update-3.1
Installing available Apple Software Updates...
    softwareupdate cmd: ['/usr/local/munki/ptyexec', '/usr/sbin/softwareupdate', '--verbose', '-i', u'OS X Yosemite Recovery Update 1.0-1.0', u'iTunesX-12.4.1', u'OSXUpdCombo10.10.5-10.10.5', u'-3.1']
    softwareupdate: invalid option -- 3...
    usage: softwareupdate <mode> [<args> ...]...
    ** Catalog Management:...
    --set-catalog <URL> Set the new catalog URL (requires privileges)...
    --clear-catalog Clear the catalog URL back to defaults (requires privileges)...
    ** Manage Updates:...
    -l | --list List all appropriate update labels...
    -d | --download Download Only...
    -i | --install Install...
    <label> ... specific updates...
    -a | --all All appropriate updates...
    -r | --recommended Only recommended updates...
    --ignore <label> ... Ignore specific updates...
    --reset-ignored Clear all ignored updates...
    --schedule (on | off) Set automatic checking...
    -v | --verbose Enable verbose output...
    -h | --help Print this help...
    Raw Apple Update install results: {'download': [], 'failures': [], 'installed': []}
WARNING: Apple update OS X Yosemite Recovery Update, 031-20634 may have failed to install. No record of success or failure.
WARNING: Apple update iTunes, zzzz031-63213 may have failed to install. No record of success or failure.
WARNING: Apple update OS X Update Combined, 031-30888 may have failed to install. No record of success or failure.
WARNING: Apple update HP Printer Software Update, 031-07832 may have failed to install. No record of success or failure.
ERROR: softwareupdate error: 1


# softwareupdate -l -v
Software Update Tool
Copyright 2002-2012 Apple Inc.

Finding available software
Software Update found the following new or updated software:
   * 031-07832-3.1
HP Printer Software Update (3.1), 435K [recommended]
   * OS X Yosemite Recovery Update 1.0-1.0
OS X Yosemite Recovery Update (1.0), 491587K [recommended]
   * OSXUpdCombo10.10.5-10.10.5
OS X Update Combined (10.10.5), 2071194K [recommended] [restart]
   * iTunesX-12.4.1
iTunes (12.4.1), 231924K [recommended]

as listed in reposado:

031-07832       HP Printer Software Update                         3.1        2015-06-18

Looks like some kind of parsing error, but I fear it's beyond my ability to debug & fix, so over to the experts! :-)

What else do you need from me?

I've pulled the update from the branch for now and all is well again.

S

Mike Solin

unread,
Jul 1, 2016, 10:16:07 AM7/1/16
to munk...@googlegroups.com
Different animal, I know, but I’m successfully pushing them with Nate Felton’s AutoPkg recipe:


All else fails, you might be able to use that.

To troubleshoot this, though, I have a few suggestions:

- Is the network connection being dropped?  I see those “no record of success or failure” when people close the lids of their laptops.
- Rebooting seems to clear up some Apple SUS updates from failing to install - I saw that with the latest iTunes update for some machines.
- Check /var/log/install.log to see if it’s getting to the installation stage, and if so, where it’s failing.
- Run repo_sync --recheck on your Reposado server, in case it didn’t fully download that package.
--
Find related discussion groups here:
https://github.com/munki/munki/wiki/Discussion-Group
---
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
To post to this group, send email to munk...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gregory Neagle

unread,
Jul 1, 2016, 1:56:35 PM7/1/16
to munk...@googlegroups.com
Here's the problem.

In the last official release (and earlier), Munki used an undocumented flag (-f) when getting the list of available updates. This causes softwareupdate to write certain data about the available updates to a plist file, which Munki then parses.

A few months ago I decided I needed to rewrite some chunks of the appleupdates.py code to improve performance in El Cap (and probably later), and at that same time, I decided to replace any code that relied on undocumented functionality.  That was prescient, as 10.12 Sierra's softwareupdate no longer supports the '-f' flag.

One bit of data for each update in the -f plist output was the 'ignoreKey':

<dict>
<key>description</key>
<string></string>
<key>ignoreKey</key>
<string>Chinese Word List Update</string>
<key>ignored</key>
<false/>
<key>license</key>
<string></string>
<key>name</key>
<string>Chinese Word List Update</string>
<key>productKey</key>
<string>031-64878</string>
<key>restartRequired</key>
<string>NO</string>
<key>sizeInKB</key>
<integer>183</integer>
<key>version</key>
<string>4.18</string>
</dict>

This was the name you would give to softwareupdate at the command-line for two things: 1) as input for the --ignore option:

    --ignore identifier ...
                 Manages the per-machine list of ignored updates. The identifier is the first part of the item name (before the dash and version number) that is shown by
                 --list.  See EXAMPLES.
<snip>

     sudo softwareupdate --ignore JavaForOSX

           Ignored updates:
           (JavaForOSX)


2) as input for the -d/--download and -i/--install options, this time combined with a hyphen and the version number:

     -i | --install
                 Each update specified by args is downloaded and installed.  args can be one of the following:

                 -r | --recommended
                             All updates that are recommended for your system. These are prefixed with a * character in the --list output.

                 -a | --all  All updates that are applicable to your system, including those non-recommended ones, which are prefixed with a - character in the --list output.
                             (Non-recommended updates are uncommon in any case.)

                 item ...    One or more specified updates. The --list output shows the item names you can specify here, prefixed by the * or - characters. See EXAMPLES.

     -d | --download
                 Each update specified by args is downloaded but not installed. The values of args are the same as for the --install command. Updates downloaded with
                 --download can be subsequently installed with --install, or through the App Store (as long as they remain applicable to your system).  Updates are downloaded
                 to /Library/Updates, but are not designed to be installed by double-clicking the packages in that directory: always use --install or the App Store to actu-
                 ally perform the install.
<snip>

     sudo softwareupdate --install JavaForOSX-1.0

           Software Update Tool
           Copyright 2002-2012 Apple Inc.

           Finding available software

           Downloading Java for OS X 2012-005
           Downloaded Java for OS X 2012-005
           Installing Java for OS X 2012-005
           Done with Java for OS X 2012-005
           Done.

So in the new code, instead of relying on the plist created by the undocumented -f option, I parse the .dist files for the updates directly. The key we're looking for is "normally" stored as suDisabledGroupID in the choice with id="su" or id="auto":

From 031-58986.English.dist:

    <choices-outline ui="SoftwareUpdate">
        <line choice="su"/>
    </choices-outline>
    <choices-outline>
        <line choice="su"/>
    </choices-outline>
    <choice id="su" title="SU_TITLE" versStr="SU_VERS" description="SU_DESCRIPTION" description-mime-type="text/html" secondaryDescription="SU_SERVERCOMMENT" suDisabledGroupID="SafariTechPreviewElCapitan" start_selected="true" visible="DoesntHaveNewerOrSameWebkit('/')">
        <pkg-ref id="SafariElCapitan" auth="Root" packageIdentifier="com.apple.pkg.SafariTechPreviewElCapitan">SafariTechPreviewElCapitan.pkg</pkg-ref>
    </choice>

 and from 031-64856.English.dist:

    <choices-outline ui="SoftwareUpdate">
        <line choice="su"/>
    </choices-outline>
    <choices-outline>
        <line choice="su"/>
    </choices-outline>
    <choice description="SU_DESCRIPTION" description-mime-type="text/html" id="su" secondaryDescription="SU_SERVERCOMMENT" start_selected="true" suDisabledGroupID="XProtectPlistConfigData" title="SU_TITLE" versStr="SU_VERS" visible="PlistCheck0('/')">
        <pkg-ref auth="Root" id="XProtectPlistConfigData_1011" packageIdentifier="com.apple.pkg.XProtectPlistConfigData.14U4047">XProtectPlistConfigData_1011.pkg</pkg-ref>
    </choice>

But now it appears that some updates don't have that attribute.

From 031-07832.English.dist:

   <!-- SU outline -->
    <choices-outline ui='SoftwareUpdate'>
        <line choice='auto'/>
    </choices-outline>
    <!-- end SU outline -->
    <!-- SU choice -->
    <choice id='auto' title='SU_TITLE' versStr='SU_VERS'/>
    <choice id='auto' description='SU_DESCRIPTION' description-mime-type='text/html'/>
    <choice id='auto' secondaryDescription='SU_DESC2'/>
    <choice id='auto' visible='true'/>
    <!-- end SU choice -->

and from 031-07834.English.dist:

    <!-- SU outline -->
    <choices-outline ui='SoftwareUpdate'>
        <line choice='auto'/>
    </choices-outline>
    <!-- end SU outline -->
    <!-- SU choice -->
    <choice id='auto' title='SU_TITLE' versStr='SU_VERS'/>
    <choice id='auto' description='SU_DESCRIPTION' description-mime-type='text/html'/>
    <choice id='auto' secondaryDescription='SU_DESC2'/>
    <choice id='auto' visible='true'/>
    <!-- end SU choice -->


The net effect is that the required name that Munki is trying to use is empty. So instead of doing:

/usr/sbin/softwareupdate -i Foo-3.0

it's doing:

/usr/sbin/softwareupdate -i -3.0

To fix this, we need to discover what Apple's softwareupdate is using for the identifier when suDisabledGroupID is missing. I suspect it is the 'title' attribute, which for 031-07832.English.dist evaluates to "HP Printer Software Update", as this matches what we see in the output of `softwareupdate -l` . But is it the _English_ title in every case?  More investigation and experimentation is needed.


-Greg


Gregory Neagle

unread,
Jul 5, 2016, 7:23:01 PM7/5/16
to munk...@googlegroups.com
I believe this change: https://github.com/munki/munki/commit/5f19717a3489ab73e564241be42863dd42a958ea addresses this issue.

This change is also available as part of this build:  https://munkibuilds.org/2.7.1.2780/

-Greg

Stuart Ramdeen

unread,
Jul 6, 2016, 5:00:14 AM7/6/16
to munk...@googlegroups.com
w00t. Will test asap and report back.

Michael Mohr

unread,
Jul 6, 2016, 11:31:13 AM7/6/16
to munki-dev
I'm on macOS build 16A239j (Sierra Beta 2) and munki 2.7.1.2780... Below is my -vvv output (Items not related to the apple update removed), It's not installing the HP Printer Update 3.1... Do I need to give more info to be helpful? Thanks for all the hard work! :) This program transformed the IT Department!

Michael Mohr

Last login: Wed Jul  6 10:22:46 on ttys000

D1309-AP-201MMOHR:~ mmohr$ sudo managedsoftwareupdate --version

Password:

2.7.1.2780

D1309-AP-201MMOHR:~ mmohr$ sudo managedsoftwareupdate -vvv

Managed Software Update Tool

Copyright 2010-2016 The Munki Project

https://github.com/munki/munki


Starting...

    No CA cert info provided, so nothing to add to System keychain.

    No client cert info provided, so no client keychain will be created.


Checking Apple Software Update catalog...

    Caching CatalogURL https://swscan.apple.com/content/catalogs/others/index-10.12seed-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz

    Options: {'logging_function': <function display_debug2 at 0x112378cf8>, 'additional_headers': {'User-Agent': u'managedsoftwareupdate/2.7.1.2780 Darwin/16.0.0 (x86_64) (MacPro5,1)'}, 'file': '/tmp/munki_swupd_cache/mirror/apple.sucatalog.download', 'cache_data': {

    etag = "\"54f03-536f040658800\"";

    "last-modified" = "Wed, 06 Jul 2016 04:46:24 GMT";

}, 'url': u'https://swscan.apple.com/content/catalogs/others/index-10.12seed-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz', 'follow_redirects': True, 'download_only_if_changed': True, 'can_resume': True}

    URLSession_task_didReceiveChallenge_completionHandler_

    Authentication challenge for Host: swscan.apple.com Realm: None AuthMethod: NSURLAuthenticationMethodServerTrust

    Allowing OS to handle authentication request

    Status: 304

    Headers: {u'Expires': u'Wed, 06 Jul 2016 19:24:16 GMT', u'Keep-Alive': u'timeout=15, max=389', u'Server': u'Apache', u'Connection': u'Keep-Alive', u'Etag': u'"54f03-536f040658800"', u'Cache-Control': u'max-age=14400', u'Date': u'Wed, 06 Jul 2016 15:24:16 GMT'}

    Item is unchanged on the server.

    /tmp/munki_swupd_cache/mirror/apple.sucatalog already exists and is up-to-date.

    Skipping Apple Software Update check because sucatalog is unchanged, installed Apple packages are unchanged and we recently did a full check.

    **Checking for Apple Update Metadata**

    Looking for detail for: 031-07832, version latest...

    Not found

    The following Apple Software Updates are available to install:

        + HP Printer Software Update-3.1


Run managedsoftwareupdate --installonly to install the downloaded updates.

Finishing...

Done.

D1309-AP-201MMOHR:~ mmohr$ 

Gregory Neagle

unread,
Jul 6, 2016, 11:46:53 AM7/6/16
to munk...@googlegroups.com
Your output is of `managedsoftwareupdate -vvv`, which never attempts to install anything.

This output:

    The following Apple Software Updates are available to install:

        + HP Printer Software Update-3.1


Run managedsoftwareupdate --installonly to install the downloaded updates.

Finishing...

Done.

is completely expected. It even tells you what to do next to perform the actual install.

If you are actually seeing failures to install when managedsoftwareupdate runs "normally", post the relevant bits from the log, or the output of `managedsoftwareupdate --installonly -vvv`

-Greg

Michael Mohr

unread,
Jul 6, 2016, 11:57:53 AM7/6/16
to munki-dev
Got it :) Here is the Install Only output... Below that the install log output... Then the managedsoftwareupdate log... Just keeps looping this pattern...

Last login: Wed Jul  6 10:23:06 on ttys000

D1309-AP-201MMOHR:~ mmohr$ sudo managedsoftwareupdate --installonly -vvv

Password:

Managed Software Update Tool

Copyright 2010-2016 The Munki Project

https://github.com/munki/munki


Starting...

    **Checking for Apple Update Metadata**

    Looking for detail for: 031-07832, version latest...

    Not found

    The following Apple Software Updates are available to install:

        + HP Printer Software Update-3.1

Installing available Apple Software Updates...

    softwareupdate cmd: ['/usr/local/munki/ptyexec', '/usr/sbin/softwareupdate', '--verbose', '-i', u'031-07832-3.1', '--no-scan']

    Done.

    Raw Apple Update install results: {'download': [], 'failures': [], 'installed': []}

WARNING: Apple update HP Printer Software Update, 031-07832 may have failed to install. No record of success or failure.

Finishing...

    Getting info on currently installed applications...

Done.


-----

Jul 06 2016 10:49:16 -0500 Apple Software Update install of HP Printer Software Update-3.1: FAILED for unknown reason

-------

Jul 06 2016 10:53:49 -0500 ###    End managed software check    ###
Jul 06 2016 10:53:49 -0500 Checking Apple Software Update catalog...
Jul 06 2016 10:53:49 -0500 Downloading available Apple Software Updates...
Jul 06 2016 10:53:50 -0500     Finding available software
Jul 06 2016 10:55:14 -0500     Downloaded HP Printer Software Update
Jul 06 2016 10:55:14 -0500     Done.
Jul 06 2016 10:55:16 -0500     **Checking for Apple Update Metadata**
Jul 06 2016 10:55:16 -0500     The following Apple Software Updates are available to install:
Jul 06 2016 10:55:16 -0500         + HP Printer Software Update-3.1
Jul 06 2016 10:55:16 -0500 Finishing...
Jul 06 2016 10:55:16 -0500 Saving application inventory...
Jul 06 2016 10:55:16 -0500 ### Ending managedsoftwareupdate run ###

Gregory Neagle

unread,
Jul 6, 2016, 12:01:29 PM7/6/16
to munk...@googlegroups.com
OK, that's progress. Now:

WARNING: Apple update HP Printer Software Update, 031-07832 may have failed to install. No record of success or failure.

Note the word "may". Does `softwareupdate` or `managedsoftwareupdate` offer the HP Printer Software Update-3.1 again? If not, then it _was_ installed; it's just that the output from /usr/sbin/softwareupdate doesn't contain information that Munki can use to tell if it was installed or not.

What does /var/log/install.log have to say about the install of that update?

-Greg

Michael Mohr

unread,
Jul 6, 2016, 12:32:29 PM7/6/16
to munki-dev
This is what it shows in the logs but I'm thinking that the --installonly worked because the latest says successful So I think this was just me being a rookie, and all seems good... I just thought that having the unattendedappleupdates set to True (YES) that it would have done it without me needing to tell it to install.. 

Jul  6 10:07:33 D1309-AP-201MMOHR softwareupdated[293]: JS: Printing drivers update available for HP_DesignjetR1. (return value 5)
031-07832 | HP Printer Software Update 3.1

Jul 06 2016 11:13:11 -0500 Apple Software Update install of HP Printer Software Update-3.1: SUCCESSFUL

Gregory Neagle

unread,
Jul 6, 2016, 12:37:22 PM7/6/16
to munk...@googlegroups.com
Manually running `managedsoftwareupdate` never installs anything. Not even items marked for unattended install.

Adding `--auto` causes managedsoftwareupdate to do the actions it would do during an automatic/background run, which include installing items marked for unattended install, (or if no-one is logged in via the GUI, all installs)

`--installonly` performs all pending installs/removals and does not check for blocking applications or make sure users are logged out before performing installs/removals that require a logout or restart.

-Greg
Reply all
Reply to author
Forward
0 new messages