Skip to content

Troubleshooting

Mazay Jimenez-Salinas edited this page Mar 1, 2024 · 45 revisions

This section contains information about how to monitor the system and how to troubleshoot specific issues that may occur with RES.

General Debugging and Monitoring

This section contains information about where information can be found within RES.

Useful log and event information sources

There are various sources of information retained that can be referenced for troubleshooting and monitoring uses.

Log files on the environment Amazon EC2 instances

Log files exist on the Amazon EC2 instances in use by RES. The SSM Session Manager can be used to open a session to the instance for examining these files.

On infrastructure instances such as the cluster-manager and vdc-controller, application and other logs can be found at the following locations.

  • /opt/idea/app/logs/application.log
  • /root/bootstrap/logs/
  • /var/log/
  • /var/log/sssd/
  • /var/log/messages
  • /var/log/user-data.log
  • /var/log/cloud-init.log
  • /var/log/cloud-init-output.log

On a Linux virtual desktop, the following contain useful log files

  • /var/log/dcv/
  • /root/bootstrap/logs/userdata.log
  • /var/log/messages

On Windows virtual desktop instances logs can be found at

  • PS C:\ProgramData\nice\dcv\log
  • PS C:\ProgramData\nice\DCVSessionManagerAgent\log

On Windows, some applications logging can be found at:

  • PS C:\Program Files\NICE\DCV\Server\bin

On Windows, the NICE DCV certificate files can be found in:

  • C:\Windows\System32\config\systemprofile\AppData\Local\NICE\dcv\

Amazon CloudWatch Log Groups

The Amazon EC2 and AWS Lambda compute resources will log information to Amazon CloudWatch Log Groups. The log entries within them can provide useful information when troubleshooting potential issues or for general information.

Those groups will be named as follows:

  • /aws/lambda/< envname >-/ - lambda related
  • /< envname >/
    • analytics/ - OpenSearch database related
    • cluster-manager/ - main infrastructure host
    • vdc/ - virtual desktop related
      • dcv-broker/ - desktop related
      • dcv-connection-gateway/ - desktop related
      • controller/ - main desktop controller host
      • dcv-session/ - desktop session related

When examining log groups, it can be helpful to filter using upper and lower case strings such as the following. This will output only those messages containing the noted strings.

?"ERROR" ?"error"

Another method of monitoring for issues is to create Amazon CloudWatch Dashboards that contain widgets displaying the data of interest.

An example is to create a widget that counts the occurrence of the strings error and ERROR and graph them as lines. This method makes it easier to detect the occurrence of potential issues or trends indicating a pattern change has occurred.

The following is an example of that for the infrastructure hosts. To use this, concatenate the query lines and replace the < envname > and < region > attributes with the appropriate values.

{
    "widgets": [
        {
            "type": "log",
            "x": 0,
            "y": 0,
            "width": 24,
            "height": 6,
            "properties": {
                "query": "SOURCE '/<envname>/vdc/controller' | 
                    SOURCE '/<envname>/cluster-manager' | 
                    SOURCE '/<envname>/vdc/dcv-broker' | 
                   SOURCE '/<envname>/vdc/dcv-connection-gateway' | 
                    fields @timestamp, @message, @logStream, @log\n| 
                    filter @message like /(?i)(error|ERROR)/\n| 
                    sort @timestamp desc| 
                    stats count() by bin(30s)",
                "region": "<region>",
                "title": "infrastructure hosts",
                "view": "timeSeries",
                "stacked": false
            }
        }
    ]
}

An example of the Dashboard might appear as follows.

res-cw-01

CloudFormation Stacks

The CloudFormation stacks created during environment creation contain resources, event, and output information associated with the configuration of the environment.

For each of the stacks, the Events, Resources, and Outputs tab can be referred to for information about the stacks.

RES stacks

  • < envname >-bootstrap
  • < envname >-cluster
  • < envname >-metrics
  • < envname >-directoryservice
  • < envname >-identity-provider
  • < envname >-analytics
  • < envname >-shared-storage
  • < envname >-cluster-manager
  • < envname >-vdc
  • < envname >-bastion-host

Demo Environment Stack (If you are deploying a demo environment and do not have these external resources available, you can use AWS High Performance Compute recipes to generate resources for a demo environment.)

  • < envname >
  • < envname >-Networking
  • < envname >-DirectoryService
  • < envname >-Storage
  • < envname >-WindowsManagementHost

System failures due to an issue and reflected by Amazon EC2 Auto Scaling Group Activity

If the RES UIs are indicating server errors, the cause may be an application software or other issue.

Each of the infrastructure Amazon EC2 instance autoscaling groups (ASGs) contain an Activity tab that can be useful for detecting scaling activity for the instances. If UI pages note any errors or are not accessible, check the Amazon EC2 console for multiple terminated instances and check the Auto Scaling Group Activity tab for the related ASG to determine if Amazon EC2 instances are cycling.

If so, use the related Amazon CloudWatch log group for the instance to determine if errors are being logged that might indicate the cause of the issue. It may also be possible to use the SSM Session console to open a session to a running instance of that type and examine the log files on the instance to determine a cause before the instance is marked as unhealthy and terminated by the ASG.

The ASG console may show activity similar to the following if this issue is occurring.

res-targetgroup-01

Typical Amazon EC2 Console Appearance

This section contains screenshots of the system operating in various states.

Infrastructure hosts

The Amazon EC2 console, when no desktops are running, will typically look similar to the following. The instances that are show are the RES infrastructure Amazon EC2 hosts. The prefix in the name of the instances will be the RES environment name.

res-ec2-01

Infrastructure hosts and virtual desktops

The Amazon EC2 console when virtual desktops are running, they will appear similar to the following. In this case, the virtual desktops are noted in red. The suffix to the instance name will be the user that created the desktop. The name in the center will be the Session Name set at launch time and will be either be the default MyDesktop or the name set by the user.

res-ec2-02

Hosts in a terminated state

When the Amazon EC2 console shows terminated instances, they will generally be desktop hosts that have been terminated. If the console includes infrastructure hosts in a terminated state, particularly if there are multiple of the same type, that may indicate a system issue in progress.

The following show desktop instances that have been terminated.

res-ec2-03

Useful Active Directory (AD) related commands for reference

The following are examples of ldap related commands that can be entered on infrastructure hosts to view AD configuration related information. The domain and other parameters used should reflect those entered at environment creation time.

ldapsearch "(cn=AWS Delegated Add Workstations To Domain Users)" -x -h corp.res.com -b "DC=corp,DC=res,DC=com" -D "CN=Admin,OU=Users,OU=CORP,DC=corp,DC=res,DC=com" -w <password>

ldapsearch "(&(objectClass=group))" -x -h corp.res.com -b "DC=corp,DC=res,DC=com" -D "CN=Admin,OU=Users,OU=CORP,DC=corp,DC=res,DC=com" -w <password>

Windows DCV debugging

On a Windows desktop, list the session associated with it using the following

PS C:\Windows\System32\config\systemprofile\AppData\Local\NICE\dcv> & 'C:\Program Files\NICE\DCV\Server\bin\dcv.exe'list-sessions Session: 'a7953489-9dbf-492b-8135-7709dccc4cab' (owner:admin2 type:console name:windows1)

Find NICE DCV Version Information

NICE DCV is utilized for virtual desktop sessions. https://aws.amazon.com/hpc/dcv/. The following are examples of determining the version of the DCV software installed.

Linux

[root@ip-10-3-157-194 ~]# /usr/bin/dcv version

NICE DCV 2023.0 (r14852) Copyright (C) 2010-2023 NICE s.r.l. All rights reserved.

This product is protected by copyright and licenses restricting use, copying, distribution, and decompilation.

Windows

PS C:\Windows\System32\config\systemprofile\AppData\Local\NICE\dcv> & 'C:\Program Files\NICE\DCV\Server\bin\dcv.exe' version

NICE DCV 2023.0 (r15065) Copyright (C) 2010-2023 NICE s.r.l. All rights reserved.

This product is protected by copyright and licenses restricting use, copying, distribution, and decompilation.

Issue RunBooks

The following section contains issues that may occur, how to detect them, and suggestions on how to resolve the issue.

I am not authorized to perform an action in Research and Engineering Studio on AWS

I am not authorized to perform iam:PassRole

If you receive an error that you're not authorized to perform the iam:PassRole action, your policies must be updated to allow you to pass a role to RES.

Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service-linked role. To do this, you must have permissions to pass the role to the service.

The following example error occurs when an IAM user named marymajor tries to use the console to perform an action in RES. However, the action requires the service to have permissions that are granted by a service role. Mary does not have permissions to pass the role to the service.

User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole

In this case, Mary's policies must be updated to allow her to perform the iam:PassRole action. If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials.

I want to allow people outside of my AWS account to access my Research and Engineering Studio on AWS resources

You can create a role that users in other accounts or people outside of your organization can use to access your resources. You can specify who is trusted to assume the role. For services that support resource-based policies or access control lists (ACLs), you can use those policies to grant people access to your resources.

To learn more, consult the following:

Storage

I created file system through RES but it doesn’t mount on the VDI hosts

The file systems need to be in “Available” state before they can be mounted by VDI hosts. Follow steps below to validate file system is in needed state

Amazon EFS

  1. Go to Amazon EFS console [us-east-1]
  2. Check File system state is Available
  3. If File system state is not Available, wait before launching VDI hosts

Amazon FSx ONTAP

  1. Go to Amazon FSx console [us-east-1]
  2. Check Status is Available
  3. If Status is not Available, wait before launching VDI hosts

I onboarded file system through RES but it doesn’t mount on the VDI hosts

The file systems onboarded on RES should have the needed security group rules configured to allow VDI hosts to mount the file systems. As these file systems are created externally to RES, RES doesn’t manage the associated security group rules.

The security group associated with the onboarded file systems should allow following inbound traffic

  • NFS traffic (port: 2049) from the linux VDC hosts
  • SMB traffic (port: 445) from the windows VDC hosts

I am not able to read/write on Amazon FSx for NetApp ONTAP from VDI hosts

ONTAP supports UNIX, NTFS and MIXED security style for the volumes. The security styles determine the type of permissions ONTAP uses to control data access and what client type can modify these permissions.

For example, if a volume uses UNIX security style, SMB clients can still access data (provided that they properly authenticate and authorize) due to the multi-protocol nature of ONTAP. However, ONTAP uses UNIX permissions that only UNIX clients can modify using native tools.

Example permission handling use cases

Using UNIX style volume with Linux workloads Permissions can be configured by the sudoer for other users. For eg. following would give all members of <group-ID> full read/write permissions on /<project-name> directory

sudo chown root:<group-ID> /<project-name> sudo chmod 770 /<project-name>

Using NTFS style volume with Linux and Windows workloads Permissions can be configured on the file share using share properties. For eg. following would give pentest_user_01 full control permissions on the file share myshare.

If the volume is going to be used by both Linux and Windows client we need to set up a name mapping on SVM that will associate any Linux user name to the same user name with the NetBIOS domain name format of domain\username. This is needed to translate between Linux and Windows users. For reference see Enabling multiprotocol workloads with Amazon FSx for NetApp ONTAP

I created Amazon FSx for NetApp ONTAP from RES but it did not join my domain

Currently, if you are creating Amazon FSx for NetApp ONTAP from RES console, the file system gets provisioned but it does not join the domain. To join the created ONTAP file system SVM to your domain, please see here Joining SVMs to a Microsoft Active Directory and follow the steps on Amazon FSx console [us-east-1]. Make sure required permissions are delegated to the Amazon FSx Service Account in AD. Once the SVM joins the domain successfully, go to SVM Summary > Endpoints > SMB DNS name, copy the DNS name as it will be needed later.

After joining to domain, edit the SMB DNS config key in cluster settings DynamoDB table:

  1. Go to Amazon DynamoDB console [us-east-1] 2.** Tables >** select -cluster-settings
  2. Explore table items > expand Filters, and put following filter
    1. Attribute name - key
    2. Condition - Equal to
    3. Value - shared-storage..fsx_netapp_ontap.svm.smb_dns
  3. Select the returned item > Actions > Edit item
  4. Update the value to string value (SMB DNS name copied earlier) 6.** Save and close**

Additionally, ensure security group associated with the file system allows traffic as recommended on File System Access Control with Amazon VPC. New VDI hosts using the file system will now be able to mount the domain joined SVM and file system.

Alternative, you may onboard existing file system which is already joined to your domain using RES Onboard File System capability from Environment Management > File Systems > Onboard File System

SSO / Login

Common SSO misconfigurations

Compare your SSO configurations to the examples below.

  1. Cognito → UserPool → (Your user pool) → Sign in experience → Click on your identity provider under Federated identity provider sign-in section image

  2. AWS Identity Center → Applications → (Your application) under Customer Managed tab → Actions → Edit Configuration → Application Properties and Application Metadata image

  3. AWS Identity Center → Applications → (Your application) under Customer Managed tab → Actions → Edit attribute mapping image

When I login to the environment, I am immediately returned to the SSO login page

This situation indicates a misconfiguration of your SSO integration. To determine the issue, check the logs for the controller instance. Do this by:

  • See logs
  • See SSO configuration settings, to know if there was a mistake
    • AWS Console → DynamoDB
    • Cluster settings table for the corresponding env
    • Explore table data
    • Filters → key = key, condition = contains, value = sso
    • Run
    • Verify that the sso configuration values are correct
    • If wrong, manually set the sso_enabled key’s value to false in DDB
    • Go back to the UI and you will be able to re-configure SSO

Login using the breakglass user clusetradmin after SSO is enabled

Access the env with the parameter sso=false as <env-url>?sso=false

I get "User not found" error when I try logging in

This means that the user is present in AD and not present in Cognito. RES syncs users every hour, so if you added a user in AD recently, it might take some time to get the users synced to Cognito. Please wait for the clock to hit the 'o clock mark and check if the user gets added to Cognito.

If the user is present in Cognito, follow these steps to log in:

  • Clear the browser cache for the last 1 hour
  • Try logging in now

If the user is not present in Cognito, follow these steps to debug:

  • Go to /cluster-manager/ log group in Cloudwatch and open the latest log
  • Look for "ad-sync" keyword and look for the reason why the user addition failed
  • In case some properties were missing on the user, you need to update the user properties in AD and wait for RES and Identity Center to sync the user before you login. RES syncs the users every hour while Identity Center's SLA is 4 hours.

If you used 'Cognito' as Provider Name while setting up SSO you might face this issue. Follow these steps to fix it:

  • Deleted the Federated identity provider in cognito
  • Updated 'sso.enabled' to False in DDB
  • Re-configured SSO with a different provider name

Identity Management

I added a user in AD and cannot see them in RES

The AD sync needs to be triggered. The AD Sync process is a scheduled event where once an hour, the default schedule, a Lambda runs that performs the sync of the AD with the RES environment.

If changes such as users or groups, there may be a lag until the next AD Sync process executes. To trigger it manually, perform the following at the AWS Lambda console

  • search for the Lambda named < env-name >-cluster-manager-scheduled-ad-sync
  • select the Test tab
  • search for the test event named CloudWatch
  • the content should be similar to the following=

{ "id": "cdc73f9d-aea9-11e3-9d5a-835b769c0d9c", "detail-type": "Scheduled Event", "source": "aws.events", "account": "123456789012", "time": "1970-01-01T00:00:00Z", "region": "us-west-2", "resources": [ "arn:aws:events:us-east-1:123456789012:rule/ExampleRule" ], "detail": {} }

  • save that event to a new name
  • select Test to trigger the execution
  • the Amazon CloudWatch Log group called < env-name >-cluster-manager should show the execution of the sync process

As an admin, I don’t see a user that is a part of Active Directory in the list of users when creating session

Sessions can only be created for active users. Active users are users who have logged into the environment at least once.

Error appearing in the cluster-manager Amazon CloudWatch log

2023-10-31T18:03:12.942-07:00 ldap.SIZELIMIT_EXCEEDED: {'msgtype': 100, 'msgid': 11, 'result': 4, 'desc': 'Size limit exceeded', 'ctrls': []}

If this error is appearing in the cluster-manager Amazon CloudWatch log it may indicate that too many user records are being returned in an ldap search. The mitigation is to change the configure of the IDP to increase the limit for the number of results returned in an ldap search.

Install

The CloudFormation Stack creation failed with "The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions"

This issue is because AWS Lambda has deprecated the Node.js 14 runtime and start blocking function creation since Feb 8, 2024. Check the AWS Lambda document for more details.

Solution

Update runtime of the AWSCDKCfnUtilsProviderCustomResourceProviderHandler* Lambda inside the RES CloudFormation template to nodejs16.x and try to redeploy it.

The CloudFormation Stack creation failed with "The maximum number of rules per security group has been reached."

The issue could be because of the ClientPrefixList used. A security group has a limit of 60 on the number of rules that can be added ina. security group. The ClientPrefixList used might be internally adding more that 60 rules to the security group.

Solution

  1. Use a less scoped ClientPrefixList
  2. Requst a Quota increase [AWS Console > Service Quotas > AWS services > Amazon VPC > Inbound or outbound rules per security group]

Redeploy the RES stack with updated changes.

The CloudFormation stack creation failed with "WaitCondition received failed message. Error: States.TaskFailed".

Look at the CloudWatch log group named <stack-name>-InstallerTasksCreateTaskDefCreateContainerLogGroup<nonce>-<nonce> to identify the issue/error message. If you see multiple log groups with same name, check the first one that shows up.

The error message must give a better idea of the issue.

Note: Make sure that the parameter values entered do not have spaces.

The CloudFormation stacks created successfully but the email invitation was not received

If an invitation email was not received after the CloudFormation stacks were successfully created the cause can be narrowed down by checking the following

Confirm the email address parameter was entered correctly

If the email address is incorrect or the email account cannot be accessed, the RES environment should be deleted and recreated.

Check the Amazon EC2 console for evidence of cycling instances

If there are Amazon EC2 instances that have the < envname > name prefix are appearing as terminated and being replaced with new instances, there may be an issue with the network or AD configuration.

When using Demo Environment Stack (If you are deploying a demo environment and do not have these external resources available, you can use AWS High Performance Compute recipes to generate resources for a demo environment.) If the Demo Environment Stack was used, confirm that the VPC, private, and public subnets, and other parameters selected during the RES installation were created by the BI stack. If other existing resources were used, there may be a issue with the RES resources not being able to communicate with each other, the AD, or other AWS services.

If any of the selections were incorrect, it may be necessary to delete the RES stack and recreate it.

When using existing resources If external existing resources were entered during the RES environment creation, confirm that the networking and AD match the expected configurations.

With either environment creation type, confirming that the infrastructure instances successfully joined the AD domain is critical. An example of a method to do that is to open an SSM Session to the instance and try the following. If no output appears, that indicates an issue with the AD configuration.

realm list

corp.res.com type: kerberos realm-name: CORP.RES.COM domain-name: corp.res.com configured: kerberos-member server-software: active-directory client-software: sssd required-package: oddjob required-package: oddjob-mkhomedir required-package: sssd required-package: adcli required-package: samba-common-tools login-formats: %U login-policy: allow-realm-logins

The <env-name>-vdc CloudFormation stack failed to delete due to a vdcdcvhostsecuritygroup error

If an environment deletion fails due a dependent object error such as a the vdcdcvhostsecuritygroup, this may be due to an Amazon EC2 instance having been launched using the AWS console into a RES created subnet or using a RES created security group.

The resolution is to check all Amazon EC2 instances to determine if any where launched in this manner, terminate any found, and resume the environment deletion.

When trying to create an environment, this error appeared for the CIDR block provided as a parameter

Received response status [FAILED] from custom resource. Message returned: failed to update cluster prefix list: An error occurred (InvalidParameterValue) when calling the ModifyManagedPrefixList operation: The specified CIDR (52.94.133.132/24) is not valid. For example, specify a CIDR in the following form: 10.0.0.0/16.

The expected format should be x.x.x.0/24 or x.x.x.0/32

Certificate expiration date

How to check the expiration date of a certificate. This example is from an aml2 virtual desktop instance.

root@ip-17-0-128-66 dcv]# openssl x509 -enddate -noout -in /var/lib/dcv/.config/NICE/dcv/dcv.pem

notAfter=Aug 22 17:44:37 2024 GMT

Manually renew Portal Domain Certs created by the external resources stack

Note: you need to have Route53 public hosted zone with the same DomainName in the same account for this to work.

  1. Deploy certs stack template with following parameters

    • DomainName: This is the PortalDomainName input attribute used during the installation of the external resources stack.
    • SubnetId: VpcId is the output value from the external resources stack
    • AdminNodeAmiId: Leave default value unchanged
    • CertificateNodeInstancetype: Leave default value unchanged
  2. Once the cert stack is deployed, you would need to copy the secret values from the newly created PrivateKey and Certificate to the once generated by the external resources stack. You can find the arn’s for the secrets in the outputs of the newly deployed certs stack and the external resources stack.

    • In AWS CLI, execute following commands once for the PrivateKey and Certificate each
      • PrivateKey: Naming convention PrivateKey-<cfn-stack-name>
      • Certificate: naming convention Certificate-<cfn-stack-name>
# Retrieve secret into <filename>.txt file
aws secretsmanager get-secret-value --secret-id <new_cert_stack_secret_arn> --query SecretString --output text > <filename>.txt

# Update actual secret contents with the <filename>.txt file contents
aws secretsmanager update-secret --secret-id <external_resources_stack_secret_arn> --secret-string file://<filename>.txt
  1. Terminate the vdc-gateway EC2 instance. The autoscaling group will initiate creation of a vdc-gateway instance. Once it is up, you should be able to resume operations on RES.
  2. CLEAN UP: Delete the newly deployed certs CFN stack.

CloudFormation stack creation failure during environment creation

Environment creation involves a number of resources being created through a series of operations. It is possible that, for the region selected, a capacity issue may occur that might cause a CloudFormation stack creation to fail.

If that occurs, potential resolutions can be to delete the environment and retry the create. The issue may be transient and attempting again might successfully create. An alternative is to create the environment in a different region.

Demo Environment Stack stack creation fails with AdDomainAdminNode CREATE_FAILED

If the Demo Environment Stack stack creation fails with an error similar to the following, it may be due to Amazon EC2 patching occurring unexpectedly during the provisioning that occurs after instance launch.

AdDomainAdminNode CREATE_FAILED Failed to receive 1 resource signal(s) within the specified duration

Methods to determine the cause of the failure include the following

  • check the SSM State Manager to see if patching is configured and if it is set for "all instances"
  • check the SSM RunCommand/Automation execution history to see if an execution of a potentially patching related SSM document coincides with an instance launch
  • determine from local instance logging if the instance rebooted during provisioning, the instance log files to check are noted in the section Log files on the environment Amazon EC2 instances

If patching is determined to be the cause, the remediation is to delay patching for the RES instances for at least 15-minutes after launch.

Snapshots

A Snapshot has a status of Failed

On the RES Snapshots page, if a snapshot has a status of Failed, the cause can be determined by going to the Amazon CloudWatch log group for the cluster-manager for the time that the error occurred.

[2023-11-19 03:39:20,208] [INFO] [snapshots-service] creating snapshot in S3 Bucket: asdf at path s31 [2023-11-19 03:39:20,381] [ERROR] [snapshots-service] An error occurred while creating the snapshot: An error occurred (TableNotFoundException) when calling the UpdateContinuousBackups operation: Table not found: res-demo.accounts.sequence-config

Infrastructure

Load balancer target groups without healthy instances

If issues such as server error messages are appearing in the UI or desktop sessions cannot connect, that may indicate an issue in the infrastructure Amazon EC2 instances.

The methods to determine the source of the issue are to first check the Amazon EC2 console for any Amazon EC2 instances that appear to be repeatedly terminating and being replaced by new instances. If that is the case, checking the Amazon CloudWatch logs may determine the cause.

Another method is check the load balancers in the system. An indication that there may be system issues is if any load balancers, found on the Amazon EC2 console, do not show any healthy instances registered.

An example of a normal appearance is in the following:

res-targetgroup-01

If the Healthy entry is 0, that indicates that no Amazon EC2 instance is available to process requests.

If the Unhealthy entry is non-0, that indicates that an Amazon EC2 instance may be cycling. This can be due to the installed applications software not passing health checks.

If both Healthy and Unhealthy entries are 0, that indicates a potential network misconfiguration. An example might be the public and private subnets do not have corresponding AZs. If this condition occurs, there may be additional text on the console indicating that network state exists.

Launching Virtual Desktops

A virtual desktop that was previously working is no longer able to connect successfully

If a desktop connection closes or can no longer be connected to the issue may be due to the underlying Amazon EC2 instance failing or the Amazon EC2 instance has been terminated or stopped outside of the RES environment. The Admin UI status may continue to show a ready state but attempts to connect to it fail.

The Amazon EC2 Console should be used to determine if the instance has been terminated or stopped. If stopped, try starting it again. If the state is terminate, another desktop will have to be created. Any data that was stored on the user home directory should still be available when the new instance starts.

If the previous failed instance still appears on the Admin UI, it may need to be terminated using the Admin UI.

I am only able to launch 5 virtual desktops

The default limit for the number of virtual desktops that a user can launch is 5. This can be changed by an admin using the Admin UI as follows

  • go to Desktop Settings
  • select the **Server **tab
  • in the DCV Session panel, click on the edit icon on the right
  • change the value in Allowed Sessions Per User to the desired new value
  • click Submit
  • refresh the page to confirm that the new setting is in place

Desktop Windows connect attempts fail with “The connection has been closed. Transport error”

If a Windows desktop connection fails with the UI error “The connection has been closed. Transport error”, the cause can be due to an issue in the DCV server software related to certificate creation on the Windows instance.

The Amazon CloudWatch log group <envname>/vdc/dcv-connection-gateway may log the connection attempt error with messages similar to the following

Nov 24 20:24:27.631 DEBUG HTTP:Splicer Connection{id=9}: Websocket{session_id="1291e75f-7816-48d9-bbb2-7371b3b911cd"}: Resolver lookup{client_ip=Some(52.94.36.19) session_id="1291e75f-7816-48d9-bbb2-7371b3b911cd" protocol_type=WebSocket extension_data=None}:NoStrictCertVerification: Additional stack certificate (0): [s/n: 0E9E9C4DE7194B37687DC94D2C0F5E94AF0DD57E]

Nov 24 20:25:15.384 INFO HTTP:Splicer Connection{id=21}:Websocket{ session_id="d1d35954-f29d-4b3f-8c23-6a53303ebc3f"}: Connection initiated error: unreachable, server io error Custom { kind: InvalidData, error: General("Invalid certificate: certificate has expired (code: 10)") }

Nov 24 20:25:15.384 WARN HTTP:Splicer Connection{id=21}: Websocket{session_id="d1d35954-f29d-4b3f-8c23-6a53303ebc3f"}: Error in websocket connection: Server unreachable: Server error: IO error: unexpected error: Invalid certificate: certificate has expired (code: 10)

If this occurs, a resolution may be to use the SSM Session Manager to open a connection to the Windows instance and remove the following 2 certificate related files.

PS C:\Windows\system32\config\systemprofile\AppData\Local\NICE\dcv> dir

`Directory: C:\Windows\system32\config\systemprofile\AppData\Local\NICE\dcv`

Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 8/4/2022 12:59 PM 1704 dcv.key -a---- 8/4/2022 12:59 PM 1265 dcv.pem

The files should be automatically recreated and a subsequent connection attempt may be successful.

If this method resolves the issue and if new launches of Windows desktops produce the same error, use the Create Software Stack function to create a new Windows software stack of the fixed instance with the regenerated certificate files. That may produce a Windows software stack that can be used for successful launches and connections.

VDIs stuck in Provisioning state

If a desktop launch remains in the provisioning state in the Admin UI, this may be due to several reasons.

Methods to determine the cause including examining log files on the desktop instance for errors that might be causing the issue. This document contains a list of log files and Amazon CloudWatch log groups that contain relevant information in the section labelled Useful log and event information sources.

The following are potential causes of this issue.

  • AMI id used has been registered as a software-stack but is not supported by RES
    • The bootstrap provisioning script failed to complete because the AMI does not have the expected configuration or tooling required. The log files on the instance, such as /root/bootstrap/logs/ on a Linux instance may contain useful information regarding this. AMIs ids taken from the AWS Marketplace may not work for RES desktop instances. They require testing to confirm if they are supported.
  • User data scripts are not executed when the Windows virtual desktop instance is launched from a custom AMI
    • By default, user data scripts run one time when an EC2 instance is launched. If you create an AMI from an existing virtual desktop instance, register a software stack with the AMI and try to launch another virtual desktop with this software stack, user data scripts will not run on the new virtual desktop instance. To fix the issue, open a PowerShell command window as Administrator on the original virtual desktop instance you used to create AMI, and run the following command: C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 –Schedule. Then create a new AMI from the instance. You can use the new AMI to register software stacks and launch new virtual desktops afterwards. Note that you may also run the same command on the instance that remains in the provisioning state and reboot the instance to fix the virtual desktop session, but you will run into the same issue again when launching another virtual desktop from the misconfigured AMI.

VDIs get into Error state after launching

Possible issue 1: The home filesytem has directory for the user with different POSIX permissions.

If the following scenarios are true, this could be the issue you are facing,

  1. RES Version deployed in 2024.01 or higher
  2. The attribute for EnableLdapIDMapping during deployment of the RES stack was set to True
  3. The home filesystem specified during RES stack deployment was used in version prior to RES 2024.01 or was used in a previous environmnet with EnableLdapIDMapping set to False

Resolution steps: Delete the user directories in the filesystem.

  1. SSM to the cluster-manager host
  2. cd /home
  3. ls - should list directories with directory names that match usernames, such as admin1 , admin2 .. etc.
  4. Delete the directories, sudo rm -r 'dir_name'. Do not delete the ssm-user and ec2-user directories
  5. If the users are already synced to the new env, delete the user's from the user's DDB table (expect clusteradmin)
  6. Initiate AD sync - execute sudo /opt/idea/python/3.9.16/bin/resctl ldap sync-from-ad in cluster-manager EC2.
  7. Reboot the VDI instance in Error state from the RES webpage. Validate that the VDI is gets into Ready state in around 20 mins.

Virtual Desktop Component

Amazon EC2 instance is repeatedly showing terminated in the console

If an infrastructure instance is repeatedly showing as terminated in the Amazon EC2 console, the cause is potentially configuration related. The potential cause may be dependent on the infrastructure instance type. The following are methods to determine the cause.

If the vdc-controller instance is showing repeated terminated states in the Amazon EC2 console, this can be due to an incorrect Secret tag. Secrets that are maintained by RES have tags that are used as a part of the IAM access control policies attached to the infrastructure Amazon EC2 instances. If the vdc-controller is cycling and the following error appears in the CloudWatch log group, the cause may be that a secret has not been tagged correctly. Note that the secret needs to be tagged with the following:

{ "res:EnvironmentName": "< envname >" # e.g. "res-demo" "res:ModuleName": "virtual-desktop-controller" }

The Amazon CloudWatch log message for this error will appear similar to the following.

An error occurred (AccessDeniedException) when calling the GetSecretValue operation: User: arn:aws:sts::160215750999:assumed-role/<envname>-vdc-gateway-role-us-east-1/i-043f76a2677f373d0 is not authorized to perform: secretsmanager:GetSecretValue on resource: arn:aws:secretsmanager:us-east-1:160215750999:secret:Certificate-res-bi-Certs-5W9SPUXF08IB-F1sNRv because no identity-based policy allows the secretsmanager:GetSecretValue action

Check the tags on the Amazon EC2 instance and confirm that the match the above list.

vdc-controller instance is cycling due to failing to join AD / eVDI module shows Failed API Health Check

If the eVDI module is failing it’s health check, it will show the following in the Environment Status section.

res-models

In this case, the general path for debugging is to connect to the instance and then run the following command to see the logs:

sudo su - cat /root/bootstrap/logs/userdata.log

Possible issues:

  • If the logs say insuffecient permissions make sure the ServiceAccount username given at time of res stack creation is ServiceAccount. It should be Admin for time being.
    • Can be updated in AWS Console → Secrets Manager → <env_name>directoryserviceServiceAccountUsername → Retrieve plain text → edit
    • Restart the cluster-manager instance after the above change. AWS Console → EC2 → <env_name>.cluster-manager → Connect → Session Manager → Connect → execute sudo /opt/idea/python/3.9.16/bin/supervisorctl restart all
  • If the username used was correct, and if the log’s say Invalid credentials the password you entered might be wrong.
    • You can read the password you entered during env creation at AWS Console → Secrets Manager → <env_name>directoryserviceServiceAccountPassword → Retrieve plain text
    • If you are not sure about the password, you can verify by trying to connect to the AdDomainWindowsNode--WindowsManagementHost. AWS Console → EC2 → Instances → AdDomainWindowsNode--WindowsManagementHost → Connect → RDP Client → Connect using Fleet Manager → enter username as Admin and password as the found in the above step.
    • If you cannot login, the password you gave during env creation is the wrong password.

Project does not appear in the pull down when editing the Software Stack to add it

This issue may be related to the following issue associated with syncing the user account with AD. If this issue appears, check the cluster-manager Amazon CloudWatch log group for the error “[user-home-init] account not available yet. waiting for user to be synced” to determine if the cause is the same or related.

cluster-manager Amazon CloudWatch log shows “[user-home-init] account not available yet. waiting for user to be synced” (where account is a user name)

The SQS subscriber is busy and stuck in an infinite loop because it cannot get to the user account. This code is triggered when trying to create a home filesystem for a user during user sync.

The cause of not being able to get to the user account may be that RES was not configured correctly for the AD in use. An example might be that ServiceAccountUsername parameter, when using the BI/RES environment creation, is not the correct value such as using ServiceAccount instead of Admin.

Windows desktop on login attempt says “Your account has been disabled. Please see your administrator”

res-windows-disabled-01

If the user is unable to log back in to a locked screen, this may indicate that the user has been disabled in the AD configured for RES after having successfully signed on via SSO.

The SSO login should fail if the user account has been disabled in AD.

DHCP Options issues with external/customer AD configuration

In a configuration where the customer AD is being used with RES. If the following error appears in the Windows session. frontend "The connection has been closed" Transport error.

Check the dcv-connection-gateway Amazon CloudWatch log for something similar to the following:

Oct 28 00:12:30.626 INFO HTTP:Splicer Connection{id=263}: Websocket{session_id="96cffa6e-cf2e-410f-9eea-6ae8478dc08a"}: Connection initiated error: unreachable, server io error Custom { kind: Uncategorized, error: "failed to lookup address information: Name or service not known" }

Oct 28 00:12:30.626 WARN HTTP:Splicer Connection{id=263}: Websocket{session_id="96cffa6e-cf2e-410f-9eea-6ae8478dc08a"}: Error in websocket connection: Server unreachable: Server error: IO error: failed to lookup address information: Name or service not known

Oct 28 00:12:30.627 DEBUG HTTP:Splicer Connection{id=263}: ConnectionGuard dropped

If you are using an AD domain controller for your DHCP Options for your own VPC, you need to

  1. Add AmazonProvidedDNS to the two domain controller IPs - if you don't , you will not be able to communicate with OpenSearch.
  2. Set the domain name to ec2.internal

A example is listed below. Without this configuration, the Windows desktop will give you **Transport error **, because RES/DCV looks for ip-10-0-x-xx.ec2.internal hostname.

res-DHCP

A key aspect to be aware of is in RES, the OpenSearch database is necessary for the operation of the system. The “OpenSearch Configuration” section of the Administrator Guide contains more information about the OpenSearch database, what is stored in it, how to access and how to examine what it contains.

Firefox error MOZILLA_PKIX_ERROR_REQUIRED_TLS_FEATURE_MISSING

When using Firefox web browser, the customer might encounter the error message type MOZILLA_PKIX_ERROR_REQUIRED_TLS_FEATURE_MISSING when attempting to connect to a virtual desktop.

The cause is that the RES web server is set up with TLS + Stapling On but is not responding with Stapling Validation (https://support.mozilla.org/en-US/questions/1372483)

The customer can fix this by using the following instructions: https://really-simple-ssl.com/mozilla_pkix_error_required_tls_feature_missing

Env deletion

res-xxx-cluster stack in ‘DELETE_FAILED’ state and cannot be deleted manually due to ‘Role is invalid or cannot be assumed’ error

If you notice that the ‘res-xxx-cluster’ stack is in ‘DELETE_FAILED’ state and cannot be deleted manually, you can perform the following steps to delete it.

If you see the stack in a ‘DELETE_FAILED’ state, first try to manually delete it. It may pop up a dialog confirming Delete Stack. Click 'Delete'.

image

Sometimes, even if you delete all the required stack resources, you may still see the message to select resources to retain. In that case, select all the resources as the "resources to retain" and click ‘Delete’.

You may see an error that looks like Role: arn:aws:iam::... is Invalid or cannot be assumed

image

This means that the role required to delete the stack got deleted first before the stack. To get around this, copy the name of the role. Go to IAM console and create a role with that name using the below parameters

image

Click Next. Make sure you give the role ‘AWSCloudFormationFullAccess’ and ‘AdministratorAccess’ permissions. Your review page should look like this

image

Then go back to the CloudFormation console and delete the stack. You should now be able to delete it since you created the role. Finally, go to IAM console and delete the role you created.

OpenSearch Database

The OpenSearch database created as a part of the RES environment is accessible via the Admin UI Environment Management / Settings / Analytics page at the Dashboard URL link.

Generally, direct access to OpenSearch will not be necessary in a RES environment.

Should it be necessary, the OpenSearch database can be accessed and records viewed or modified using the OpenSearch Dev Tools console. This is assuming that the Administrator Guide OpenSearch Configuration section to configure the indices has been completed.

Getting a record in OpenSearch

When using the Dev Tools console, an example of getting a specific record follows.

GET <envname>_vdc_software_stacks-40/_doc/ss-base-amazonlinux2-arm64-base

Modifying a record in OpenSearch

An example of a record update follows.

POST /<envname>_vdc_user_sessions-40/_update/c7c18071-b5a4-49dc-9bf8-562906eeedaa { "doc": { "attribute" : "value" } }

Deleting a record in OpenSearch

An example of a delete record follows.

DELETE /<envname>_vdc_user_sessions-40/_doc/1ff3cd98-d2c1-40fb-b4b1-50159acc32d8

Clone this wiki locally