-
Notifications
You must be signed in to change notification settings - Fork 4
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 sometimes when launching instance #3
Comments
EC2 is a distributed system, so state is not always consistent between all EC2 server nodes. It takes time for changes to propagate. --- a/src/AWSEC2.jl
+++ b/src/AWSEC2.jl
@@ -149,9 +149,14 @@ function create_ec2(aws::AWSConfig, name; ImageId="ami-1ecae776",
r = r["instancesSet"]["item"]
- ec2(aws, "CreateTags", Dict("ResourceId.1" => r["instanceId"],
- "Tag.1.Key" => "Name",
- "Tag.1.Value" => name))
+ @repeat 3 try
+
+ ec2(aws, "CreateTags", Dict("ResourceId.1" => r["instanceId"],
+ "Tag.1.Key" => "Name",
+ "Tag.1.Value" => name))
+ catch e
+ @delay_retry if ecode(e) == "InvalidInstanceID.NotFound"
+ end
return r
end |
Thanks for the quick reply, that did the trick (with a missing --- a/src/AWSEC2.jl
+++ b/src/AWSEC2.jl
@@ -149,9 +149,14 @@ function create_ec2(aws::AWSConfig, name; ImageId="ami-1ecae776",
r = r["instancesSet"]["item"]
- ec2(aws, "CreateTags", Dict("ResourceId.1" => r["instanceId"],
- "Tag.1.Key" => "Name",
- "Tag.1.Value" => name))
+ @repeat 3 try
+
+ ec2(aws, "CreateTags", Dict("ResourceId.1" => r["instanceId"],
+ "Tag.1.Key" => "Name",
+ "Tag.1.Value" => name))
+ catch e
+ @delay_retry if ecode(e) == "InvalidInstanceID.NotFound" end
+ end
return r
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes as I launch an instance I get the following error. It doesn't seem to be deterministic - I just launched 162 instances in a loop before it failed on the 163rd. Do you have any idea what could be the cause? I am on AWSCore v0.3.9 and AWSEC2 v0.3.1
The text was updated successfully, but these errors were encountered: