Skip to content
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

agent -version does not print version #1035

Closed
knksmith57 opened this issue Oct 26, 2017 · 4 comments
Closed

agent -version does not print version #1035

knksmith57 opened this issue Oct 26, 2017 · 4 comments

Comments

@knksmith57
Copy link

Summary

The agent help banner (agent -help) states that running agent -version should:

Print the agent version information and exit

$ docker run --rm amazon/amazon-ecs-agent:latest -help
Usage of Amazon ECS Agent:
  -blackhole-ec2-metadata
    	Blackhole the EC2 Metadata requests. Setting this option can cause the ECS Agent to fail to work properly.  We do not recommend setting this option
  -k	Disable SSL certificate verification. We do not recommend setting this option
  -license
    	Print the LICENSE and NOTICE files and exit
  -loglevel string
    	Loglevel: [<crit>|<error>|<warn>|<info>|<debug>]
  -version
    	Print the agent version information and exit

It does not do this.


$ docker run --rm amazon/amazon-ecs-agent:latest -version
2017-10-26T16:26:56Z [INFO] Loading configuration
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_CONTAINER_STOP_TIMEOUT
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_IMAGE_MINIMUM_CLEANUP_AGE
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_IMAGE_CLEANUP_INTERVAL
2017-10-26T16:26:56Z [DEBUG] Loaded config: Cluster: ,  Region: us-west-2,  DataDir: /data/, Checkpoint: false, AuthType: , UpdatesEnabled: false, DisableMetrics: false, ReservedMem: 0, TaskCleanupWaitDuration: 3h0m0s, DockerStopTimeout: 30s, PauseContainerImageName: amazon/amazon-ecs-pause, PauseContainerTag: 0.1.0
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.17: Get http://unix.sock/v1.17/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.18: Get http://unix.sock/v1.18/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.19: Get http://unix.sock/v1.19/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.20: Get http://unix.sock/v1.20/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.21: Get http://unix.sock/v1.21/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.22: Get http://unix.sock/v1.22/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.23: Get http://unix.sock/v1.23/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.24: Get http://unix.sock/v1.24/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.25: Get http://unix.sock/v1.25/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.26: Get http://unix.sock/v1.26/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.27: Get http://unix.sock/v1.27/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.28: Get http://unix.sock/v1.28/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.29: Get http://unix.sock/v1.29/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [ERROR] Unable to ping docker daemon. Ensure docker is running. module="TaskEngine" err="Get http://unix.sock/v1.17/version: dial unix /var/run/docker.sock: connect: no such file or directory"
2017-10-26T16:26:56Z [CRITICAL] Error creating Docker client: Get http://unix.sock/v1.17/version: dial unix /var/run/docker.sock: connect: no such file or directory

Description

Expected Behavior

agent -version should print the agent version information and exit.

Observed Behavior

agent -version attempts to start the agent, fails, and exits uncleanly without printing the agent version:

$ docker run --rm amazon/amazon-ecs-agent:latest -version
2017-10-26T16:26:56Z [INFO] Loading configuration
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_CONTAINER_STOP_TIMEOUT
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_IMAGE_MINIMUM_CLEANUP_AGE
2017-10-26T16:26:56Z [DEBUG] Environment variable empty: ECS_IMAGE_CLEANUP_INTERVAL
2017-10-26T16:26:56Z [DEBUG] Loaded config: Cluster: ,  Region: us-west-2,  DataDir: /data/, Checkpoint: false, AuthType: , UpdatesEnabled: false, DisableMetrics: false, ReservedMem: 0, TaskCleanupWaitDuration: 3h0m0s, DockerStopTimeout: 30s, PauseContainerImageName: amazon/amazon-ecs-pause, PauseContainerTag: 0.1.0
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.17: Get http://unix.sock/v1.17/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.18: Get http://unix.sock/v1.18/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.19: Get http://unix.sock/v1.19/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.20: Get http://unix.sock/v1.20/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.21: Get http://unix.sock/v1.21/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.22: Get http://unix.sock/v1.22/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.23: Get http://unix.sock/v1.23/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.24: Get http://unix.sock/v1.24/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.25: Get http://unix.sock/v1.25/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.26: Get http://unix.sock/v1.26/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.27: Get http://unix.sock/v1.27/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.28: Get http://unix.sock/v1.28/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [INFO] Failed to ping with Docker version 1.29: Get http://unix.sock/v1.29/version: dial unix /var/run/docker.sock: connect: no such file or directory
2017-10-26T16:26:56Z [ERROR] Unable to ping docker daemon. Ensure docker is running. module="TaskEngine" err="Get http://unix.sock/v1.17/version: dial unix /var/run/docker.sock: connect: no such file or directory"
2017-10-26T16:26:56Z [CRITICAL] Error creating Docker client: Get http://unix.sock/v1.17/version: dial unix /var/run/docker.sock: connect: no such file or directory

Environment Details

$ docker inspect amazon/amazon-ecs-agent:latest | jq -r '.[].Id'
sha256:96e5393c89d486374b668c659ff40d794e279a89c7aa5e31f52d7895b9b38d42

$ curl --silent http://localhost:51678/v1/metadata | jq -r .Version
Amazon ECS Agent - v1.14.5 (0dcd02c)

$ uname -a
Linux <redacted> 4.9.43-17.39.amzn1.x86_64 #1 SMP Fri Sep 15 23:39:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Supporting Log Snippets

see contextual snippets above

@samuelkarp
Copy link
Contributor

The agent is trying to figure out Docker's version before printing its own version. It probably shouldn't do that, so I've labeled this as a bug.

@nmeyerhans
Copy link
Contributor

This is being addressed in #1118

@yhlee-aws
Copy link
Contributor

PR #1118 has been merged, next agent release will contain the fix.

@yhlee-aws yhlee-aws added this to the 1.16.1 milestone Dec 1, 2017
@jtoberon jtoberon modified the milestones: 1.16.1, 1.17.0 Jan 4, 2018
@aaithal aaithal modified the milestones: 1.17.0, 1.16.2 Jan 18, 2018
@sharanyad
Copy link
Contributor

This should be fixed now as part of the new release v.1.17.0 and 2017.09.h ECS Optimized AMI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants