woodmeister50

Q: Caching Service broken for Macs?

I have run into an issue that posted some time ago and is still an issue.

 

It seems that the caching server does not work for any Macs that I have when they

request updates from the MacApp Store.  It does not matter whether the update is

a system update or and update for an app.

 

On the other hand, any request for an iOS based app, regardless of where the request

comes from, iTunes on a Mac or the iOS device itself, is recognized, downloaded and cached

and served when requested by either an iOS device or iTunes on a Mac (update apps pane in iTunes).

 

On RARE occasions, a MacApp Store request is posted in the Caching server log but that ends

up being the extent of it.

 

One of the prime reasons for using the caching server is to save download bandwidth and only

needing to download something once but this does not function for Macs (I have 5).  All of the

Macs are running 10.11.4 (10.11.3 before etc.).  The current version of the Server app is 5.1, but

this has been happening for some time before this update (was hoping this would finally fix it).

 

The Caching service was working as expected as far as I could recall back in Yosemite and

before.

 

So, has this functionality actually been removed?  Is it broke?  I have re-installed Server, cleared

caches and restarted, but had no success.

OS X El Capitan (10.11.4), Home Server

Posted on Mar 25, 2016 6:43 AM

Close

Q: Caching Service broken for Macs?

  • All replies
  • Helpful answers

  • by More Broccoli Please,

    More Broccoli Please More Broccoli Please Mar 25, 2016 7:45 AM in response to woodmeister50
    Level 1 (19 points)
    Mar 25, 2016 7:45 AM in response to woodmeister50

    From the "Country Restrictions" section of https://support.apple.com/en-us/HT204675 :

    • iTunes downloads might not be cached if a client's IP address isn't associated with your iTunes Store region.

    Could this be your issue?  In other words, is the Apple ID you are using in the App Store registered in the country where your caching server is running?

  • by woodmeister50,

    woodmeister50 woodmeister50 Mar 25, 2016 2:50 PM in response to More Broccoli Please
    Level 5 (5,505 points)
    Mac OS X
    Mar 25, 2016 2:50 PM in response to More Broccoli Please

    More Broccoli Please wrote:

     

    From the "Country Restrictions" section of https://support.apple.com/en-us/HT204675 :

    • iTunes downloads might not be cached if a client's IP address isn't associated with your iTunes Store region.

    Could this be your issue?  In other words, is the Apple ID you are using in the App Store registered in the country where your caching server is running?

    It is the underlined that is not working, not iTunes or iOS app caching (from HT204675):

    OS X

    • OS X updates
    • Mac App Store (OS X Mountain Lion v10.8.4 or later is recommended)
    • Other software updates distributed by Apple (including updates to iTunes for OS X and printer drivers)
    • GarageBand downloadable content
    • Third-party apps from the Mac App Store and their updates
    • Internet Recovery OS image downloads (OS X Mavericks and later)
    • iCloud data caching (photos and documents) for OS X El Capitan v10.11 and later

     

    The others are likely not working but can't be sure as I don't do anything with GarageBand,

    or have done internet recovery downloads.  I also doubt that the last item is doing anything

    as well as I have never seen anything in the Caching service log to indicate anything at all

    of that nature.

     

    I only ever used one Apple ID since Apple IDs were invented and am in the U.S. and have

    never been out of the U.S.   I would hope all the described services are available in the U.S.!!

     

    As I stated iOS or iTunes app downloads are cached regardless of whether the request is

    from an iOS device or iTunes on one of my Macs.

     

    All devices are on the same network subnet as the server(192.168.1.xxx).

  • by More Broccoli Please,

    More Broccoli Please More Broccoli Please Mar 25, 2016 3:49 PM in response to woodmeister50
    Level 1 (19 points)
    Mar 25, 2016 3:49 PM in response to woodmeister50

    You say this is a "home server."  Do you use more than one public IP address?  (Some people do.)

     

    What logging do you see by AssetCacheLocatorService on your client Macs?

    $ fgrep AssetCacheLocatorService /var/log/system.log

    You can also check older logs:

    $ fgrep -Z AssetCacheLocatorService /var/log/system.log*.gz

  • by woodmeister50,

    woodmeister50 woodmeister50 Mar 26, 2016 4:16 AM in response to More Broccoli Please
    Level 5 (5,505 points)
    Mac OS X
    Mar 26, 2016 4:16 AM in response to More Broccoli Please

    This morning tried this experiment based on your info.

     

    I had an update to Pcalc in the MacApp Store this morning.  I logged in and downloaded

    the app update.  I replaced computer IDs and the last digits of IP for security reasons.

     

    In /var/log/system.log this was the last entry:

    Mar 26 05:29:45 (redacted) AssetCacheLocatorService[570]: #15805c97 [I:AssetCacheLocatorService.queue] found caching server on 192.168.x.x:xxxxx

     

    The IP address was correct for the server.

     

    5:29 was roughly the boot time of the system and the request was made at 6:32.

     

    On the server, this was what was in the Caching Log:

    Mar 26 04:02:25 (redacted) AssetCache[9845]: Since server start: 766.5 MB returned to clients, 296.3 MB stored from Internet, 0 bytes from peers; 326 KB imported.

     

    Next, I had some updates available for some of my iOS apps.  On the same machine, I openned

    iTunes and downloaded the available app updates.

     

    There was no change in the /var/log/system.log, which I guess is expected since it was iTunes making the

    request.

     

    On the server, the cache log showed the following:

    Mar 26 04:02:25  (redacted) AssetCache[9845]: Since server start: 766.5 MB returned to clients, 296.3 MB stored from Internet, 0 bytes from peers; 326 KB imported.

    Mar 26 06:41:41  (redacted) AssetCache[9845]: #83EZCQJI2gw9 Received GET request by "iTunes/12.3.3.17" for /apple-assets-us-std-000001/Purple69/v4/30/8b/1f/308b1f84-7251-1bf8-0eb8-96a7a5 76a0ab/pre-thinned7096273563882415969.lc.1594671657524442.IPJ262I2FYIWY.signed.d pkg.ipa

    6:41:46  (redacted) AssetCache[9845]: #s18QiJun5Xmy Received GET request by "iTunes/12.3.3.17" for /apple-assets-us-std-000001/Purple69/v4/7f/c5/14/7fc51458-963a-aa29-dc1e-7347bf ca32fb/pre-thinned3834212478951852789.lc.1201845612599750.XOUDHS276ABNG.signed.d pkg.ipa

    .............etc. for 4 additional apps.

     

    So, it is working for iTunes requests (or iOS device requests for that matter) but not for MacApp Store requests.

    Also, I saw nothing but the same string in /var/log/system.log for roughly 7 days with the times relating to

    boot times of the computer.

     

    Note that the home server is only ever used locally and has any access from the outside disabled.

     

    I have also checked the same log on my Macbook Pro and it has similar entries as the iMac.

     

    So, it seems all my Macs see the Caching server when they boot, but when downloads from the MacApp Store

    are done on my machines, the Caching server is not doing anything about it.  Generally for most apps it is not

    a major issue as they are small, however, like the latest Xcode update (~1.9GB) or system updates it can make

    a big difference.

     

    At one time all was working as it should and the change happened either at the Server 4.x to 5.0 or maybe

    an early Server 5.x update and with OS X Yosemite for quite some time.  It was definitely functioning when all

    Macs were running Mavericks as this was when I initially set things up.  Unfortunately, this is the sort of

    thing that can go unnoticed for quite some time and probably did until I started noticing the long download

    times with the larger app and system updates.  Also, during the "transition to non-functioning", nothing in

    my network or connections to my Macs has changed, at least I didn't do anything to specifically change

    things (since I live alone, there is no one else that can change anything).

  • by woodmeister50,

    woodmeister50 woodmeister50 Mar 26, 2016 8:51 AM in response to More Broccoli Please
    Level 5 (5,505 points)
    Mac OS X
    Mar 26, 2016 8:51 AM in response to More Broccoli Please

    Just some additional info I discovered this morning.  It appears the iCloud part

    of caching service is doing something.  I just looked in the Caching Server log

    and saw several PUTs and GETs like "Received PUT request by "cloudd/482.29".

    The times and such seemed correlated to some changes I made to some files that

    were iCloud resident.  Don't know how this "local iCloud" data is used but there

    seems to be functionality.

  • by Mike Curd,

    Mike Curd Mike Curd Mar 26, 2016 10:52 AM in response to woodmeister50
    Level 1 (14 points)
    Mar 26, 2016 10:52 AM in response to woodmeister50

    Are you logged in to the Mac as a network account? What happens if you log in as a local administrator?

     

    I see the same behaviour as you when logged in as a network account, App Store URLs don't get rewritten to point to the caching server even though the package has been cached. Log in as a local admin and the caching server works as expected.

     

    As you say, this used to work.

  • by woodmeister50,

    woodmeister50 woodmeister50 Mar 26, 2016 11:34 AM in response to Mike Curd
    Level 5 (5,505 points)
    Mac OS X
    Mar 26, 2016 11:34 AM in response to Mike Curd

    Mike Curd wrote:

     

    Are you logged in to the Mac as a network account? What happens if you log in as a local administrator?

     

    I see the same behaviour as you when logged in as a network account, App Store URLs don't get rewritten to point to the caching server even though the package has been cached. Log in as a local admin and the caching server works as expected.

     

    As you say, this used to work.

    I am logged in as administrator account on any machine that I am doing the updates on.

    Not even sure what you mean by logging in as "network account"?  Only user log ins I am aware of

    are Administrator, Standard, Managed with Parental Controls, and Sharing only (of course there

    is guest).

     

    Also, all machines are associated with the Apple ID that is used to do the updates.

  • by woodmeister50,Solvedanswer

    woodmeister50 woodmeister50 Mar 28, 2016 9:30 AM in response to woodmeister50
    Level 5 (5,505 points)
    Mac OS X
    Mar 28, 2016 9:30 AM in response to woodmeister50

    Well it seems that I have finally tracked down the issue and seemingly have fixed it.

     

    After reading, rereading, and reading again the documentation on the caching service

    there were some "advanced" that were related to caching data and referred to to the

    config file.  On viewing the contents of the config file, I found that tags were completely

    missing.  Rather than mess with the config file directly since they were simple settings,

    I executed the following from terminal:

    sudo serveradmin settings caching:AllowSharedCaching = yes

    sudo serveradmin settings caching:AllowPersonalCaching = yes

    and shut down and restarted the service.

     

    Somewhere along the update paths (Server or OS X), it seems these lines were eliminated

    in the config file or were changed to required to be explicitly set and were removed intentionally.

    The documentation led one to believe (which is how it originally worked) that one sets a place to

    store the cache files and starts the service and it just works.

     

    Anyway, for the moment, the service seems to be working again for the MacApp Store updates/downloads.

    It's just odd that the iTunes/iOS apps and iCloud caching was working without these tags in the config and

    enabled.

  • by More Broccoli Please,

    More Broccoli Please More Broccoli Please Mar 28, 2016 10:28 AM in response to woodmeister50
    Level 1 (19 points)
    Mar 28, 2016 10:28 AM in response to woodmeister50

    I'm glad you fixed your problem but those settings did not change anything.  Their default values, even when unset, are true.  You can see for yourself:  Look for the "Registering with ... capabilities" lines in Debug.log.  AllowSharedCaching => sc, and AllowPersonalCaching => pc.

  • by woodmeister50,

    woodmeister50 woodmeister50 Mar 28, 2016 11:23 AM in response to woodmeister50
    Level 5 (5,505 points)
    Mac OS X
    Mar 28, 2016 11:23 AM in response to woodmeister50

    Apparently, the defaults were "forgotten" somehow in installation, at least for MacApp Store

    and it needed a "reminder".  Perhaps all defaults are not created equal?