Aws-cli: ECS service showing failure by aws cli, but its running fine in the ECS console.

Created on 18 Aug 2015  路  6Comments  路  Source: aws/aws-cli

Hello,

Below command is not working,
aws ecs describe-services --service stackserver

I am getting result
"services": [],
"failures": [
{
"reason": "MISSING",

eventhough my service is running fine in the ECS console, why command not showing.

Please help urgent. I badly stuck.

closing-soon

Most helpful comment

try this, it should work
aws ecs describe-services --service name-of-the-service --cluster name-of-the-cluster

All 6 comments

It works for me when I create a new ECS service with all default setting and then run the aforementioned command. Can you run your command again plus --debug option, and then paste the output?

Closing due to inactivity. Please let us know when you are able to provide --debug output and we will investigate further.

Having the exact same issue. Here is the output of the command with debug.
``` {
"services": [],
"failures": [
{
"reason": "MISSING",
"arn": "arn:aws:ecs:us-east-1:131778002569:service/salesforce-dev"
}
]
}
2016-04-28 17:08:18,758 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.10.13 Python/2.7.10 Darwin/14.5.0 botocore/1.4.4
2016-04-28 17:08:18,758 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['ecs', 'describe-services', '--service', 'salesforce-dev', '--debug']
2016-04-28 17:08:18,758 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler
2016-04-28 17:08:18,758 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler
2016-04-28 17:08:18,758 - MainThread - botocore.credentials - DEBUG - Skipping environment variable credential check because profile name was explicitly set.
2016-04-28 17:08:18,768 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.ecs: calling handler
2016-04-28 17:08:18,768 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: ecs
2016-04-28 17:08:18,769 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ecs: calling handler
2016-04-28 17:08:18,772 - MainThread - awscli.clidriver - DEBUG - OrderedDict([(u'cluster', ), (u'services', )])
2016-04-28 17:08:18,772 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.describe-services: calling handler
2016-04-28 17:08:18,772 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.describe-services: calling handler
2016-04-28 17:08:18,772 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.describe-services: calling handler
2016-04-28 17:08:18,774 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.describe-services: calling handler
2016-04-28 17:08:18,775 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ecs.describe-services: calling handler >
2016-04-28 17:08:18,775 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ecs.describe-services: calling handler >
2016-04-28 17:08:18,775 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.describe-services.cluster: calling handler
2016-04-28 17:08:18,775 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.describe-services.services: calling handler
2016-04-28 17:08:18,775 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.ecs.describe-services: calling handler
2016-04-28 17:08:18,776 - MainThread - awscli.arguments - DEBUG - Unpacked value of [u'salesforce-dev'] for parameter "services": [u'salesforce-dev']
2016-04-28 17:08:18,776 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.describe-services.cli-input-json: calling handler
2016-04-28 17:08:18,776 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.describe-services.generate-cli-skeleton: calling handler
2016-04-28 17:08:18,776 - MainThread - botocore.hooks - DEBUG - Event calling-command.ecs.describe-services: calling handler >
2016-04-28 17:08:18,776 - MainThread - botocore.hooks - DEBUG - Event calling-command.ecs.describe-services: calling handler >
2016-04-28 17:08:18,776 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2016-04-28 17:08:18,776 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2016-04-28 17:08:18,776 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2016-04-28 17:08:18,776 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2016-04-28 17:08:18,783 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: ecs
2016-04-28 17:08:18,784 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.ecs: calling handler
2016-04-28 17:08:18,791 - MainThread - botocore.endpoint - DEBUG - Setting ecs timeout as (60, 60)
2016-04-28 17:08:18,791 - MainThread - botocore.endpoint - DEBUG - Making request for (verify_ssl=True) with params: {'body': '{"services": ["salesforce-dev"]}', 'url': u'https://ecs.us-east-1.amazonaws.com/', 'headers': {'User-Agent': 'aws-cli/1.10.13 Python/2.7.10 Darwin/14.5.0 botocore/1.4.4', 'Content-Type': u'application/x-amz-json-1.1', 'X-Amz-Target': u'AmazonEC2ContainerServiceV20141113.DescribeServices'}, 'query_string': '', 'url_path': '/', 'method': u'POST'}
2016-04-28 17:08:18,792 - MainThread - botocore.hooks - DEBUG - Event request-created.ecs.DescribeServices: calling handler >
2016-04-28 17:08:18,792 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2016-04-28 17:08:18,792 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.1
host:ecs.us-east-1.amazonaws.com
user-agent:aws-cli/1.10.13 Python/2.7.10 Darwin/14.5.0 botocore/1.4.4
x-amz-date:20160428T210818Z
x-amz-target:AmazonEC2ContainerServiceV20141113.DescribeServices

content-type;host;user-agent;x-amz-date;x-amz-target
b0bae76686a4d226ab96471a78e98f63a5b797bad9eb55094fcd4a419544660f
2016-04-28 17:08:18,792 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20160428T210818Z
20160428/us-east-1/ecs/aws4_request
151bd83e170e961b1069b18b2efaf04afacfb86abd98b829c754fe41f47552ba
2016-04-28 17:08:18,792 - MainThread - botocore.auth - DEBUG - Signature:
7780e349fadc3c9f4b84891ec25fc8825eec9e09567af803725d6901984df3b2
2016-04-28 17:08:18,794 - MainThread - botocore.endpoint - DEBUG - Sending http request: 2016-04-28 17:08:18,794 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (1): ecs.us-east-1.amazonaws.com
2016-04-28 17:08:19,120 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - DEBUG - "POST / HTTP/1.1" 200 115
2016-04-28 17:08:19,121 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amzn-requestid': '551c2d59-0d85-11e6-8466-5d68dcd29fbc', 'content-length': '115', 'server': 'Server', 'connection': 'keep-alive', 'date': 'Thu, 28 Apr 2016 21:08:19 GMT', 'content-type': 'application/x-amz-json-1.1'}
2016-04-28 17:08:19,121 - MainThread - botocore.parsers - DEBUG - Response body:
{"failures":[{"arn":"arn:aws:ecs:us-east-1:131778002569:service/salesforce-dev","reason":"MISSING"}],"services":[]}
2016-04-28 17:08:19,122 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ecs.DescribeServices: calling handler
2016-04-28 17:08:19,122 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
2016-04-28 17:08:19,122 - MainThread - botocore.hooks - DEBUG - Event after-call.ecs.DescribeServices: calling handler
2016-04-28 17:08:19,122 - MainThread - awscli.errorhandler - DEBUG - HTTP Response Code: 200
2016-04-28 17:08:19,122 - MainThread - awscli.formatter - DEBUG - RequestId: 551c2d59-0d85-11e6-8466-5d68dcd29fbc
{
"services": [],
"failures": [
{
"reason": "MISSING",
"arn": "arn:aws:ecs:us-east-1:131778002569:service/salesforce-dev"
}
]
}


Found the issue, if you dont pass clustername also as a parameter than it will return the following:
```{
"services": [],
"failures": [
{
"reason": "MISSING",
"arn": "arn:aws:ecs:us-east-1:131778002569:service/salesforce-dev"
}
]
}


try this, it should work
aws ecs describe-services --service name-of-the-service --cluster name-of-the-cluster

@karthiksaligrama Thanks for the advil! I was getting the same with aws ecs describe-tasks coming back missing, the cluster I'm using isn't named default, so passing the cluster name worked as well at cli. What a rabbit hole!

Was this page helpful?
0 / 5 - 0 ratings