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.
- Get your free CleanMyMac trial — test it for 7 days free.
- Open it and choose Smart Care in the sidebar.
- Click Scan.
- 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
- 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.
- 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.
- When your Mac restarts into recovery mode, choose Disk Utility from the menu.
- Select your startup disk in the sidebar of Disk Utility.
- Click First Aid in the toolbar, then Run, and wait for Disk Utility to perform checks on your disk and fix any problems.
- When it’s done, restart your Mac in recovery mode and try to reinstall macOS.


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.
- Boot your Mac into recovery mode.
- Choose Disk Utility from the menu.
- In Disk Utility, select your startup disk in the sidebar and click Erase.
- Choose APFS as the format and give the startup disk a name.
- Click Erase Volume Group.
- When Disk Utility is finished erasing your disk, click Done and then quit Disk Utility.
- Choose Reinstall macOS from the menu and choose Continue.
- 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.

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.