Why can't I connect to the Amazon Redshift query editor?
Last updated: 2022-11-07
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
Important: Be sure you're logged in to the same AWS Region where your Amazon Redshift cluster is present.
Both query editor v1 and query editor v2 support connecting to the following provisioned Redshift cluster types:
Note: You can't query data in Amazon Redshift Serverless using the query editor v1. You must use Amazon Redshift query editor v2 instead.
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.
For query editor v1
To turn on access, attach the "AmazonRedshiftQueryEditor" and "AmazonRedshiftReadOnlyAccess" policies for AWS Identity and Access Management (IAM) to the user that accesses your 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.
For query editor v2
To turn on access, attach the "AmazonRedshiftReadOnlyAccess" policy and one of the following policies for IAM, to the user that accesses your Redshift cluster:
For more information, see Accessing the query editor v2.
To access the query editor v2 as a federated user, see Setting up principal tags to connect to query editor v2 as a federated user.
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 might cause a Bad Gateway Error. A Gateway Timeout Error might occur if your Amazon Redshift cluster fails to receive a timely response from an upstream server. A timeout error might 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, consider the following while querying your data using query editor:
For queries that outpace the preceding considerations or limitations, use one of the following options:
Use a different SQL client such as SQL Workbench/J for querying the cluster.
Amazon Redshift has quotas that limit the use of several resources in your Amazon account per Amazon Region. There's a default value for each quota and some quotas are adjustable. For adjustable quotas, you can request an increase for your Amazon account in an AWS Region by submitting an Amazon Redshift limit increase form.
The Amazon Redshift query editor v2 has an allotted quota of 100,000 rows or 5 MB of data fetched per query, whichever is less. This default quota is adjustable and you can request to increase this limit by submitting an Amazon Redshift limit increase form.
Note: Increasing the default quota can incur additional costs.