簡體   English   中英

AWS Athena 聯合查詢 - 為 PostgreSQL 運行數據庫查詢時出現 GENERIC_USER_ERROR

[英]AWS Athena Federated Query - GENERIC_USER_ERROR when running DB query for PostgreSQL


大家好,

我正在嘗試對我在 AWS 中創建的 postgresql 數據庫執行查詢。

我向 Athena 添加了一個數據源,為 postgresql 創建了數據源,並創建了 lambda 函數。

在我設置的 Lambda 函數中:

  • 默認連接字符串
  • spill_bucket 和 spill 前綴(我為兩者設置相同:'athena-spill'。在 S3 頁面中我看不到任何 athena-spill 桶)
  • 安全組 --> 我設置我創建的安全組來訪問數據庫
  • 子網 --> 我設置了一個數據庫子網,我部署了 lambda 函數,但我收到一個錯誤,我不得不添加一個新的環境變量,該變量是用連接字符串創建的,但命名為“dbname_connection_string”。

添加這個新的環境變量后,我可以在 Athena 中看到數據庫,但是當我嘗試對該數據庫執行任何查詢時:

GENERIC_USER_ERROR: Encountered an exception[com.amazonaws.SdkClientException] from your LambdaFunction[arn:aws:lambda:eu-central-1:449809321626:function:data-production-athena-connector-nina-lambda] executed in context[retrieving meta-data] with message[Unable to execute HTTP request: Connect to s3.eu-central-1.amazonaws.com:443 [s3.eu-central-1.amazonaws.com/52.219.170.25] failed: connect timed out]
This query ran against the "public" database, unless qualified by the query. Please post the error message on our forum  or contact customer support  with Query Id: 3366bd80-143e-459c-a4da-5350b5ab4a77

運行查詢后我收到此錯誤:

 GENERIC_USER_ERROR: Encountered an exception[com.amazonaws.SdkClientException] from your LambdaFunction[arn:aws:lambda:eu-central-1:449809321626:function:data-production-athena-connector-nina-lambda] executed in context[retrieving meta-data] with message[Unable to execute HTTP request: Connect to s3.eu-central-1.amazonaws.com:443 [s3.eu-central-1.amazonaws.com/52.219.170.25] failed: connect timed out] This query ran against the "public" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 3366bd80-143e-459c-a4da-5350b5ab4a77

是什么導致了這個問題?

非常感謝!

根本原因:

VPC 沒有互聯網連接問題,導致 Lambda 無法訪問 S3。

解決方案:

在 Lambda 關聯的 VPC 中添加 VPC 網關終端節點(選擇com.amazonaws.eu-central-1.s3 )。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM