Class: Ufo::CLI::Ps::Errors
- Inherits:
-
Ufo::CLI::Ps
- Object
- Base
- Ufo::CLI::Ps
- Ufo::CLI::Ps::Errors
- Extended by:
- Memoist
- Defined in:
- lib/ufo/cli/ps/errors.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#catchall ⇒ Object
Example: (service app1-web-dev-EcsService-8FMliG8m6M2p) was unable to stop or start tasks during a deployment because of the service deployment configuration.
-
#deployment_configuration ⇒ Object
To reproduce.
-
#initialize(options = {}) ⇒ Errors
constructor
A new instance of Errors.
-
#scale ⇒ Object
If running count < desired account for a long time And see was unable to place a task Probably not enough capacity.
- #show ⇒ Object
-
#target_group ⇒ Object
The error currently happens to be the 5th element.
Methods inherited from Ufo::CLI::Ps
#convert_to_task_objects, #run, #scalable_target, #show_errors, #show_tasks, #summary, #tasks_counts
Methods included from Ufo::Concerns::Autoscaling
#autoscaling, #autoscaling_enabled?
Methods included from AwsServices
#acm, #applicationautoscaling, #aws_options, #cfn, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #s3, #ssm_client, #waf_client
Methods included from AwsServices::Concerns
#find_stack, #find_stack_resources, #stack_resources, #status, #task_definition_arns
Methods included from Utils::Sure
Methods included from Utils::Pretty
#pretty_home, #pretty_path, #pretty_time
Methods included from Utils::Logging
Methods included from Ufo::Concerns
Methods included from Ufo::Concerns::Names
Constructor Details
#initialize(options = {}) ⇒ Errors
Returns a new instance of Errors.
5 6 7 8 |
# File 'lib/ufo/cli/ps/errors.rb', line 5 def initialize(={}) super @tasks = [:tasks] end |
Instance Method Details
#catchall ⇒ Object
Example:
(service app1-web-dev-EcsService-8FMliG8m6M2p) was unable to stop or start tasks during a deployment because of the service deployment configuration. Update the minimumHealthyPercent or maximumPercent value and try again.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/ufo/cli/ps/errors.rb', line 91 def catchall words = %w[fail unable error] = recent_events.map(&:message) = .find do || words.detect { |word| .include?(word) } end return unless logger.error "ERROR: #{}".color(:red) logger.error <<~EOL You might have to #{cancel_actions[:cfn]} the stack with: ufo #{cancel_actions[:ufo]} And try again after fixing the issue. EOL end |
#deployment_configuration ⇒ Object
To reproduce
.ufo/config.rb
Ufo.configure do |config|
config.ecs.maximum_percent = 150 # need at least 200 to go from 1 to 2 containers
config.ecs.minimum_healthy_percent = 100
end
Event message error:
ERROR: (service app1-web-dev-EcsService-8FMliG8m6M2p) was unable to stop or start tasks during a deployment because of the service deployment configuration. Update the minimumHealthyPercent or maximumPercent value and try again.
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/ufo/cli/ps/errors.rb', line 76 def deployment_configuration = return unless .include?("unable") && .include?("deployment configuration") logger.error "ERROR: Deployment Configuration".color(:red) logger.error <<~EOL You might have a Deployment Configuration that prevents the deployment from completing. See: https://ufoships.com/docs/debug/deployment-configuration/ EOL end |
#scale ⇒ Object
If running count < desired account for a long time And see was unable to place a task Probably not enough capacity
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ufo/cli/ps/errors.rb', line 24 def scale return if service.running_count >= service.desired_count error_event = recent_events.find do |e| e. =~ /was unable to place a task/ end return unless error_event logger.info "There is an issue scaling the #{@stack_name.color(:green)} service to #{service.desired_count}. Here's the error:" logger.info error_event..color(:red) if service.launch_type == "EC2" logger.info <<~EOL If AutoScaling is set up for the container instances, it can take a little time to add additional instances. You'll see this message until the capacity is added. EOL end end |
#show ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ufo/cli/ps/errors.rb', line 10 def show = return unless return if =~ /has reached a steady state/ scale target_group deployment_configuration catchall end |
#target_group ⇒ Object
The error currently happens to be the 5th element.
Example:
(service XXX) (instance i-XXX) (port 32875) is unhealthy in (target-group arn:aws:elasticloadbalancing:us-east-1:111111111111:targetgroup/devel-Targe-1111111111111/1111111111111111) due to (reason Health checks failed with these codes: [400])">]
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/ufo/cli/ps/errors.rb', line 47 def target_group error_event = recent_events.find do |e| e. =~ /is unhealthy in/ && e. =~ /targetgroup/ end return unless error_event logger.error "There are targets in the target group reporting unhealthy. This can cause containers to cycle. Here's the error:" logger.error error_event..color(:red) logger.error <<~EOL Check out the ECS console and EC2 Load Balancer console for more info. Sometimes they may not helpful :( Docs that may help: https://ufoships.com/docs/debug/unhealthy-targets/ EOL end |