Home › Guides › Error 21 and 22: the game can't save a file

Error 21 and 22: the game can't save a file

Codes 21 and 22 show up when the game can't write a save to disk. In an EA forum thread, the cause turned out to be the Windows protection called Controlled folder access: it was blocking writes to Documents.

Updated: December 4, 2026

Why this happens

Controlled folder access is a Windows Defender protection against ransomware. It stops unfamiliar programs from changing files in Documents. The game stores saves exactly there, so the write is blocked and the game shows an error. Other antivirus programs can act the same way. Mods usually have nothing to do with it.

What to do

  1. Open Windows Security → Virus & threat protection → Manage ransomware protection.
  2. Open "Block history" and look for TS4_x64.exe or the EA app there.
  3. Click "Allow an app through Controlled folder access" and add TS4_x64.exe from the game folder (…\The Sims 4\Game\Bin\).
  4. If you use a different antivirus, add the game and the Documents\Electronic Arts\The Sims 4 folder to its exclusions.
  5. If Documents syncs with OneDrive, pause the sync and try saving.
  6. Close extra programs and repair the game in the EA app (Library → The Sims 4 → ⋯ → Repair).

Don't turn the protection off for good: it's enough to let the game write.

How the app helps

The "Why mods aren't showing up" section in Sims 4 Mod Doctor (free) checks the same Windows restrictions and OneDrive that get in the way of the game reading and writing files in Documents, and suggests how to fix them. In the "Saves" section you can back up your saves before changing anything.

Frequently asked questions

Are error 22 and "Sims Delivery Error" the same thing?

On PC they're often seen together. The steps are the same: check Windows protection, antivirus and OneDrive, then repair the game.

Error 21 came back after a Windows update.

After big updates, protection settings can reset. Check the block history and the list of allowed apps again.

Let Doctor Moddi check it for you

Sims 4 Mod Doctor scans your Mods folder for free, finds broken, outdated and duplicate files and moves them to quarantine. Anything removed comes back with one click.

⬇ Download free

Windows 10/11 · from the Microsoft Store · mod checks are free forever

This guide in other languages: Русский · Português · Español · Deutsch · Français · Polski · Italiano · Українська