This guide covers common issues and their solutions for FileLabeler.
Before diving into specific issues:
- Check the log file:
Documents\FileLabeler_Logs\FileLabeler_Log_[timestamp].txt - Verify Purview module:
Get-Module -ListAvailable -Name PurviewInformationProtection - Test with a single file before processing large batches
- Check file permissions and ensure files aren't open in other applications
Symptoms:
- Application window doesn't appear
- Immediate crash on startup
- Error about missing modules
Solutions:
-
Verify PurviewInformationProtection module is installed:
Get-Module -ListAvailable -Name PurviewInformationProtection
If not found, install Microsoft Purview Information Protection Client
-
Check PowerShell version:
$PSVersionTable.PSVersion # Should be 5.1 or higher
-
Review startup log:
- Open most recent log file
- Look for
[CRITICAL]entries - Common causes: Missing module, .NET Framework issues
-
Try running as Administrator:
# Right-click PowerShell → Run as Administrator .\FileLabeler.ps1
Symptoms:
- Files display "Ukjent" instead of label name
- Or "Ukjent etikett (beskyttet)"
- Or "Feil ved henting"
Causes and Solutions:
Expected behavior - Files without labels show "Ingen etikett"
Solution: No action needed, this is correct
File has encrypted/protected label not in labels_config.json
Log entry:
[WARNING] [Get-FileLabelDisplayName] Label ID not found in configuration
Solution:
- Check log file for the label ID
- Add missing label to
labels_config.json:{ "DisplayName": "Label Name", "Id": "guid-from-log", "Rank": 3 }
User doesn't have permission to read file metadata
Solution:
- Check file permissions (right-click → Properties → Security)
- Ensure user has Read permissions
- Try accessing file in Word/Excel to verify
OneDrive or network share causing delays
Solution:
- Wait for sync to complete (check OneDrive icon in system tray)
- Ensure stable network connection
- Try again after sync completes
Error Category: FileAccess
Log Level: WARNING or ERROR
Solutions:
-
Check file permissions:
- Right-click file → Properties → Security
- Ensure your user has Read/Write permissions
-
Check if file is read-only:
- Right-click file → Properties
- Uncheck "Read-only" attribute
-
Check folder permissions:
- If entire folder fails, check folder permissions
- Verify you have Modify access
-
OneDrive/SharePoint issues:
- Check sync status
- Verify file is fully downloaded (not cloud-only)
- Wait for sync to complete
Error Category: FileLocked
Log Level: ERROR
Solutions:
-
Close the file:
- Close file in Word, Excel, PowerPoint
- Close file in PDF readers
- Close any applications with the file open
-
Check for background processes:
# Find processes using the file Get-Process | Where-Object {$_.MainWindowTitle -like "*filename*"}
-
Use Task Manager:
- Open Task Manager (Ctrl+Shift+Esc)
- Look for Office applications
- End stubborn processes
-
Wait and retry:
- Sometimes Windows holds file locks briefly
- Wait 10-30 seconds and retry
-
Reboot if persistent:
- Last resort for stubborn file locks
Error Category: Network
Log Level: ERROR
Solutions:
-
Test network connectivity:
Test-Connection -ComputerName servername -Count 2
-
Verify UNC path access:
Test-Path "\\server\share\folder"
-
Check VPN connection:
- Ensure VPN is connected if required
- Verify network drive mappings
-
Verify share permissions:
- Contact IT if access denied
- Check AD group memberships
-
Map network drive:
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\server\share" -Persist
Error Category: Config
Log Level: ERROR or WARNING
Solutions:
-
Verify
labels_config.jsonexists:Test-Path .\labels_config.json -
Validate JSON syntax:
- Use jsonlint.com
- Check for missing commas, quotes, brackets
-
Check for backup files:
app_config.json.invalid_*(validation failed)app_config.json.backup_*(corrupted)
-
Reset to defaults:
# Backup current config Copy-Item app_config.json app_config.json.backup # Delete to regenerate Remove-Item app_config.json # Restart FileLabeler
-
Review log for details:
[ERROR] [Load-AppConfig] Config validation failed
Symptoms:
- Log shows:
[WARNING] [AsyncInitialization] Failed to create runspace pool - Slow performance with large file sets
- UI feels sluggish
Impact:
- Application still works but slower
- Operations are synchronous instead of async
-
30 files may feel unresponsive
Solutions:
-
Check PowerShell runspace support:
[RunspaceFactory]::CreateRunspacePool(1, 4) | Out-Null Write-Output "Runspace pool support: OK"
-
Verify .NET Framework version:
- Ensure .NET Framework 4.7.2 or later
- Update Windows if needed
-
Check for conflicting modules:
Get-Module | Format-Table Name, Version
-
Restart application:
- Close and reopen FileLabeler
- Check if async initializes successfully
-
Fallback to sync mode:
- Application will work in sync mode (slower but functional)
- Consider processing files in smaller batches (20-30 files)
Symptoms:
- æ, ø, å show as Ã¥, ø, æ or other strange characters
- UI text appears garbled
Solution:
For Script Users:
- Open
FileLabeler.ps1in VS Code or Cursor - Bottom right → Click encoding indicator
- Select "Save with Encoding"
- Choose "UTF-8 with BOM"
- Save file
- Restart FileLabeler
For EXE Users:
- This should not happen with compiled EXE
- If it does, recompile from UTF-8 BOM source
Expected Performance:
- 1-5 files: < 5 seconds
- 10-30 files: 10-30 seconds (sync mode)
- 30-100 files: 15-45 seconds (async mode)
- 100+ files: ~0.5 sec/file (async with parallelism)
If Slower:
-
Check file count vs threshold:
- Async kicks in at 30+ files for batch apply
- Check log:
[INFO] [Startup] Async operations: Enabled/Disabled
-
Network folder latency:
- Network files take longer
- OneDrive sync can add 2-3 seconds per file
- Consider copying files locally first
-
Large file sizes:
- Files >50MB take longer
- This is normal behavior
-
AIP sync delay:
- Microsoft Purview sync can add time
- Check Purview client status
-
Enable async operations:
- Check
app_config.json→async.enableAsyncOperations: true - Lower thresholds for faster async activation
- Check
Symptoms:
- Application becomes slow over time
- Windows shows "Low memory" warning
- Error:
OutOfMemoryException
Solutions:
-
Close other applications:
- Free up RAM
- Close browser tabs
- Close unnecessary Office applications
-
Process in smaller batches:
- Limit to 50-100 files per batch
- Clear selection and repeat
-
Restart FileLabeler:
- Closes all runspaces
- Frees up memory
-
Check available RAM:
Get-CimInstance Win32_OperatingSystem | Select-Object TotalVisibleMemorySize, FreePhysicalMemory
- Recommended: 8GB+ for large batches (300+ files)
C:\Users\<username>\Documents\FileLabeler_Logs\
FileLabeler_Log_yyyyMMdd_HHmmss.txt
| Level | Meaning | Action Required |
|---|---|---|
| INFO | Normal operation | None - informational |
| WARNING | Non-critical issue | Monitor, may need attention |
| ERROR | Operation failed | Investigate and resolve |
| CRITICAL | Application-stopping | Immediate action required |
All errors:
Select-String -Path "FileLabeler_Log_*.txt" -Pattern "\[ERROR\]" -Context 0,3Critical issues:
Select-String -Path "FileLabeler_Log_*.txt" -Pattern "\[CRITICAL\]" -Context 0,5Specific file errors:
Select-String -Path "FileLabeler_Log_*.txt" -Pattern "filename.docx" |
Select-String -Pattern "\[ERROR\]"| Category | User Message (Norwegian) | Suggestion |
|---|---|---|
| FileAccess | Ingen tilgang til filen | Check file/folder permissions |
| FileLocked | Filen er i bruk | Close file in Office applications |
| FileNotFound | Filen ble ikke funnet | Verify file still exists |
| Network | Nettverksfeil | Check network connection/VPN |
| AIPJustification | Begrunnelse kreves | Provide justification for downgrade |
| AIPProtection | Beskyttelsesinnstillinger kreves | Configure protection settings |
| Memory | Ikke nok minne | Close apps, process fewer files |
| Timeout | Operasjonen tok for lang tid | Retry with fewer files |
Method 1: Via UI
- Click "Innstillinger" (Settings)
- Go to "Logging" tab
- Check "Aktiver detaljert logging"
- Click "Lagre" (Save)
Method 2: Via Config File
Edit app_config.json:
{
"logging": {
"enableDetailedLogging": true
}
}Critical errors are also written to Windows Event Log:
- Open Event Viewer (
eventvwr.msc) - Navigate to Windows Logs → Application
- Filter by Source: "FileLabeler"
- Look for Error entries
Check AIP Module:
Get-Module -ListAvailable -Name PurviewInformationProtection
Get-Command -Module PurviewInformationProtectionTest AIP Cmdlets:
Get-AIPFileStatus -Path "C:\path\to\test-file.docx"Check Runspace Support:
[RunspaceFactory]::CreateRunspacePool(1, 4) | Out-Null
Write-Output "Runspace pool support: OK"When reporting issues, provide:
-
Log File: Most recent
FileLabeler_Log_*.txt -
Error Screenshot: If error dialog shown
-
Environment:
# Collect diagnostic info @" Windows: $(Get-CimInstance Win32_OperatingSystem | Select-Object -ExpandProperty Caption) PowerShell: $($PSVersionTable.PSVersion) AIP Module: $(Get-Module -ListAvailable -Name PurviewInformationProtection | Select-Object -ExpandProperty Version) FileLabeler Version: 1.1 "@ | Out-File "$env:USERPROFILE\Desktop\FileLabeler_Diagnostics.txt"
-
Reproduction Steps: What were you doing when error occurred?
-
File Count: How many files were being processed?
-
Location: Local files or network/OneDrive?
A: This is expected behavior when labeling updates metadata. The -PreserveFileDetails flag works correctly, but Office applications detect the metadata change and auto-save, which updates the modified date.
See DOCUMENT_AUTOSAVE_INFO.md in archive for detailed explanation.
A: Currently not supported. FileLabeler is designed for applying labels, not removing them. Use Microsoft Purview client for label removal.
A: The file has an encrypted label not in your labels_config.json. This is normal. Add the label ID to config if you need to work with these files.
A: No. FileLabeler requires Windows PowerShell and Microsoft Purview client, which are Windows-only.
A: Download new version, backup your labels_config.json, replace files, and keep your config file. See INSTALLATION.md.
If your issue isn't covered here:
- Search existing GitHub issues: Issues
- Check discussions: Discussions
- Create a new issue: Include diagnostic information from above
Most common solution: Restart the application and try with a smaller batch of files first! 🔄