This article provides troubleshooting steps for IT professionals encountering file lock errors during the installation or upgrade of AWS Application Migration Service or Elastic Disaster Recovery Agent on Windows systems, offering practical solutions to resolve the issue and complete the installation process successfully.
File Lock Error During AWS Application Migration Service/Elastic Disaster Recovery Agent Installation
When reinstalling the AWS Application Migration Service or Elastic Disaster Recovery Service Agent, you might encounter the following error in the agent installation logs:
PermissionError: [WinError 5] Access is denied: 'C:\Program Files (x86)\AWS Replication Agent\dist\win32\servicemanager.pyd'
We can review the installation log located in: <install_path>\aws_replication_agent_installer.log
Issue
This error occurs because Windows maintains a file lock on servicemanager.pyd
, preventing the installation process from accessing the file. Even with administrator privileges, the file cannot be deleted due to active system processes.
Resolution
Try the following solutions in order:
-
Close Event Viewer Sessions
- Verify if any user has an active Event Viewer window open through RDP or local console sessions
- Close all Event Viewer instances
- Attempt the installation again
-
Check Security Software or third party application Interference
-
Rename the File
- Although deletion is restricted, administrators can rename the file
- Rename
servicemanager.pyd
to allow the installation to proceed
- Continue with the installation process
-
System Reboot
- If previous solutions are unsuccessful, restart the Windows system
- This will release all file locks
- Proceed with the installation after the system restarts
Note: We recommend attempting these solutions in the order presented, using system restart as a last resort.
Related Information :
Installing the AWS MGN Replication Agent
FAQ- MGN Agent related
FAQ- DRS Agent related
Troubleshooting Application Migration Agent issues
Troubleshooting Elastic Disaster Recovery
How do I troubleshoot AWS Replication Agent installation failure on my EC2 Windows instance?