aws / amazon-ecs-cli

The Amazon ECS CLI enables users to run their applications on ECS/Fargate using the Docker Compose file format, quickly provision resources, push/pull images in ECR, and monitor running applications on ECS/Fargate.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI.html
Other
1.77k stars 302 forks source link

Enable debug logging #230

Open neowulf opened 7 years ago

neowulf commented 7 years ago

Currently, there's verbose logging which is good. But when developing, we would like to see debug level logging which would help us to understand the following errors:

  1. In the following case, it would be nice to know the pattern is getting matched.
    
    $ ecs-cli scale product-service --size 2 --capability-iam 

ERRO[0000] Error executing 'scale': CloudFormation stack not found for cluster 'refarch-v3'


2. In the following case, a more descriptive error would be nice. In case this error is provided from Cloudformation - where can we get additional information? Perhaps a http link / pointer to the console to assist in further debugging the issue?

$ ecs-cli scale productservice --size 1 --capability-iam CAPABILITY_NAMED_IAM ERRO[0000] Error executing 'scale': ValidationError: Invalid input for parameter key VpcAvailabilityZones. Cannot specify usePreviousValue as true for a parameter key not in the previous template status code: 400, request id: d6acd489-1e7f-11e7-af9e-a9c12ffff71f

yinshiua commented 7 years ago

I agree, we definitely should have debug level logging for every command.

For #1 error, ecs-cli appends a prefix 'amazon-ecs-cli-setup-' to your cluster name to create cloudFormation stack by default. If you have change the prefix in ~/.ecs/config, your stack name will be different.

For #2 error, you can go to cloudFormation console and look at the events for that specific stack, that should tell you some more information.

xinyifly commented 6 years ago

@yinshiua I got almost same problem as #2

FATA[0001] Error executing 'scale': ValidationError: Invalid input for parameter key SecurityGroupIds. Cannot specify usePreviousValue as true for a parameter key not in the previous template
        status code: 400, request id: 82f08336-bd21-11e7-8d24-792a284e742e 
ecs-cli version 0.6.6 (fe47016)

And no recent CloudFormation log recorded. I finally resolved my problem by manualy changed desired, max running count from ec2/autoscaling, thank to ecs-cli up created the auto scaling group.