Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #3

Open
raakey opened this issue May 8, 2017 · 24 comments
Open

Error #3

raakey opened this issue May 8, 2017 · 24 comments

Comments

@raakey
Copy link

raakey commented May 8, 2017

Hi, iam very new to the Lambda, but when i execute your scripts in lambda, here iam getting the Error , please find below
2017-05-07T23:00:14.702Z e6ba23fe-3378-11e7-b141-6384f3daab93 TypeError: Cannot read property 'SnapshotId' of undefined
at null._onTimeout (/var/task/index.js:76:73)
at Timer.listOnTimeout (timers.js:92:15)

@webdigi
Copy link
Owner

webdigi commented May 8, 2017

@raakey - did you setup the permissions

did you follow steps here https://www.webdigi.co.uk/blog/2017/aws-instance-automated-ami-creation-deletion-system/ to create this permissions https://github.com/webdigi/AWS-AMI-Automated-Creation-Deletion/blob/master/roles/roles.json and then add that permission to Lambda?

It just looks like a permission issue.

@raakey
Copy link
Author

raakey commented May 8, 2017

Yes i followed the same. AMI got deleted but Snapshots are still exist.

@webdigi
Copy link
Owner

webdigi commented May 8, 2017

how many EBS volumes were attached to the instances?

@raakey
Copy link
Author

raakey commented May 8, 2017

Only One.

@webdigi
Copy link
Owner

webdigi commented May 8, 2017

can you please try another AMI. Looks like https://github.com/webdigi/AWS-AMI-Automated-Creation-Deletion/blob/master/lambda/deleteAMI.js line 79 is not set.

Please paste the log lines above and below the ones you sent earlier also. We have multiple instances and they all work well as expected.

@raakey
Copy link
Author

raakey commented May 8, 2017

Ok i will let u know that, thanks

@raakey
Copy link
Author

raakey commented May 8, 2017

Logs
FYI,

Logs
FYI,

Time (UTC +00:00)
Message
2017-05-07

23:00:02 START RequestId: e6ba23fe-3378-11e7-b141-6384f3daab93 Version: $LATEST

23:00:04 2017-05-07T23:00:04.182Z e6ba23fe-3378-11e7-b141-6384f3daab93 Time to delete ELK_204_70

23:00:04 2017-05-07T23:00:04.182Z e6ba23fe-3378-11e7-b141-6384f3daab93 image that is going to be deregistered: ELK_204_70

23:00:04 2017-05-07T23:00:04.182Z e6ba23fe-3378-11e7-b141-6384f3daab93 image id: ami-23f89035

23:00:04 2017-05-07T23:00:04.182Z e6ba23fe-3378-11e7-b141-6384f3daab93 { ImageId: 'ami-23f89035' }

23:00:04 2017-05-07T23:00:04.502Z e6ba23fe-3378-11e7-b141-6384f3daab93 Not yet time to delete ELK_204_70

23:00:04 2017-05-07T23:00:04.823Z e6ba23fe-3378-11e7-b141-6384f3daab93 Image Deregistered

23:00:14 2017-05-07T23:00:14.510Z e6ba23fe-3378-11e7-b141-6384f3daab93 Time to delete ELK_204_70

23:00:14 2017-05-07T23:00:14.510Z e6ba23fe-3378-11e7-b141-6384f3daab93 snap-0bb0a59e5a537b13c

23:00:14 2017-05-07T23:00:14.642Z e6ba23fe-3378-11e7-b141-6384f3daab93 snap-0fd68eb48398e2386

23:00:14 2017-05-07T23:00:14.702Z e6ba23fe-3378-11e7-b141-6384f3daab93 TypeError: Cannot read property 'SnapshotId' of undefined at null._onTimeout (/var/task/index.js:76:73) at Timer.listOnTimeout (timers.js:92:15)

23:00:14 END RequestId: e6ba23fe-3378-11e7-b141-6384f3daab93

23:00:14 REPORT RequestId: e6ba23fe-3378-11e7-b141-6384f3daab93 Duration: 12409.69 ms Billed Duration: 12500 ms Memory Size: 128 MB Max Memory Used: 38 MB

23:00:14 RequestId: e6ba23fe-3378-11e7-b141-6384f3daab93 Process exited before completing request

23:01:07 START RequestId: e6ba23fe-3378-11e7-b141-6384f3daab93 Version: $LATEST

23:01:13 2017-05-07T23:01:13.302Z e6ba23fe-3378-11e7-b141-6384f3daab93 Not yet time to delete ELK_204_70

23:01:23 2017-05-07T23:01:23.606Z e6ba23fe-3378-11e7-b141-6384f3daab93 Not yet time to delete ELK_204_70

23:01:23 END RequestId: e6ba23fe-3378-11e7-b141-6384f3daab93

23:01:23 REPORT RequestId: e6ba23fe-3378-11e7-b141-6384f3daab93 Duration: 15655.76 ms Billed Duration: 15700 ms Memory Size: 128

@webdigi
Copy link
Owner

webdigi commented May 8, 2017

ok, did you try the create and delete again?

Have you made any changes to the code?

@raakey
Copy link
Author

raakey commented May 8, 2017

except region, haven't changed any thing, i just copy and pasted

@webdigi
Copy link
Owner

webdigi commented May 8, 2017

thanks, we could not replicate this issue at all. Very odd.

  1. Can you please send me a screenshot of the tags that are added to the instance. I just want to make sure none are missed.
  2. it will be helpful if you can please try a new instance.
  3. Do you have any permission restriction on this account or do you have root access?

@raakey
Copy link
Author

raakey commented May 9, 2017

Ok, im going to try on another instance. i will send the logs again. Thanks for the reply

@raakey
Copy link
Author

raakey commented May 19, 2017

TypeError: Cannot read property 'SnapshotId' of undefined at null._onTimeout (/var/task/index.js:76:73) at Timer.listOnTimeout (timers.js:92:15)
2017-05-18T23:00:54.054Z cf73cb83-3c1d-11e7-9030-e39ef6280ae5 TypeError: Cannot read property 'SnapshotId' of undefined
at null._onTimeout (/var/task/index.js:76:73)
at Timer.listOnTimeout (timers.js:92:15)

I tried on another Instances, Getting same problem,

@webdigi
Copy link
Owner

webdigi commented May 19, 2017

Sorry, we could not replicate the issue.

If possible can you please send us a screenshot

  1. The tags used in the instance
    instance-tags

  2. AMI name after the instance is created.
    ami-name

It might be best to run just the create script first and then send us the screenshot and run the delete script later.

@raakey
Copy link
Author

raakey commented May 19, 2017

I have tried on another instance just now, with adding same tags to that, that was working fine and clearing all AMI's with snapshots, and which i created earlier (above screen shot). that was not working properly. it showing timeout error (earlier error code.).

@webdigi
Copy link
Owner

webdigi commented May 19, 2017

so did you fix it with a change? I assume you mentioned it worked?

@raakey
Copy link
Author

raakey commented May 19, 2017

Nope, i have tried on some other instance with same Tags, but how its possible that, it is working fine on one machine and not working on other machine ????

changes i did.
screenshot from 2017-05-19 22-09-33
instead of DATETODEL- i used "BackupAMIUid-". thats it,
With this minimal changes one instance working perfectly, and other one not working.

@webdigi
Copy link
Owner

webdigi commented May 19, 2017

instead of DATETODEL- i used "BackupAMIUid-". thats it,

was that applied to both the create and delete lambda function?

@raakey
Copy link
Author

raakey commented May 19, 2017

screenshot from 2017-05-19 22-32-04
Yes

@webdigi
Copy link
Owner

webdigi commented Jun 14, 2017

Thanks for that. It looks like a timeout. In the lambda script can you please check configuration and the timeout is set to 5 minutes? Related to issue #4.

@raakey
Copy link
Author

raakey commented Jun 14, 2017 via email

@kpavan93
Copy link

I set timeout to 5 minutes. And again i getting that problem.snapshots deletion problem.
TypeError: Cannot read property 'SnapshotId' of undefined
at null._onTimeout (/var/task/index.js:76:73)
at Timer.listOnTimeout (timers.js:92:15)
I didn't change anything in code also.still i am getting that problem.Any suggestions plz....

@Joshuapaul
Copy link

I am also facing same issue. Any solutions to fix this issue.

@Joshuapaul
Copy link

found another solution here "#4". I have updated my code and lets see how my job will go on sunday.

@HSkogmo
Copy link

HSkogmo commented Feb 6, 2019

@Joshuapaul There's been new commits from Dec 2018, and it addressed this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants