From 7ce1cbeac6eb785867b1582f49f14da3b08ae30d Mon Sep 17 00:00:00 2001 From: Maksym Naboka Date: Tue, 17 Jan 2017 10:51:16 -0800 Subject: [PATCH] dcos task log: improve user error message (#874) if executor was unable to start, no logs are avaiable. --- cli/dcoscli/task/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/dcoscli/task/main.py b/cli/dcoscli/task/main.py index 2a3c005..50578e5 100644 --- a/cli/dcoscli/task/main.py +++ b/cli/dcoscli/task/main.py @@ -289,6 +289,13 @@ def get_nested_container_id(task): container_status = status.get('container_status') if not container_status: logger.debug('Full task state: {}'.format(task)) + + # if task status is TASK_FAILED and no container_id + # available then the executor has never started and no + # logs available for this task. + if status.get('state') == 'TASK_FAILED': + raise DCOSException('No available logs found. ' + 'Please check your executor status') raise DCOSException('Invalid executor info. ' 'Missing field `container_status`')