Why can't I connect to the Amazon Redshift query editor?

Last updated: 2020-09-10

I'm trying to connect to the Amazon Redshift query editor, but I'm getting a 502 Bad Gateway Error or 504 Timeout Error. How do I resolve these errors?


I can't find my Amazon Redshift cluster to connect to the query editor

The query editor only supports the following node types:

  • DC1.8xlarge
  • DC2.large
  • DC2.8xlarge
  • DS2.8xlarge
  • RA3.4xlarge
  • RA3.16xlarge

Note: Currently, the query editor does not support enhanced VPC routing.

To use a different node type, or to enable enhanced VPC routing for your Amazon Redshift cluster, connect to your cluster using an SQL client. An example of an SQL client you can use is SQL Workbench/J.

I'm getting a "User not authorized" or "Access denied" error while connecting to the query editor with Amazon Redshift

You must have proper permissions to access the query editor. To enable access, attach the "AmazonRedshiftQueryEditor" and "AmazonRedshiftReadOnlyAccess" policies for AWS Identity and Access Management (IAM) to the user that accesses your Amazon Redshift cluster.

"AmazonRedshiftQueryEditor" is an AWS managed policy that allows the redshift:GetClusterCredentials action. By default, the redshift:GetClusterCredentials action provides a superuser access to the database.

For more information about how to provide a superuser access from the console, see Enabling access to the query editor.

I get a 502 Bad Gateway or 504 Gateway Timeout Error while connecting to the query editor

A Bad Gateway Error and Gateway Timeout Error are both caused by transient network issues. Issues between online servers can cause a Bad Gateway Error. A Gateway Timeout Error can occur if your Amazon Redshift cluster fails to receive a timely response from an upstream server. A timeout error can also occur if the cluster CPU usage reaches 100% for a long duration, or there are too many query requests.

To resolve these errors, try the following troubleshooting tips:

  • Clear your cache and browser cookies.
  • Switch to a different browser to connect to query editor.
  • Use a different network to connect.
  • Reboot your Amazon Redshift cluster to restart the query editor.
  • Monitor the workload on your Amazon Redshift cluster to be sure that there aren't any long-running queries that are increasing your CPU usage. You can verify this by looking at the CPUUtilization metric in your Amazon CloudWatch dashboard.
  • Increase the number of compute nodes on your cluster to help manage the increased workload. For more information, see Clusters and nodes in Amazon Redshift.

Then, re-try connecting to the query editor in your Amazon Redshift cluster.

My query gets terminated by the query editor

To prevent query termination, use the query editor for short-running queries that can be completed within ten minutes. For queries that run longer than ten minutes, use a third-party SQL client like SQL Workbench/J. For more information about using query editor, see Query editor considerations.

Did this article help?

Do you need billing or technical support?