W. Loring

Q: Caching Server - can you delete individual files?

Hello, I'm running a Caching Server on a Mac Mini running 10.11.6.

 

Today, the iTunes 12.5.1 update came out, but none of my systems are able to install the update from the Caching Server. They download the package, but then fail. I think the download must be corrupted. I turned off the server, then updated iTunes on one of the clients, and it worked. So I think the copy on the server is bad.

 

Is there a way to find and delete the correct file within the cached packages so that it will download a fresh copy? Or do I have to reset the entire cache?

Posted on Sep 14, 2016 6:56 AM

Close

Q: Caching Server - can you delete individual files?

  • All replies
  • Helpful answers

  • by dwbrecovery,Helpful

    dwbrecovery dwbrecovery Sep 15, 2016 8:21 AM in response to W. Loring
    Level 3 (589 points)
    Servers Enterprise
    Sep 15, 2016 8:21 AM in response to W. Loring

    Hi W.Loring,

    Try these two suggestions:

     

    - Run under sudo:

    /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin settings caching:LogClientIdentity = true

    /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin stop caching

    /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin start caching

     

    - then check the cache service log in Server.app for clues

     

    - Check :  Configure OS X Server Advanced Cache Settings and adjust LogLevel , restart the cache service and check the alternative log file for clues.  Remember the performance will reduce with such a setting.

     

    hope this helps, dwbrecovery

  • by W. Loring,

    W. Loring W. Loring Sep 15, 2016 8:30 AM in response to dwbrecovery
    Level 1 (5 points)
    Servers Enterprise
    Sep 15, 2016 8:30 AM in response to dwbrecovery

    Thanks for the reply. I looked through the logs, but was unable to find anything that definitively pointed to either the iTunes update in particular, or a file path that might lead me to it. It might just be that I don't know exactly what to look for.

     

    Additionally, when looking at the Advanced Cache settings, I couldn't find the LogLevel key within the .plist file. I'm opening it with TextEdit... should I be using something else?

     

    I'm afraid I might just have to reset the cache, which would stink because we've got about 450GB of Mac OS and iOS updates in there. Either that, or just wait for another iTunes update.

  • by dwbrecovery,

    dwbrecovery dwbrecovery Sep 15, 2016 9:01 AM in response to W. Loring
    Level 3 (589 points)
    Servers Enterprise
    Sep 15, 2016 9:01 AM in response to W. Loring

    So no entries for iTunesX.pkg and iTunesAccess.pkg in the Caching Service log in Server.app?

  • by Leopardus,

    Leopardus Leopardus Sep 15, 2016 1:07 PM in response to W. Loring
    Level 4 (1,122 points)
    Desktops
    Sep 15, 2016 1:07 PM in response to W. Loring

    The default is that all the content are stored in /Library/Server/Caching ... it contains three directories, Config , Data , Logs , which have respectively in Config - the Configuration plists; in Data all the downloaded Apps, Books and Updates to programs. In the Logs you will find the actual Logs.

     

    Inside the Data folder, Server maintains a database (AssetInfo.db) for which you have to use SQlite to be able to see what is cached. The individual Commands are:

     

    server:~ xxxxxxx$ sudo sqlite3 /Volumes/SeparateHD/Library/Server/Caching/Data/AssetInfo.db

    or

    server:~ sssssss$ sudo sqlite3 /Library/Server/Caching/Data/AssetInfo.db 

    and validate with your Admin  Password.

    (This will start sqlite3 with the 'AssetInfo.db' Database used by your server)

     

    SQLite version 3.8.10.2 2015-05-20 18:17:19 Enter ".help" for usage hints.

     

    Then follows the following commands:

     

    sqlite> .tables

    You will see the different Tables listed.

    ZAFFINITY ZASSET Z_METADATA Z_MODELCACHE Z_PRIMARYKEY

    for the printout to make sense to you:

     

    sqlite> .mode column

     

    sqlite> .headers on

     

    sqlite> select * from ZASSET;

     

    The output will be a table in Terminal which you can inspect to find what is there. The final value would be what you are interested in, before that are the location where it is stored on the disk and where it can be found using Finder.Screen Shot 2016-09-15 at 21.59.51.png

    As you can see, it is not just a simple matter of just erasing or editing something from a log file. It is important not to corrupt this database.

     

    HTH

     

    Leo

  • by W. Loring,

    W. Loring W. Loring Sep 16, 2016 5:47 AM in response to dwbrecovery
    Level 1 (5 points)
    Servers Enterprise
    Sep 16, 2016 5:47 AM in response to dwbrecovery

    Looking again today, now I am seeing those files, but the paths point to locations that don't exist. I am storing my files on an external volume.

  • by W. Loring,

    W. Loring W. Loring Sep 16, 2016 5:48 AM in response to Leopardus
    Level 1 (5 points)
    Servers Enterprise
    Sep 16, 2016 5:48 AM in response to Leopardus

    Yeah, I see that. And I was afraid that would be the case. I think the prudent thing might just be to wait for another iTunes update, and let the clients wait.

     

    Thanks for the help, everyone!

  • by dwbrecovery,

    dwbrecovery dwbrecovery Sep 18, 2016 10:00 AM in response to W. Loring
    Level 3 (589 points)
    Servers Enterprise
    Sep 18, 2016 10:00 AM in response to W. Loring

    I checked and same issue exists here.  Let you know if resolved.

    Cheers

  • by More Broccoli Please,

    More Broccoli Please More Broccoli Please Sep 20, 2016 7:18 AM in response to W. Loring
    Level 1 (29 points)
    Sep 20, 2016 7:18 AM in response to W. Loring

    First, identify the directory where the damaged asset lives by searching through the Debug log files in /Library/Server/Caching/Logs for a message like "Asset /blah/blah/iTunes12.5.1.pkg path /Library/Server/Caching/Data/UUID, extents [0,nnn]".  The UUID is the important part.  Then run "sudo rm /Library/Server/Caching/Data/UUID/0".

  • by dwbrecovery,

    dwbrecovery dwbrecovery Sep 22, 2016 11:23 PM in response to More Broccoli Please
    Level 3 (589 points)
    Servers Enterprise
    Sep 22, 2016 11:23 PM in response to More Broccoli Please

    Hi MBP, W.Loring

     

    thanks MBP for the info.

    - Checked out the Debug logs, found the UUID for iTunesX.pkg, deleted /Library/Server/Caching/Data/UUID and restarted the Caching Service.

    - Clicked update for iTunes 12.5.1 on the App Store, noticed the UUID Folder was recreated and the "0" file was downloaded, but unfortunately, same result where the install did not complete on the client.

    - It is the same result on Sierra, but there is an error dialog, " An error has occurred "iTunes" could not be verified. (311)

    - A developer forum has posts on this error, but as yet no fix.

     

    First time having an issue with the caching service.

     

    cheers, dwbrecovery

  • by More Broccoli Please,

    More Broccoli Please More Broccoli Please Sep 23, 2016 4:52 AM in response to dwbrecovery
    Level 1 (29 points)
    Sep 23, 2016 4:52 AM in response to dwbrecovery

    Try verifying the integrity of the downloaded file by running "sudo md5 /Library/Server/Caching/Data/UUID/0" and comparing the result against the ZCHECKSUM value for the asset in the database (see Leopardus's comment).

     

    Other things to try:

    - Download the iTunesX package yourself using Safari or curl, and then run "sudo cmp /Library/Server/Caching/Data/UUID/0 /path/to/your/download/iTunesX.pkg".

    - See if the cached file opens correctly on your server:  "sudo cp /Library/Server/Caching/Data/UUID/0 /tmp/iTunesX.pkg; open /tmp/iTunesX.pkg"

    - On the computer where iTunesX fails to install, check the install log files for relevant error messages.

  • by dwbrecovery,Helpful

    dwbrecovery dwbrecovery Sep 28, 2016 6:33 AM in response to W. Loring
    Level 3 (589 points)
    Servers Enterprise
    Sep 28, 2016 6:33 AM in response to W. Loring

    Hi W.Loring,mbp,

    - ended up using  Install iTunes.pkg  from Apple Downloads and deployed it using ARD Admin and all clients installed without issue.

    - thanks for the further tips mbp, still to investigate.

     

    cheers, dwbrecovery

  • by W. Loring,

    W. Loring W. Loring Sep 28, 2016 6:34 AM in response to dwbrecovery
    Level 1 (5 points)
    Servers Enterprise
    Sep 28, 2016 6:34 AM in response to dwbrecovery

    Good idea, dwbrecovery. I should have thought of that.

     

    I'm pushing the update out to clients now. Thanks.