Code Monkey home page Code Monkey logo

Comments (5)

jtotham avatar jtotham commented on July 23, 2024

Perfect timing, I was trying to get this too work last night and am having exactly the same issue.

Latest snapshot found: 'rds:dr4r6hb7p917va-2018-01-18-15-05' from 2018-01-18 15:06:09.565000+00:00
Latest snapshot found: 'rds:dr4r6hb7p917va-2018-01-18-15-05' from 2018-01-18 15:06:09.565000+00:00

15:12:16
Checking if 'dr4r6hb7p917va-us-east-1-rds:dr4r6hb7p917va-2018-01-18-15-05' already exists in target region
Checking if 'dr4r6hb7p917va-us-east-1-rds:dr4r6hb7p917va-2018-01-18-15-05' already exists in target region

15:12:16
dr4r6hb7p917va-us-east-1-rds:dr4r6hb7p917va-2018-01-18-15-05 is already copied to us-west-2
dr4r6hb7p917va-us-east-1-rds:dr4r6hb7p917va-2018-01-18-15-05 is already copied to us-west-2

15:12:17
No snapshots for database dr4r6hb7p917va found in target region: Exception Traceback (most recent call last): File "/var/task/index.py", line 101, in lambda_handler remove_old_snapshots(message['Source ID']) File "/var/task/index.py", line 68, in remove_old_snapshots raise Exception("No snapshots for database {} found in target region".format(instance_name)) Exception: No snapshots for
No snapshots for database dr4r6hb7p917va found in target region: Exception
Traceback (most recent call last):
File "/var/task/index.py", line 101, in lambda_handler
remove_old_snapshots(message['Source ID'])
File "/var/task/index.py", line 68, in remove_old_snapshots
raise Exception("No snapshots for database
{}
found in target region".format(instance_name))
Exception: No snapshots for database dr4r6hb7p917va found in target region```

from aws-maintenance.

jtotham avatar jtotham commented on July 23, 2024

I think the issue is where that copy_name is being built up and coming out as dr4r6hb7p917va-us-east-1-rds:dr4r6hb7p917va-2018-01-18-15-05 this string contains a : which is not a valid char for the target name.

This then means the error being returned when it tries to do the copy action does not match the exception that is looking for "DBSnapshotNotFound" and it moves on past straight to print("{} is already copied to {}".format(copy_name, TARGET_REGION))

If I try and and perform the same copy in the console using the name generated I get this following error:

https://i.imgur.com/pr6jGM6.png

from aws-maintenance.

pbudzon avatar pbudzon commented on July 23, 2024

Hi both,

Thanks for the report. I'm looking into this now.

@fsantarelli - you mentioned that the stack creation failed in the target region? Can you raise another issue with more details about this?

from aws-maintenance.

fsantarelli avatar fsantarelli commented on July 23, 2024

Hi @pbudzon - thanks for your message, I can definitely raise another issue regarding the region issue.

from aws-maintenance.

pbudzon avatar pbudzon commented on July 23, 2024

Hi @fsantarelli @jtotham

You were correct, the : in the naming was causing an error. I pushed a fixed code which replaces that with a hyphen, which is an allowed character. The CloudFormation template is updated, so all you should need to do now is update your stacks and it should be working.

If you want to do some manual testing in the Lambda console, an example event (replace the database name with your own, everything else is ignored):

{
  "Records": [
    {
      "EventVersion": "1.0",
      "EventSubscriptionArn": "arn:aws:sns:EXAMPLE",
      "EventSource": "aws:sns",
      "Sns": {
        "Type": "Notification",
        "MessageId": "abcd",
        "TopicArn": "arn:aws:sns:eu-west-1:123456789012:topic_name",
        "Subject": "RDS Notification Message",
        "Message": "{\"Event Source\":\"db-instance\",\"Event Time\":\"2017-12-26 22:34:07.882\",\"Identifier Link\":\"https://console.aws.amazon.com/rds/home?region=eu-west-1#dbinstance:id=database_name\",\"Source ID\":\"PUT_YOUR_RDS_NAME_HERE\",\"Event ID\":\"http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/USER_Events.html#RDS-EVENT-0002\",\"Event Message\":\"Finished DB Instance backup\"}",
        "Timestamp": "2017-12-26T22:35:19.946Z",
        "SignatureVersion": "1",
        "Signature": "xxx",
        "SigningCertURL": "xxx",
        "UnsubscribeURL": "xxx"
      }
    }
  ]
}

Thanks for the report!

from aws-maintenance.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.