Com.apple.buildinfo.preflight.error error 21? Can't reinstall macOS!

While trying to reinstall macOS Sonoma through Recovery Mode, I got this error message, “The operation couldn’t be completed. (com.apple.BuildInfo.preflight.error error 21.)” Does this have something to do with my WiFi network or Firewall? First Aid shows my drive is fine. Why do I receive com.apple.buildinfo.preflight.error error 21? How can I fix it? Any suggestion is appreciated.

“com.apple.BuildInfo.preflight.error error 21” is likely a network issue. Try switching to a different WiFi network and reinstalling macOS Sonoma again!

You can also boot into Internet Recovery Mode to bypass the preflight error.

Note that this only applies to Intel-based Macs, as Apple Silicon Macs don’t have Internet Recovery.

If your Mac is indeed Intel-based, follow these steps to reinstall macOS in Internet Recovery:

  1. Turn off your Mac.
  2. Power it on and then immediately press and hold Option-Command-R.
  3. Release the keys when you see the spinning globe.
  4. In the macOS Utilities window, select Reinstall macOS and click Continue.
  5. Go through the on-screen instructions to finish the installation.

It’s helpful to erase the startup disk before reinstalling macOS. However, this will delete all data on your Mac, including the operating system and your documents, apps, videos, files, etc.

So, you must back up your Mac first, if you don’t have one already. You could use Time Machine to create a backup of your files, apps or settings. Or, simply drag and drop all the essential files to an external drive.

In the case that your Mac won’t start up, you can run data recovery in macOS Recovery Mode.

After your data is secured, take the steps below to erase your Mac and reinstall macOS:

  1. Boot your Mac into Recovery Mode.
  2. Select Disk Utility > Continue.
  3. Tap View > Show All Devices to reveal the disks and volumes on your Mac.
  4. Select the top-level internal physical disk, which is usually named Apple SSD xxx Media, and click Erase.
  5. Name your disk Macintosh HD.
  6. Choose APFS for macOS High Sierra and later, as in your case. (For macOS Sierra and earlier, select Mac OS Extended (Journaled).
  7. Keep GUID Partition Map as the scheme.
  8. Click Erase.
  9. Close Disk Utility and return to the macOS Utilities windows.
  10. From there, choose Reinstall macOS and follow the instructions.

Have you tried DFU Mode? If you have another Mac, you can revive your Mac from it through DFU mode.

Reviving won’t erase your Mac, so your data will be safe. It simply updates your Mac’s firmware and recoveryOS to the latest version.

If your Mac can’t be revived, you can erase it and restore it to factory settings by choosing the Restore option.