How do I troubleshoot an AWS Replication Agent installation failure on my Linux server?
I want to install the AWS Replication Agent for AWS Application Migration Service or AWS Elastic Disaster Recovery, but the installation failed.
Resolution
Identify the cause of the installation issues
Use the AWSSupport-TroubleshootLinuxMGNDRSAgentLogs runbook
Prerequisites: Make sure that your AWS Identity and Access Management (IAM) user or role has the required permissions. For more information, see Required IAM permissions on AWSSupport-TroubleshootLinuxMGNDRSAgentLogs. Also, upload the installer-path/aws_replication_agent_installer.log replication agent log file to an Amazon Simple Storage Service (Amazon S3) bucket.
To automatically identify installation issues for the Application Migration Service or Elastic Disaster Recovery replication agent in Linux source servers, use the AWSSupport-TroubleshootLinuxMGNDRSAgentLogs automation runbook. The runbook uses the AWS Replication Agent installation log files to provide a list of detected errors and how to resolve them.
To run AWSSupport-TroubleshootLinuxMGNDRSAgentLogs, see Instructions on AWSSupport-TroubleshootLinuxMGNDRSAgentLogs. For ServiceName (Required), select AWS MGN for Application Migration Service, or AWS DRS for Elastic Disaster Recovery.
Manually identify errors
Run the following command to manually identify AWS Replication Agent installation errors:
less +G installer-path/aws_replication_agent_installer.log
Note: Replace installer-path with the path that you used to install the replication agent.
Based on the error that you identified, use the following troubleshooting steps to resolve the issue.
Troubleshoot the "failed to map segment from shared object: Operation not permitted" error
The installation script uses the /tmp directory. If you set noexec on /tmp, then libz.so can't map segments and you receive the following error message:
"error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted"
To resolve this issue, run the following command to mount the volume with exec permissions:
sudo mount /tmp -o remount,exec
Then, reinstall the AWS Replication Agent for Application Migration Service or Elastic Disaster Recovery.
After you finish the installation, run the following command to restore the server with noexec activated:
sudo mount /tmp -o remount,noexec
If you don't want to remove noexec from the /tmp directory, then add the following environment variable to the command:
TMPDIR='my_temp_dir' AGENT INSTALLATION COMMAND
Note: Replace my_temp_dir with a directory that doesn't have noexec and AGENT INSTALLATION COMMAND with the command that you use to install the agent.
Example command:
TMPDIR='temp1' sudo chmod +x aws-replication-installer-init; sudo ./aws-replication-installer-init
Troubleshoot the "security token included in the request is expired" error
If your IAM role expires, then API calls to the Application Migration Service or Elastic Disaster Recovery endpoint fail. As a result, you receive the following error message:
"botocore.exceptions.ClientError: An error occurred (ExpiredTokenException) when calling the GetAgentInstallationAssetsForDrs operation: The security token included in the request is expired [installation_id: 1a9af9d3-9485-4e02-965e-611929428c61, agent_version: 3.7.0, mac_addresses: 206915885515739,206915885515740, _origin_client_type: installer]"
To resolve this issue, request temporary security credentials to generate a new token. Or, install the role with an access key or secret access key for Application Migration Service or Elastic Disaster Recovery.
Troubleshoot the "ssl.SSLCertVerificationError" error
If you use an earlier operating system (OS) version with Python 3.10 or later, then you might receive the following error message:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997) - urllib.error.URLError: urlopen error unknown url type: https
This issue occurs because Python 3.10 and later require OpenSSL 1.1.1 or later. Earlier OS versions ship an OpenSSL version that's outdated, so Python can't build a working SSL module. As a result, the AWS Replication Agent can't validate the SSL certificate to the Application Migration Service or Elastic Disaster Recovery endpoint. For more information, see PEP 644 -- Require OpenSSL 1.1.1 or newer on the Python Enhancement Proposals website.
To resolve this issue, complete the following steps to update the OS:
-
To refresh the certificate authority (CA) certificate bundle, run the following command based on your Linux distribution.
Amazon Linux, Red Hat Enterprise Linux (RHEL), CentOS, Oracle, Rocky, and AlmaLinux:sudo yum install -y ca-certificates && sudo update-ca-trustSUSE and SUSE Linux Enterprise Server (SLES):
sudo zypper install -y ca-certificates && sudo update-ca-certificatesDebian and Ubuntu:
sudo apt-get update && sudo apt-get install -y ca-certificates && sudo update-ca-certificates -
Run the following command to check the OpenSSL version that Python uses:
python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"Note: On SLES, the OpenSSL version might report a later version than the version that Python actually uses. To identify the correct version, check the Python value.
-
If your distribution's repository doesn't offer OpenSSL 1.1.1 or later, then proceed to step 4.
Note: For Amazon Linux 2 (AL2) instances, proceed to step 4. The latest version of OpenSSL in AL2 is 1.0.2. AL2 reached end of life on June 30, 2026. It's a best practice to migrate AL2 instances to Amazon Linux 2023 (AL2023).
If your distribution's repositories provide OpenSSL 1.1.1 or later, then update the OpenSSL version through the package manager. Run the following command based on your distribution.
RHEL, CentOS, Oracle, Rocky, and AlmaLinux:sudo yum update -y openssl openssl-libsNote: For AL2023 and other dnf-based Linux distributions, replace yum with dnf.
SUSE and SLES:sudo zypper --non-interactive update openssl libopenssl1_1 libopenssl3Debian and Ubuntu:
sudo apt-get update && sudo apt-get install --only-upgrade -y openssl libssl3Note: For Debian and Ubuntu releases that ship OpenSSL 1.1.1, replace libssl3 with libssl1.1.
-
Update your OS version to a later version that offers OpenSSL 1.1.1 or later.
-
Reinstall the AWS Replication Agent for Application Migration Service or Elastic Disaster Recovery.
Important: Don't downgrade to Python 2.7 or 3.8 as a workaround to the OpenSSL version requirement. These Python versions reached end of life and aren't available in distribution repositories.
Troubleshoot the "botocore.exceptions.CredentialRetrievalError" error
If you modify the AWSElasticDisasterRecoveryAgentRole or AWSApplicationMigrationAgentRole IAM service role, then you receive the following error message:
"botocore.exceptions.CredentialRetrievalError: Error when retrieving credentials from cert: Oct 17, 2022 9:38:54 AM com.amazonaws.cloudendure.credentials_provider.SharedMain createAndSaveJks"
To resolve this issue, update the permissions policy for the IAM service role based on the service that you use.
Application Migration Service permissions policy:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "mgn.amazonaws.com" }, "Action": [ "sts:AssumeRole", "sts:SetSourceIdentity" ], "Condition": { "StringLike": { "sts:SourceIdentity": "s-*", "aws:SourceAccount": "123456789012" } } } ] }
Note: Replace 123456789012 with your AWS account ID.
Elastic Disaster Recovery permissions policy:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "drs.amazonaws.com" }, "Action": [ "sts:AssumeRole", "sts:SetSourceIdentity" ], "Condition": { "StringLike": { "sts:SourceIdentity": "s-*", "aws:SourceAccount": "123456789012" } } } ] }
Note: Replace 123456789012 with your account ID.
Troubleshoot the "A dependency job for aws-replication.target failed" error
If the /var directory has 754 permissions or there were issues when you created Linux groups for the aws-replication user, then you receive the following error message:
"stderr: A dependency job for aws-replication.target failed. See 'journalctl -xe' for details"
To resolve the /var issue, run the following command to update the permissions:
sudo chmod 755 /var
To resolve the Linux group issue, complete the following steps:
-
Uninstall the AWS Replication Agent for Application Migration Service or Elastic Disaster Recovery.
-
Run the following commands to delete the aws-replication user and aws-replication group:
sudo userdel aws-replication sudo groupdel aws-replication -
Reinstall the AWS Replication Agent for Application Migration Service or Elastic Disaster Recovery.
For installation prerequisites for Application Migration Service, see Installation requirements. For Elastic Disaster Recovery, see Installation requirements for AWS Replication Agent.
Troubleshoot the "Exception in thread "main" com.amazonaws.services.drs.model.InternalServerException" error
If you deactivate the AWS Security Token Service (AWS STS) endpoint, then you receive the following error message:
"Exception in thread "main" com.amazonaws.services.drs.model.InternalServerException: An unexpected error has occurred (Service: Drs; Status Code: 500; Error Code: InternalServerException; Request ID: 4f4a76cb-aaec-44cc-a07a-c3579454ca55; Proxy: null"
This error occurs because Application Migration Service and Elastic Disaster Recovery call AWS STS to assume the role in the client account. To resolve this issue, activate the STS endpoint in the client account.
"could not insert module ./aws-replication-driver.ko:" error
If you activated SecureBoot on the source server, then you receive one of the following error messages:
"insmod: ERROR: could not insert module ./aws-replication-driver.ko: Required key not available"
"insmod: ERROR: could not insert module ./aws-replication-driver.ko: Key was rejected by service"
You can't use SecureBoot in a Linux OS with Application Migration Service or Elastic Disaster Recovery. To resolve this issue, deactivate SecureBoot for the Linux OS.
Note: Typically, you use the hypervisor to deactivate SecureBoot.
To check the SecureBoot status, run the following command:
sudo mokutil --sb-state
Troubleshoot the "could not insert module ./aws-replication-driver.ko: Cannot allocate memory" error
If your Linux OS doesn't have enough memory to install the agent, then you receive the following error message:
"insmod: ERROR: could not insert module ./aws-replication-driver.ko: Cannot allocate memory"
To resolve this issue, make sure that your OS has at least 300 MB of free memory when you run the installation. This issue might occur because of memory fragmentation. To resolve memory fragmentation issues, reboot the source server. Also, check whether security or antivirus software causes memory or kernel protection that can block the agent installation.
Troubleshoot the "Unexpected error while making agent driver! ", "Kernel development package ...missing from repositories", or "Kernel development or header package...did not install" errors
Prerequisites: Make sure that you meet the Linux installation requirements.
The kernel headers or development version must be the same version as the running kernel so that AWS Replication Agent can build its driver. If the agent can't find or install packages for the running kernel, then you receive one of the following error messages:
"Unexpected error while making agent driver! Are kernel linux headers installed correctly?"
"Kernel development package for '************' are missing from repositories"
"Kernel development or header package for ************ did not install"
To resolve this issue, complete the following steps:
-
Check the installation log for repository access issues, such as a deactivated repository or no network path to the repository.
-
Run the following command to confirm your running kernel version:
uname -r -
If the folder that contains the kernel-devel or linux-headers content is a symbolic link, then remove the link.
-
To install a matching package version, run the following command based on your distribution.
AL2, RHEL, CentOS, Rocky, AlmaLinux, and Oracle:sudo yum install -y kernel-devel-$(uname -r)Note: For AL2023 and other dnf-based Linux distributions, replace yum with dnf.
Oracle Linux that runs the Unbreakable Enterprise Kernel (UEK):sudo yum install -y kernel-uek-devel-$(uname -r)SUSE and SLES:
sudo zypper install -y kernel-default-devel-$(uname -r)Note: The preceding command uses the default kernel flavor. For a different kernel flavor, replace default with the kernel flavor name.
Debian and Ubuntu:sudo apt-get update && sudo apt-get install -y linux-headers-$(uname -r) -
If no package matches your running kernel, then manually download the package. Or, upgrade the kernel to a version that has the available packages based on your distribution:
For RHEL, CentOS, Oracle, and SUSE package directory, check your distribution's package documentation.
For Debian, see Packages on the Debian website.
For Ubuntu, see Ubuntu packages search on the Ubuntu packages website. -
Reinstall the AWS Replication Agent for Application Migration Service or Elastic Disaster Recovery.
Related information
Troubleshooting Elastic Disaster Recovery
Troubleshooting (Application Migration Service)
- Language
- English

Thanks for sharing all the tips, I am still facing the issue " Kernel version is not supported", I am running Ubuntu 22.04 VM on Azure and trying to migrate it to AWS using MGN.
replied 3 years ago
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
Remounting the /tmp can break my already running process in Prod ENV, Can you please share other workaround or solution for this?
replied 3 years ago
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
This article was reviewed and updated on 2026-09-02.
Relevant content
asked a year ago
asked 3 years ago
asked 3 years ago
AWS OFFICIALUpdated 9 months ago