Problem description
EC2 VSS Backup Fails with "Cannot call a method on a null-valued expression"
Cause
The failure occurred because one or more AWS components on the EC2 instance(s) are outdated. This issue is typically caused by one or more of the following:
The EC2 instance lacks the AWS CLI or is running an outdated version.
The EC2 instance does not have AWS Tools for PowerShell installed, or the installed version is outdated.
The AWS Systems Manager (SSM) Agent is either missing or outdated on the EC2 instance.
The Ec2Launch folder structure is missing.
The EC2Config version is outdated.
Traceback
Verification
Ensuring AWS Components Are Installed and Up-to-Date on EC2 Instances To confirm that the necessary AWS components are installed and current on your EC2 instance, follow these steps:
AWS CLI
Run:
aws --version
AWS Tools for PowerShell
Run:
Get-AWSPowerShellVersion
AWS SSM Agent
Run in PowerShell:
Get-Service AmazonSSMAgent
EC2Launch
Run: "
C:\Program Files\Amazon\EC2Launch\EC2Launch.exe
" version
More InfoEC2Config
Open Programs and Features in Windows and check the version of Ec2ConfigService.
Resolution
To resolve this issue you need to install / upgrade all the AWS components on your EC2 instances(s).
1. Upgrade the 'AWS CLI':
*AWS CLI:
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
2. Upgrade the 'AWS Tools for PowerShell':
*AWS Tools for PowerShell:
Install-Module -Name AWSPowerShell
https://sdk-for-net.amazonwebservice...dSDKForNet.msi
3. Upgrade the 'AWS SSM Agent'
*AWS SSM Agent:
https://docs.aws.amazon.com/systems-...ted-agent.html
4. Install the latest version of EC2Launch on your EC2 Instance.
You can find a step by step guide on how to Install the latest version of EC2Launch on the Amazon link below:
https://docs.aws.amazon.com/AWSEC2/l...-download.html
5. Install the latest version of EC2Config
https://docs.aws.amazon.com/AWSEC2/l...g_Install.html