AWS DMS task error for Aurora PostgreSQL migration - amazon-web-services

I am trying to migrate all the data present in my old RDS Aurora PostgreSQL cluster to the new RDS Aurora PostgreSQL cluster using AWS DMS. I have created the source and target endpoints and tested the connection successfully. However when I am trying to create a migration task in DMS, it is continuously failing with the error:
Last Error ODBC general error. Error executing command; Stream component failed at subtask 0,
component st_0_PWDKKAMFPUY2RHV ; Stream component
'st_0_PWDKKAMFPUY2RHV' terminated [reptask/replicationtask.c:3171] [1022502]
Stop Reason RECOVERABLE_ERROR Error Level RECOVERABLE
Even after enabling CloudWatch logs, I am not able to figure out what's missing? What does the error signify or what am I doing wrong?

I had faced the same error and the issue seems related to database user rights for
Replication Client and Replication Slave
I have fixed it by setting the Replication rights using the below statements in SQL
GRANT REPLICATION CLIENT ON *.* to {dbusername}#'%';
GRANT REPLICATION SLAVE ON *.* to {dbusername}#'%';
Note: replacing {dbusername} with the actual database user name which was being used in DMS Endpoint

Related

Error while creating a read replica in Cloud SQL

I am getting the error as below everytime I create a read replica.
tried with mysql 8 and postgresql 14
This instance is not responding. You can still restore a backup to a new instance or promote a cross region replica.
I am attempting a Postgresql CLoud SQL cross region replica creation and disaster recovery.
LInk : https://cloud.google.com/solutions/cloud-sql-mysql-disaster-recovery-complete-failover-fallback
Logs show
2023-01-11 17:11:19.522 UTC [78]: [1-1] db=cloudsqladmin,user=cloudsqladmin ERROR: cannot execute GRANT ROLE in a read-only transaction

AWS Codebuild Project Unable to communicate with RDS db

I am attempting to have AWS CodeBuild run a Flyway migration. The DB and CodeBuild Project are created via Terraform (the pipeline runs as a GitHub action, if it matters)
That code is here.
I figured this solution would make the difference: AWS CodeBuild fails to interact with RDS instance
When the CodeBuild project is executed by my GitHub workflow (using the aws-actions/aws-codebuild-run-build action), the migration times out:
[Container] 2022/10/07 21:03:56 Running command flyway -user=$DB_USER -password=$DB_PASSWORD -url=jdbc:mariadb://$DB_HOST:$DB_PORT/$DB_NAME -createSchemas=true migrate
ERROR: Unable to obtain connection from database (jdbc:mariadb://***:***/***) for user '***': Could not connect to address=(host=***)(port=***)(type=master) : Socket fail to connect to host:***, port:***. connect timed out
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL State : 08000
Error Code : -1
Message : Could not connect to address=(host=***)(port=***)(type=master) : Socket fail to connect to host:***, port:***. connect timed out
Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=***)(port=***)(type=master) : Socket fail to connect to host:***, port:***. connect timed out
Caused by: java.sql.SQLNonTransientConnectionException: Socket fail to connect to host:***, port:***. connect timed out
Caused by: java.net.SocketTimeoutException: connect timed out
This tells me it's some sort of networking problem but I can't put my finger on what route might be missing. No NACLs other than the defaults. Just security groups. I have a similar pipeline in the AWS CDK that works. As near as I can tell, the security groups and IAM permissions are identical, as is the database config itself.
Looking for debugging tips or anything that's missing.
Consider setting the vpc_security_group_ids parameter on your aws_db_instance resource. In that collection should be the security group you associated with your codebuild project. Currently it doesn't appear that your database has an associated security group and so traffic coming from your codebuild project isn't whitelisted and cannot make it through.
See Terrform docs

DMS task getting failed on Oracle on-going replication (Full load works fine)

We're using AWS DMS to migrate oracle databases into s3 buckets and after successfully running the full load on Oracle Database 19c Standard Edition 2 hosted in rds, the on-going replication is failing with error:
Failed to add the REDO sequence xxxx; to LogMiner in thread 1;. Replication task could not find the required REDO log on the source database to read changes from. Please check redo log retention settings and retry
I already checked that the archivelog retention hours was set to 24
Have anyone came across the same issue!? Any help will be much appreciated.
We managed to fix the issue after rerunning the grants script as documented in aws dms. We could not find the root cause but some privilege was not assigned at first and impacted the redologs access https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html#CHAP_Source.Oracle.Amazon-Managed

Google Cloud SQL Read Replica Failing to replicate

I have created a new read replica from the GCP Cloud SQL Console, using the create read replica option
I am getting following error after creation of replica, replica instance is creating successfully but the replication not starting as expected.
Here is the error message I am getting in the error log.
"2020-05-05T05:11:30.747872Z 4 [ERROR] Slave I/O for channel '': error
connecting to master 'cloudsqlreplica#172.17.112.4:3306' - retry-time:
60 retries: 1, Error_code: 2003"
binlog is already enable on master.
Database version is MySQL 5.7
Auto storage increase is enabled
Automated backups are enabled
Point-in-time recovery is enabled
Please let me know if anyone came across this issue and if you know how to solve this problem.

AWS Data Pipeline. EC2Resource not able to access redshift

I am using AWS Data Pipeline to execute SQL queries on redshift which may involve(creating/deleting tables) for the first time.
Created a SQL Activity which "Runs On" an EC2 instance created as part of data pipeline and a Redshift with Database node with appropriate credentials.
But while running the pipeline , EC2 could not access the redshift database. Error thrown is as follows:
Unable to establish connection to jdbc:postgresql://xxxxx/yyyy Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Probably that it may be because of "ResourceRole" parameter of EC2 which is set to DataPipelineDefaultResource and IAM role may not have the right permissions to access the Redshift DB.
What is the right IAM role if that is the root cause for this or there could be some other reason.
Can you connect to the cluster using a normal client? If you can't, then it's likely there's no ingress allowed on the Redshift cluster. Maybe this might help