“Document Library is Corrupted” – Troubleshooting Guide for SharePoint
When working with SharePoint, you may encounter the error:
“Document Library is Corrupted” – Corruption detected in the document library.
This issue indicates that one or more files, metadata, or configurations within the document library have become corrupted, leading to errors when accessing, uploading, or modifying files. If not resolved promptly, this issue can result in data loss or restricted access to documents.
This guide will walk you through step-by-step troubleshooting and solutions to fix the issue.
🔍 Causes of Document Library Corruption in SharePoint
✔ File Corruption: One or more files in the library are damaged or contain unreadable data.
✔ Metadata Issues: Corrupt metadata fields, broken column settings, or lookup issues.
✔ Sync Conflicts: OneDrive or SharePoint sync issues leading to inconsistencies.
✔ Permissions Issues: Incorrect permissions may prevent proper access, causing perceived corruption.
✔ Storage Quota Exceeded: The library has reached its storage limit, affecting functionality.
✔ Workflow/Automation Failures: Corrupt SharePoint workflows or Power Automate flows.
✔ Broken Custom Scripts: Malformed JavaScript, JSON, or PowerShell scripts running on the library.
✔ Unsupported Characters in File Names: Files containing invalid characters (# % & * : < > ? / \ |
) can corrupt library structure.
✔ SharePoint Server or Database Corruption: Underlying database corruption affecting document retrieval.
🛠 Step-by-Step Solutions to Fix “Document Library is Corrupted” Error
🟢 Step 1: Verify If the Corruption Is Widespread or Limited to Specific Files
- Check other libraries: Try accessing a different document library in the same site.
- Try opening multiple files: Open different files in the affected library.
- Try accessing SharePoint from another browser or device: If it works elsewhere, it may be a browser or local sync issue.
✔ Solution:
- If only one or a few files are corrupted, skip to Step 4 to fix those specific files.
- If the entire library is affected, proceed with the next steps to check for systemic issues.
🟢 Step 2: Check for Storage Limit Issues
If the document library has exceeded its storage quota, it may behave unpredictably.
How to Check Storage Usage in SharePoint:
- Open SharePoint Admin Center.
- Navigate to Sites > Active Sites.
- Locate the affected site and check its Storage Used.
✔ Solution:
- Delete unnecessary or old files.
- Increase storage quota if needed.
🟢 Step 3: Restore Library to a Previous Working State
If the document library recently became corrupted, restoring it to a previous version can help.
How to Restore a SharePoint Document Library:
- Open SharePoint Document Library.
- Click the gear icon (⚙️) > Library Settings.
- Select “Restore this library” under Versioning Settings.
- Choose a date before the corruption started and click Restore.
✔ Solution:
- This will revert the document library to an earlier, functional state.
🟢 Step 4: Identify & Fix Corrupted Files
If a specific file is causing corruption, it must be removed or repaired.
How to Identify & Remove Corrupt Files:
- Try downloading suspect files: If you cannot download a file, it is likely corrupted.
- Check file extensions: Ensure files have proper extensions (
.docx
,.xlsx
,.pdf
). - Open files in different applications: If a file does not open in its native app (e.g., Word, Excel), it may be corrupted.
✔ Solution:
- Delete the corrupted file and re-upload a working version.
- Check file backups from OneDrive or previous versions in SharePoint.
🟢 Step 5: Repair Metadata Issues
If the document library uses custom metadata columns, these may be corrupted.
How to Fix Metadata Issues:
- Open Library Settings in SharePoint.
- Check “Columns” and look for any missing or broken fields.
- Remove any “Required” fields that are causing upload failures.
- If a metadata field is causing issues, delete or recreate it.
✔ Solution:
- Correcting metadata issues can resolve corruption in document libraries.
🟢 Step 6: Fix OneDrive & SharePoint Sync Issues
Syncing errors may cause duplicate, missing, or corrupted files in the document library.
How to Resolve Sync Issues:
- Click the OneDrive icon on your taskbar.
- Pause syncing for 10 minutes.
- Resume syncing and check if the issue persists.
- If issues continue, unlink OneDrive and relink it to SharePoint.
✔ Solution:
- Restarting sync can resolve file conflicts and corruption.
🟢 Step 7: Run SharePoint Health Check (Admin Only)
SharePoint Admins can run a health check to detect and fix corrupt libraries.
How to Run SharePoint Health Check:
- Open SharePoint Admin Center.
- Go to Reports > Site Health Check.
- Look for errors under Document Library Integrity.
- Follow any repair recommendations provided.
✔ Solution:
- This will identify issues related to database corruption, permissions, and storage.
🟢 Step 8: Remove Unsupported Characters in File Names
Files with invalid characters can cause corruption in SharePoint.
Check for Invalid Characters in File Names:
❌ Avoid These Characters: # % & * : < > ? / \ | " ~ { }
✅ Rename Files Like This:
"Report&Summary.docx"
→"Report_Summary.docx"
"2024/Financials.xlsx"
→"2024-Financials.xlsx"
✔ Solution:
- Remove unsupported characters and re-upload the files.
🟢 Step 9: Check for Broken Custom Scripts or Workflows
If your document library uses Power Automate, workflows, or JavaScript customizations, these may be corrupting the library.
How to Identify & Fix Custom Scripts:
- Open Library Settings > Advanced Settings.
- Disable any Custom JavaScript or JSON formatting.
- If using Power Automate or SharePoint Workflows, check for failed automation runs.
✔ Solution:
- Disable broken scripts and test if the issue persists.
🟢 Step 10: Contact Microsoft Support or IT Admins
If all else fails, contact your IT team or Microsoft Support for deeper investigation.
📞 For Microsoft 365 Users: Contact Microsoft via Admin Center.
📌 Final Summary & Solutions
🔹 If the corruption is file-related: Identify and remove bad files (Step 4).
🔹 If metadata is broken: Fix missing or corrupt columns (Step 5).
🔹 If sync is causing corruption: Pause and resume OneDrive sync (Step 6).
🔹 If storage limits are exceeded: Free up space or request more quota (Step 2).
🔹 If a previous version worked fine: Restore the library to an earlier version (Step 3).
🔹 If custom scripts are broken: Disable JavaScript and Power Automate workflows (Step 9).
🔹 If unsure, run a health check: Use SharePoint Admin Tools (Step 7).
Would you like PowerShell commands for advanced troubleshooting?