postgresql to s3 export doesn't work anymore

0

We have RDS instance that works on 14.10 version. We used it to export data to s3 bucket with help of https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/postgresql-s3-export.html . We migrated to eu-central-2 region in March. And everything worked fine after it. But recently we started to get an error from the api:

[2024-02-14 13:36:02] [58000] ERROR: unknown error occurred
[2024-02-14 13:36:02] Detail: Amazon S3 client returned 'basic_string::_M_construct null not valid'.
[2024-02-14 13:36:02] Where: SQL function "query_export_to_s3" statement 1

Noone changed anyting in setup. We noticed that we use null in the region and tried to change it to eu-central-2, but we got a new error:

[2024-02-14 13:41:14] [22023] ERROR: invalid value for "region" parameter
[2024-02-14 13:41:14] Where: SQL function "query_export_to_s3" statement 1

We also tried other regions and got:

[2024-02-14 12:55:06] [58000] ERROR: unknown error occurred
[2024-02-14 12:55:06] Detail: Amazon S3 client returned 'cross region export is not supported at this time'.

It's example of the query we used:

SELECT * from aws_s3.query_export_to_s3(
      'SELECT ''Hello World'' AS hello;',
      ('test-bucket', 'test-export.csv', 'eu-central-2')::aws_commons._s3_uri_1,
      'format csv'
)

Did something change recently and how can we make it work again?

1 Answer
0

Hi, currently the AWS Region of the S3 Bucket must be the same as the region of the exporting DB instance. Looks like you've migrated the db to eu-central-2 but the bucket is still the same (assuming in the previous region only). Can you try by using the bucket in the same region as your db instances (eu-central-2 in this case).

Reference: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/postgresql-s3-export.html#postgresql-s3-export-file

profile pictureAWS
karan
answered 2 months ago
profile picture
EXPERT
reviewed 25 days ago
  • Hey, thank you for your answer! Everything got migrated to eu-central-2, so the S3 Bucket is currently in the same region. Maybe as additional info, we recognized this issue about 2 weeks ago. It might have been unrecognized for another 1-2 weeks. It has to be some change from AWS side that happened recently

  • Hey, thank you for your answer! Everything got migrated to eu-central-2, so the S3 Bucket is currently in the same region. Maybe as additional info, we recognized this issue about 2 weeks ago. It might have been unrecognized for another 1-2 weeks. It has to be some change from AWS side that happened recently

  • We've got the same issue, did you manage to resolve it?

  • @rePost-User-7245627 sadly we didn't find a real solution... we moved some bits out of RDS and handle it within lambda

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions