I am trying to connect AWS Glue Catalog to Redshift, but, I keep getting this error
An error occurred while calling o86.getSink. The connection attempt failed
In the logs (a part of it)
File "/tmp/etl-s3-redshift.py", line 43, in <module>
AWS_RedshiftCluster = glueContext.write_dynamic_frame.from_options(
........................
The code
target1_RedshiftCluster = glueContext.write_dynamic_frame.from_options(
frame=transformOperation,
connection_type="redshift",
connection_options={
"redshiftTmpDir": "s3://{bucketname}/temporary/",
"useConnectionProperties": "true",
"dbtable": "glue_table",
"connectionName": "glue-redhsift",
"aws-iam-user": "aws-glue-s3-etl-asish",
},
transformation_ctx="target1_RedshiftCluster",
)
I could not find this error code anywhere on the internet. What might be causing the error ?
This could probably be network or IAM related stuff. Can you please share the whole error log?
I solved it in Visual Script. IAM Role has two different Redshift Permissions - Redshift (for cluster) and Redshift Serverless. I was using the Cluster one. The Serverless option was visible while creating an inline policy.
But, while generating own script, I am unable to write to Redshift.
"An error occurred while calling o86.getSink. The connection attempt failed."
The complete Driver logs in the next comment
Driver logs Driver and executor log streams
23/09/18 15:18:43 INFO LogPusher: stopping 23/09/18 15:18:43 INFO ProcessLauncher: postprocessing 23/09/18 15:18:43 ERROR ProcessLauncher: Error from Python:Traceback (most recent call last): File "/tmp/etl-glue-redshift-s3.py", line 51, in <module> target_Redshift = glueContext.write_dynamic_frame.from_options( File "/opt/amazon/lib/python3.7/site-packages/awsglue/dynamicframe.py", line 640, in from_options return self._glue_context.write_dynamic_frame_from_options(frame, File "/opt/amazon/lib/python3.7/site-packages/awsglue/context.py", line 337, in write_dynamic_frame_from_options return self.write_from_options(frame, connection_type, File "/opt/amazon/lib/python3.7/site-packages/awsglue/context.py", line 355, in write_from_options sink = self.getSink(connection_type, format, transformation_ctx, **new_options) File "/opt/amazon/lib/python3.7/site-packages/awsglue/context.py", line 317, in getSink j_sink = self._ssql_ctx.getSink(connection_type, File "/opt/amazon/spark/python/lib/py4j-0.10.9.5-src.zip/py4j/java_gateway.py", line 13