Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

App Store apps do not install properly on a fresh install of High Sierra on internal SSD or HDD

I upgraded my iMac 27-inch Mid-2011 with a 240-GB SSD alongside the existing 2-TB HDD. After the upgrade, I tested and everything worked great using the existing High Sierra system on the 2-TB HDD.


I did a new install of macOS High Sierra from Apple over the internet on to the 240-GB SSD. It was a fast and error-free installation. The iMac started up fast from the SSD and I applied system updates.


I completed all configuration tasks (setup all my preferences and installed all my applications and utilities) and then I ran it like this for a couple of days trying things out.


When it was time to add my App Store apps I ran into a snag. All my purchased apps install but will not run. When I launch them they either generate an error report, or bounce once in the dock, or do nothing at all.


I also tried adding new free apps that were not attached to my account and they behave the same way. So, I did some troubleshooting things like trying a different login and playing with permissions. Nothing works.


I spent an hour today on a support call with Apple and they were not able to figure it out and recommended I take it to for Apple authorized service.


I gave up and reinstalled the operating system on the HDD and to my surprise the same issue is happening on the original drive; that was working just fine!


Has anyone else experienced this? Can I not have two internal drives?

iMac 27″, macOS 10.13

Posted on Nov 13, 2020 11:38 PM

Reply
Question marked as Best reply

Posted on Nov 26, 2020 5:44 AM

Hope this helps everyone:

  1. Open a terminal
  2. run the following command
sudo rm -f /Library/Keychains/crls/valid.sqlite3


I haven't tested, but I think a reboot is not even necessary. And this does survive a reboot.


It looks like this file may be used by "trustd". So worse case scenario, this will rebuid trustd's cache, so that should not affect the security of your system.


Enjoy!

Similar questions

447 replies

Nov 26, 2020 11:32 AM in response to scrutinizer82

scrutinizer82 wrote:

Have you tried doing that and disabling SIP like I suggested?

nah. I prefer the workaround I posted about removing the rogue entry using sqlite3.

Also, modifying hosts by blocking OCSP is not going to do any harm.

well, OCSP exists for a reason. Yes it has its shares of privacy drawbacks like it was recently discussed, but I prefer this privacy drawback than not being made aware that my bank TLS certificate has been revoked because its private key was disclosed and a MITM now gets my credentials.


I don't have the confirmation, but I would betcha that Safari heavily relies on OCSP. So by blocking OCSP requests, you make people more vulnerable when browsing. And with the amount of people reading this thread now, and everyone who provided "a workaround", the experts here should be recommending the safer solution.


Which solution would that be? ;-)

Nov 26, 2020 11:49 AM in response to FrancoisQC

FrancoisQC wrote:


scrutinizer82 wrote:

Have you tried doing that and disabling SIP like I suggested?
nah. I prefer the workaround I posted about removing the rogue entry using sqlite3.
Also, modifying hosts by blocking OCSP is not going to do any harm.

Which solution would that be? ;-)


I talked about blocking specifically ocsp.apple.com. Blocking this host has nothing to do with your bank or any other organisation and institution using ocsp because ocsp itself is a protocol, not a host.


Also, answering your last question, the solution should be the one that works. At least, that's the philosophy of how I get things done. Security is commendable until it inhibits your workflows. It shouldn't be revered as the sacred cow. I prefer flexibility solving problems, so I don't understand why not try something that works if it does and is infinitely easier than manipulating SQLite databases with the shell scripting involved? Do you want your computer back or not? Sometimes, it's not possible to have everything at once and in perfect state.

You can't resolve this issue nor guarantee it won't return. Only Apple engineers can, but only if they'll be told. Until then it's all fuss about nothing.

Nov 26, 2020 12:06 PM in response to scrutinizer82

I talked about blocking specifically ocsp.apple.com. Blocking this host has nothing to do with your bank or any other organisation and institution using ocsp because ocsp itself is a protocol, not a host.

Yeah you are right. My brain was stalled on "blocking OCSP altogether", not "blocking OCSP for Apple-issued certificates".


I guess both options are good, one completely disables OCSP checks for Apple-issued certificates, and one that "unrevokes" a certificate. The thing is, if a rogue app makes it way into the Apple Store and Apples decides to use OCSP to block that App, the first option will most likely not prevent the app from running.


Anyhow, it's all about cooperation, right? and I'm not here for Levels or Points. I will disapear once this issue is gone.


and that makes me wonder... what are those 45,000+ certificate serial numbers in the serials table of valid.sqlite3?



Nov 26, 2020 2:34 PM in response to St3ve74

This discussion is about App Store apps not working in High Sierra installations that have been recently installed. It seems to be because of an issue with app 'codesigning' validation. You should test a few of your App Store apps to make sure you have this issue. If you have this issue you will get a crash report and in the report you should see something that looks like CODESIGNING.

Nov 26, 2020 2:41 PM in response to M-Ibrahim

M-Ibrahim wrote:

Sorry for the stupid question, but what’s the difference between this solution
sudo sqlite3 /Library/Keychains/crls/valid.sqlite3 'delete from serials where hex(serial) = "04CA81F77D5E33F7"'

and replacing the database with an old one?

There are no stupid questions, just people answering stupid answers...


The first one edits the current database, removing one entry.

The second uses a database that does not contain the entry.


To answer Softmusic

Does it means that an old High Sierra install is not as safe as a fresh one ? Is it another security flaw from Apple ?

I'd have to say something is shady, as old installs should provide the same CRLs as fresh installs. Even if Apple is pushing some rogue data, the CRL data for old and new installs should be the same.


Unless we know why Apple is marking it as revoked I don't have an answer.

Nov 26, 2020 3:41 PM in response to M-Ibrahim

Personally I beleive it should be the same for all users. The folder it sits in, "crl", implies that it is a SQLite DB that contains some CRL-ish data. But valid.sqlite3 is NOT a CRL, it's just a simple database that High Sierra probably uses that for caching, for faster certificate checks rather than having to parse a CRL every time, or hit an OCSP server.


The fact that deleting the DB and that the CA serial number gets added back to this DB baffles me. Why is Apple pushing that cert as being revoked.


But that I write this, I'll need to check the other tables in the DB, as you just don't use a serial number to uniquely identify a cert. You need more than that. If Apple only keeps certificate serial numbers, then I could see the case where a certificate with the same serial number, but issued by a different CA, is getting revoked and High Sierra would incorrectly see its own certificate as being revoked. That would be a HUGE design mistake.

Nov 26, 2020 7:57 PM in response to GrenadeBait

Reference the "valid.sqlite3" database edit solution from FrancoisQC. The following testing was conducted.


On three different Macs, a clean install of High Sierra was completed from the option-command-R recovery mode (ie. over the internet from Apple). No Apple Updates were applied.


Applied terminal window command string...


sudo sqlite3 /Library/Keychains/crls/valid.sqlite3 'delete from serials where hex(serial) = "04CA81F77D5E33F7"'


Our testing finds that the valid.sqlite3 edit...

...works with an ~85% effectiveness (see below);

...survives the periodic ~60-min update from Apple;

...survives a computer reboot; and

...as of this post, it has survived 5 hours.

We're crossing our fingers :-)


As summarised above, we found it about 85% effective based on randomly selected groups of 40-45 App Store apps of which 5-6 usually fail to start, with the remainder starting without error. Note app functions were not tested, but they look OK.


The apps tested varied widely from big devs like Apple and Microsoft as well as the smaller guys, and included productivity, utilities, games, etc..


No codesign errors were reported for any app, not even the ones that failed.


Example of apps that worked...

AdGuard for Safari

Aperture

Better Rename 9

Blackmagic Disk Speed Test

Diagrammix

European War 2

European War 3

European War 4

Folders Factory

GarageBand

HP Easy Scan

iBooks Author

iMovie

iNet Network Scanner

inShort

iStat Mini

Keynote

Mactracker

Magnet

Microsoft OneNote

Microsoft Remote Desktop

Microsoft Word

Numbers

OneDrive

Pages

Parcel

PDF Toolkit+

ScreenSharingMenulet

SketchBook

Smart Converter

Speedtest

Tag Editor Free

TextWrangler

The Archive Browser

TrashMe


App that failed

Compare & Sync Folders

Display Menu

Folder Magic

Sparkle

Sync Folders

The Duplicate Finder


We are going to be doing some more testing and apply the patches to see if they break this fix, and if so, reapply the fix..

Nov 27, 2020 5:21 AM in response to GrenadeBait

For the non-Terminal-savvy out there, those who prefers a "click and fix" solution, I created an Automator script that will do the work.

Get the .dmg file from https://gofile.io/d/ebWFWJ


A bit more user friendly..


And regarding the apps that fails, I looked at the certs of Display Menu. They look the same, but the install somewhat failed for me. Not sure what's going on for now.

Nov 27, 2020 10:55 AM in response to FrancoisQC

The Automator script sounds like a great idea. We didn't have any trouble with the terminal command but if the issue comes back the script is something we can just keep somewhere handy to execute and restore functionality.


So far after running for a little over 20 hours most everything looks good. We've been poking and prodding things here and there to see if it breaks and tries to revert to the codesigning error; all good. We've also been applying updates incrementally and they do not affect the issue.


In one Finder test we deleted the edited database to move an older one into its place, but we were too slow. It recreated a new one within about a minute with the same size and we assume the same content. We left it and it's been running with it since; that surprised us.


Of the apps that still fail to start, none of the crashes seem to be codesigning errors. Most of them just put up a dialogue indicating the app is damaged and to reinstall.


Finally, with this fix applied we noticed that in the App Store all installed apps do not indicate their installed status correctly. They show a button saying 'open' but even if we install it again the button only shows 'installed' until there is a page refresh, then it's back to 'install'.


Nov 27, 2020 1:46 PM in response to cavenewt

The database file that I provided comes from an iMac that someone gave to me. If someone here have another old High Sierra installation, it would be interesting to compare it with my file.

Anyway, I prefer FrancoisQC's solution. I wanted to do a clean fresh High Sierra and avoid using any file from the old installation.

The new database (the one that is automatically rebuilt when deleted) has more elements in table "issuers" but less "serials". I don't know what it means.

App Store apps do not install properly on a fresh install of High Sierra on internal SSD or HDD

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.