Introduction
This article aims to help you resolve an issue when using the AWS Systems Manager Session Manager to access an Amazon RDS MySQL instance on a Windows 11 computer, but you can't find the AWS Agent logs directory. We'll cover the key concepts and provide detailed steps to troubleshoot the issue.
Background: AWS CLI
The AWS Command Line Interface (AWS CLI) is a unified tool to manage AWS services from the command line. It is pre-installed with the AWS SDK for Windows, which includes the AWS Systems Manager Session Manager. The Session Manager allows you to establish a secure and interactive shell, PowerShell session, or SSH session to manage your instances in the AWS environment.
Issue Description
When trying to start a Session Manager session using the following command:
awsssm start-session --document-name "AWS-StartPortForwardingSession"
You might encounter an error message saying:
An error occurred (ClientError) when calling the StartSession operation: The following error occurred: The required shared credentials file (C:\Users\\.aws\credentials) cannot be found.
Although this error message seems to be related to missing AWS credentials, it might also indicate that the AWS Agent logs directory is not properly configured on your Windows 11 computer.
Solution Description
In this section, we will discuss how to find the AWS Agent logs directory and ensure it is properly configured.
Finding the AWS Agent Logs Directory
The AWS Agent logs directory is usually located in:
C:\ProgramData\Amazon\AWSEnv\
To verify the location, you can check the environment variable:
%AWS_LOG_PATH%
Press Win + R to open the Run dialog box, type sysdm.cpl, and press Enter. In the System Properties window, click on the Advanced tab, then click on the Environment Variables button.
Checking the AWS Agent Logs
Once you have located the AWS Agent logs directory, you can check the logs for any error messages or issues:
- Open File Explorer and navigate to the AWS Agent logs directory.
-
Look for the
session-managerlogs file (session-manager.log). - Open the logs file using a text editor, such as Notepad or Notepad++.
Troubleshooting the Issue
If you find any error messages or issues in the logs, try the following steps:
- Make sure that the AWS Agent is installed and running. You can check the status by opening the Services panel in the Windows Control Panel and looking for the "Amazon MWS" or "Amazon S3" service.
- Check if there are any firewall rules blocking the Session Manager traffic. Make sure that the following ports are open: 443 (HTTPS), 22 (SSH), and 3389 (RDP).
-
If you are using a proxy server, make sure that it is properly configured in the AWS CLI. You can set the proxy server by using the
--proxy-endpointoption when starting the Session Manager session. - If the issue persists, try uninstalling and reinstalling the AWS SDK for Windows and the AWS Systems Manager Session Manager.
Conclusion
In this article, we have discussed how to find the AWS Agent logs directory on a Windows 11 computer and checked the logs for any issues when encountering an error message while trying to start a Session Manager session using the AWS CLI. We have also provided some troubleshooting steps to help you resolve the issue.