There are lots of error messages you might see when using your Mac. Some are simple and self-explanatory. Others don’t seem to make much sense at all. The “com.apple.buildinfo.preflight.error error 21” is definitely at the more obscure end of the scale. In this article, we’ll explain what it means and show you how to fix it.

What does “(com.apple.buildinfo.preflight.error error 21.)” mean?

The error occurs when you try to reinstall macOS in recovery mode. It means that when your Mac was checking to make sure everything is in place to reinstall the operating system, something reported a problem. It could be that the disk on which you’re trying to reinstall macOS has a problem, or if you’re using Internet Recovery, there could be a network issue.

Tip: Keep your Mac running smoothly

We all know that prevention is better than cure. And so, it makes sense to do everything you can to avoid this kind of error on your Mac. For example, you could scan for malware, run maintenance tasks, and update all your applications. Malware can cause all kinds of problems, and failing to update your apps could mean running buggy software.

The easiest way to do all of that and keep your Mac running smoothly is to use CleanMyMac’s Smart Care feature. It scans your Mac for junk files, clutter, and malware, recommends maintenance tasks to run, and checks which applications have vital updates available. And, best of all, it only takes a few clicks to scan your Mac and implement its recommendations.

  1. Get your free CleanMyMac trial — test it for 7 days free.
  2. Open it and choose Smart Care in the sidebar.
  3. Click Scan.
  4. Wait for it to finish and then click Run to implement all its recommendations or Review to see what it has found.

How to fix “com.apple.buildinfo.preflight.error error 21” on your Mac

Before we get into how to fix the issue, if you can, you should back up your data now. If there’s any way you can boot your Mac and either run a Time Machine backup or just copy the data you need onto another disk, do it. Some of the steps below will delete the data on your startup disk. And, if you don’t already have a regular backup schedule, set one up as soon as you’re back up and running.

Reset NVRAM

It’s unlikely that the problems with installing macOS in recovery mode are caused by an issue with NVRAM (the memory that stores important settings even when your Mac is not plugged in or running on battery power), but it’s easy to reset, so it’s worth a try.

  • On a Mac with Apple silicon, you just need to restart your Mac normally.
  • On an Intel-based Mac, restart while holding Command-Option-P-R and release the keys when you hear the second startup chime.

Use Disk Utility to repair your startup disk

  1. Restart your Mac. If the error occurred while you were in recovery mode, follow the steps you took to boot into recovery mode to do that again.
  2. Try to do whatever you were doing when you got the error message. If you get it again, reboot your Mac into recovery mode. If necessary, you can press and hold the power button to turn it off first. If you don’t know how to boot your Mac in recovery mode, you can find instructions on Apple’s website here.
  3. When your Mac restarts into recovery mode, choose Disk Utility from the menu.
  4. Select your startup disk in the sidebar of Disk Utility.
  5. Click First Aid in the toolbar, then Run, and wait for Disk Utility to perform checks on your disk and fix any problems.
  6. When it’s done, restart your Mac in recovery mode and try to reinstall macOS.
Pro tip: Boot your Mac from an external disk to access your data

If you don’t have a backup of your data, you can still access it if you have an external hard disk or SSD with macOS installed on it. Just plug that disk into your Mac, restart while holding the Option key, and choose the external disk as the startup disk. Once your Mac starts up, you should see its internal disk in the Finder and be able to copy files and folders to the external startup disk, or any other location, such as cloud storage.

If you don’t have an external disk with macOS installed on it, you can find out how to create one on Apple’s website here.


Erase your Mac and start from scratch

If nothing so far has worked and you can’t boot your Mac normally, the next step is to boot into recovery mode again and erase your Mac. You will then be able to do a clean install of macOS.

  1. Boot your Mac into recovery mode.
  2. Choose Disk Utility from the menu.
  3. In Disk Utility, select your startup disk in the sidebar and click Erase.
  4. Choose APFS as the format and give the startup disk a name.
  5. Click Erase Volume Group.
  6. When Disk Utility is finished erasing your disk, click Done and then quit Disk Utility.
  7. Choose Reinstall macOS from the menu and choose Continue.
  8. Follow the onscreen instructions to complete the process.

Once you have reinstalled macOS, your Mac will restart and take you through the process of setting up your Mac. During that process, if you have a Time Machine backup, you will be offered the chance to restore from it using Migration Assistant.

Did you know?

Your Mac accumulates gigabytes of junk files like old cache files, temporary files that were never deleted, and language files you don’t need. Then, there’s application binaries that don’t run on your system and Mail attachments that take up space on your disk but could just as well sit on Apple’s server waiting for you to download them. You can quickly get rid of all that junk and free up lots of space using CleanMyMac’s Cleanup feature.



Reinstall macOS from an external drive or USB stick

If reinstalling from recovery mode fails even after you’ve erased your startup disk, there is one final option. You will need access to another Mac to do it, but if you have that, you can download macOS from the App Store and install it on a USB stick or external drive, boot from that, and then reinstall macOS onto your startup disk. You can find full instructions on how to create a bootable installer in this article.

The “com.apple.buildinfo.preflight.error error 21” message usually means that you are trying to reinstall macOS in recovery mode and something has gone wrong. Follow the steps above to fix it and get your Mac up and running again.