简体   繁体   English

AWS Athena 联合查询 - 为 PostgreSQL 运行数据库查询时出现 GENERIC_USER_ERROR

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


Hi all, 大家好,

I am trying to execute queries on a postgresql database I created in AWS.我正在尝试对我在 AWS 中创建的 postgresql 数据库执行查询。

I added a data source to Athena, I created the data source for postgresql and I created the lambda function.我向 Athena 添加了一个数据源,为 postgresql 创建了数据源,并创建了 lambda 函数。

In Lambda function I set:在我设置的 Lambda 函数中:

  • default connection string默认连接字符串
  • spill_bucket and spill prefix (I set the same for both: 'athena-spill'. In the S3 page I cannot see any athena-spill bucket) spill_bucket 和 spill 前缀(我为两者设置相同:'athena-spill'。在 S3 页面中我看不到任何 athena-spill 桶)
  • the security group --> I set the security group I created to access the db安全组 --> 我设置我创建的安全组来访问数据库
  • the subnet --> I set one of the database subnet I deployed the lambda function but I received an error and I had to add a new environment variable created with the connection string but named as 'dbname_connection_string'.子网 --> 我设置了一个数据库子网,我部署了 lambda 函数,但我收到一个错误,我不得不添加一个新的环境变量,该变量是用连接字符串创建的,但命名为“dbname_connection_string”。

After adding this new env variable I am able to see the database in Athena but when I try to execute any query on this database as:添加这个新的环境变量后,我可以在 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

I receive this error after running query:运行查询后我收到此错误:

 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

What could be causing the problem?是什么导致了这个问题?

Thanks a lot!非常感谢!

Root Cause:根本原因:

VPC have no internet connection issue, causing Lambda can't access S3. VPC 没有互联网连接问题,导致 Lambda 无法访问 S3。

Solution:解决方案:

Add VPC Gateway Endpoint (Select com.amazonaws.eu-central-1.s3 ) in Lambda associated VPC.在 Lambda 关联的 VPC 中添加 VPC 网关终端节点(选择com.amazonaws.eu-central-1.s3 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM