How do I troubleshoot the Canary Navigation Timeout Exceeded error in CloudWatch?

3 minute read
0

I want to troubleshoot the Canary Navigation Timeout error in Amazon CloudWatch.

Short description

The Canary Navigation Timeout Exceeded error occurs when a browser or endpoint can't connect to the canary within the specified time. Troubleshoot this error based on the following possible causes:

  • Endpoint connection
  • Canary script execution time
  • GUI workflow builder
  • Page complexity

Note: When you create a CloudWatch canary, you can configure the timeout under the Additional configuration section. The timeout is an AWS Lambda function value that's is different from the timeout value that's set in the canary code. It's a best practice to set the Lambda timeout value higher than the canary code timeout value. If the application doesn't respond, then this allows the canary code timeout to be reached first.

Resolution

Endpoint connection

To determine whether an endpoint connection is the cause of a timeout exceeded error, check the following:

  • Make sure that the canary reaches the specified endpoint and gets a response within the timeout period. If the monitoring endpoint uses a firewall or proxy, then make sure that there are no rules that block the endpoint connection for the canary.
  • If you use an Amazon Virtual Private Cloud (Amazon VPC) canary, then check if the endpoint is reachable. If the endpoint isn't reachable, then check for security group or network access control lists (network ACL) restrictions.

To check if an endpoint is reachable and responds within the specified time, run the following command:

Note: Replace example-endpoint-ip with your endpoint IP address, example-dns with your DNS, and example-port with your port.

time curl http/(s)://[example-endpoint-ip/example-dns]:example-port

Canary script execution time

Check the canary script timeout. If the timeout is high, then increase the timeout in the canary script to allow the canary enough time to complete the navigation steps. It's a best practice to increase the timeout to match the endpoint response time.

To change the canary heartbeat timeout from the canary code, run the following command:

const response = await page.goto(URL, {waitUntil: 'domcontentloaded', timeout: 30000}); 

GUI workflow builder

If you use the GUI workflow builder, then check whether the click with navigation action on a button or link is appropriately redirecting. The web page uses asynchronous operations, and the timeout must include the amount of time that's needed to complete these operations.

To resolve this issue, complete the following tasks:

  • To change the timeout for the Click with navigation action, run the following command:

    await Promise.all([  
               page.waitForNavigation({ timeout: 30000 }),  
               await page.click("example-button")
  • If the Click with navigation action doesn't appropriately redirect the page, then use the Click action instead.

  • To calculate the endpoint response within the configured timeout, run the following command:
    Note: Replace example-endpoint-ip and example-port with your IP address and port number.

    time curl http/(s)://[example-endpoint-ip]:example-port

Page complexity

Page complexity might cause timeout issues. If you're navigating a dynamic page with extensive JavaScript/DOM, then the page might require longer timeout values.

AWS OFFICIAL
AWS OFFICIALUpdated 2 months ago