question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Amazon](500150) Error setting/closing connection: Not Connected

See original GitHub issue

I get the following error when running a test job from my PC. I have connectivity to the redshift cluster because at the same time I am running Aginity workbench session.

Any idea what settings can be tweaked to avoid it? it may be a timeout…

16/01/04 21:17:48 INFO RedshiftWriter: CREATE TABLE IF NOT EXISTS "staging"."messages_20160104_205059" ("message_id" ...
Exception in thread "main" java.sql.SQLException: [Amazon](500150) Error setting/closing connection: Not Connected.
    at com.amazon.redshift.client.PGClient.isConnected(Unknown Source)
    at com.amazon.redshift.client.PGClient.reprepareStatement(Unknown Source)
    at com.amazon.redshift.dataengine.PGAbstractQueryExecutor.pushMappedParamTypes(Unknown Source)
    at com.amazon.jdbc.common.SPreparedStatement.updateParameterMetadata(Unknown Source)
    at com.amazon.jdbc.common.SPreparedStatement.execute(Unknown Source)
    at com.databricks.spark.redshift.RedshiftWriter.com$databricks$spark$redshift$RedshiftWriter$$doRedshiftLoad(RedshiftWriter.scala:163)
    at com.databricks.spark.redshift.RedshiftWriter.saveToRedshift(RedshiftWriter.scala:381)
    at com.databricks.spark.redshift.DefaultSource.createRelation(DefaultSource.scala:106)
    at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:170)
    at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:146)
    at com.amazonaws.proserve.jelez.spark.kinesis2redshift.FlattenJsonToRedshiftAndS3Batch$.main(FlattenJsonToRedshiftAndS3Batch.scala:183)
Caused by: com.amazon.support.exceptions.GeneralException: [Amazon](500150) Error setting/closing connection: Not Connected.
    ... 11 more

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

73reactions
Regalcomcommented, Dec 7, 2016

This worked for me…

  1. Sign-in into AWS Console
  2. Go into EC2 Management Console
  3. On the left navigation pane, look for Network & Security header and click on Security Groups.
  4. Notice the row with “Default” in the Group Name’s column. Click that. Then select the Inbound tab, and click Edit.
  5. Add Rule: Type=Redshift, Source=MyIP. (auto-fill)
  6. Save it.
  7. Try to connect again from within SQLWorkbench/J. Feel good!
4reactions
whitsonkcommented, Sep 7, 2017

I had the same problem as gabi-lee. I selected “No” in the “Publicly accessible” option. Consequently, despite having inbound security wide open, I was unable to connect. “Amazon Error setting/closing connection” To fix, choose your redshift cluster and then click the “cluster” drop down. Select modify and then change publicly accessible. It took about a minute or so to take effect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amazon 500150 Error setting closing connection General ...
I am using SQL Workbench J to connect to the database system. The strangeness here it that the connection was working fine two...
Read more >
Troubleshoot Amazon Redshift connection errors - AWS
Error: amazon 500150 error setting/closing connection: operation timed out/ connection refused. This error can indicate a permissions issue with ...
Read more >
[Amazon](500150) Error setting/closing connection - Search
While loading data to Amazon Redshift using Informatica Cloud, the task fails with a Warning or Error status in the 'Activity log', or...
Read more >
[Amazon](500150) Error setting/closing connection
Problem. After executing for more than one hour, tasks are failing with the error shown below: java.sql.SQLException: [Amazon](500150) Error ...
Read more >
Cannot acquire connection [Amazon](500150) Error setting ...
Cannot acquire connection [Amazon](500150) Error setting/closing connection: UnknownHostException (RDB Loader) · The Redshift cluster isn't publicly accessible ( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found