An error occurred while calling o101.getDynamicFrame.

0

i'm trying to do a job in glue who take data from a sql server in rds. I have a glue conection working fine when the job is made with no code. but when i use the same code in a notebook, i get this error:

Py4JJavaError: An error occurred while calling o101.getDynamicFrame. : com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host db-req-prd.cd9u6vtrngvz.us-east-1.rds.amazonaws.com, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

my code below:

tb_node= glueContext.create_dynamic_frame_from_catalog(
    connection_type = "JDBC",
    url = "jdbc:sqlserver://blablabla",
    useConnectionProperties = "true",
    connectionName = "connection",
    database  = "db",
    table_name = "table",
    transformation_ctx = "tb_node", 
    useSparkDataSource = "True"
    ) 
table.show()

I've already tried the simpler way too:

tb_node= glueContext.create_dynamic_frame.from_catalog(
    database="db",
    table_name="tb",
    transformation_ctx="tb_node",
)

The same code but conecting in a S3 works fine!

dyf = glueContext.create_dynamic_frame.from_catalog(database='db_s3', table_name='s3_table')

What's wrong? The cloud security guy said all this TCP/IP properties by sql server its ok

profile picture
lebuosi
質問済み 8ヶ月前2082ビュー
2回答
1
承認された回答

In the notebook you have to add the same connection using the %connections magic

profile pictureAWS
エキスパート
回答済み 8ヶ月前
  • wow, thanks so much Gonzalo. I spent a lot of time trying and just this 2 rows resolved %region us-east-1 %connections rds_connection

0

I have same situation. Can you please be more specific that where to add %connections?

Bhavesh
回答済み 6ヶ月前
  • you can put in any cell since it's a line magic, as long as they are executed before the code (they can share the cell with code or be on their own)

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ