aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.53k stars 4.12k forks source link

aws deploy install not running on Ubuntu Server 18.04/20.04 arm64 #5874

Closed flash0591 closed 3 months ago

flash0591 commented 3 years ago

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug If running "sudo aws deploy install --override-config --config-file /etc/codedeploy-agent/conf/codedeploy.onpremises.yml --region eu-central-1" with AWS-CLI Version 2.1.19 on an Ubuntu Server it returns "Only Ubuntu Server, Red Hat Enterprise Linux Server and Windows Server operating systems are supported.". Running "cat /etc/lsb-release" returns the following: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"

Also tested on Ubuntu Server 20.04 LTS.

SDK version number AWS-CLI Version 2.1.19

Platform/OS/Hardware/Device Raspberry Pi 3 with arm64-Version of Ubuntu Server (18.04. and 20.04 tested)

To Reproduce (observed behavior) To reproduce install an Ubuntu Server 18.04 or 20.04 on Raspberry Pi 3 and run the command above.

Expected behavior I would have expected that the OS is supported.

Logs/output Only Ubuntu Server, Red Hat Enterprise Linux Server and Windows Server operating systems are supported.

kdaily commented 3 years ago

Hi @flash0591,

Can you please provide logs by adding the --debug parameter to your command? Please remove any sensitive information like account numbers. Thank you!

flash0591 commented 3 years ago

Hi @kdaily, here is the log:

2021-01-20 07:16:09,317 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.1.20 Python/3.7.3 Linux/5.4.0-1015-raspi exe/aarch64.ubuntu.18 2021-01-20 07:16:09,325 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['deploy', 'install', '--override-config', '--config-file', '/etc/codedeploy-agent/conf/codedeploy.onpremises.yml', '--region', 'eu-central-1', '--debug'] 2021-01-20 07:16:09,452 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0xffffaee19d08> 2021-01-20 07:16:09,453 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0xffffaf00fbf8> 2021-01-20 07:16:09,453 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>> 2021-01-20 07:16:09,454 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0xffffaf03a1e0> 2021-01-20 07:16:09,454 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0xffffaf03aea0> 2021-01-20 07:16:09,454 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0xffffaee2f488> 2021-01-20 07:16:09,455 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0xffffaef5b2f0> 2021-01-20 07:16:09,456 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>> 2021-01-20 07:16:09,456 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0xffffaee25730> 2021-01-20 07:16:09,457 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.1.20/dist/awscli/data/cli.json 2021-01-20 07:16:09,481 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0xffffaef0aea0> 2021-01-20 07:16:09,482 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0xffffaef0f1e0> 2021-01-20 07:16:09,482 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0xffffaef0f158> 2021-01-20 07:16:09,483 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0xffffaef0f2f0> 2021-01-20 07:16:09,484 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0xffffaef0f268> 2021-01-20 07:16:09,485 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0xffffaedd14c8> 2021-01-20 07:16:09,485 - MainThread - botocore.session - DEBUG - Setting config variable for region to 'eu-central-1' 2021-01-20 07:16:09,488 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.1.20 Python/3.7.3 Linux/5.4.0-1015-raspi exe/aarch64.ubuntu.18 prompt/off 2021-01-20 07:16:09,489 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['deploy', 'install', '--override-config', '--config-file', '/etc/codedeploy-agent/conf/codedeploy.onpremises.yml', '--region', 'eu-central-1', '--debug'] 2021-01-20 07:16:09,489 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0xffffaee1f2f0> 2021-01-20 07:16:09,490 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0xffffaf248c80> 2021-01-20 07:16:09,491 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0xffffaee09c80> 2021-01-20 07:16:09,492 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0xffffaf2441e0> 2021-01-20 07:16:09,493 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0xffffaf22b268> 2021-01-20 07:16:09,497 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/ 2021-01-20 07:16:09,508 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0xffffaef5b1e0> 2021-01-20 07:16:09,509 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0xffffaf010ae8> 2021-01-20 07:16:09,635 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.1.20/dist/botocore/data/codedeploy/2014-10-06/service-2.json 2021-01-20 07:16:09,684 - MainThread - botocore.hooks - DEBUG - Event building-command-table.deploy: calling handler <function inject_commands at 0xffffaf03a400> 2021-01-20 07:16:09,685 - MainThread - botocore.hooks - DEBUG - Event building-command-table.deploy: calling handler <function add_waiters at 0xffffaee25730> 2021-01-20 07:16:09,805 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.1.20/dist/botocore/data/codedeploy/2014-10-06/waiters-2.json 2021-01-20 07:16:09,811 - MainThread - botocore.hooks - DEBUG - Event building-command-table.deploy_install: calling handler <function add_waiters at 0xffffaee25730> 2021-01-20 07:16:09,816 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.install.config-file: calling handler <awscli.paramfile.URIArgumentHandler object at 0xffffaed1b5f8> 2021-01-20 07:16:09,817 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.install: calling handler <awscli.argprocess.ParamShorthandParser object at 0xffffaf2716a0> 2021-01-20 07:16:09,818 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.install.override-config: calling handler <awscli.paramfile.URIArgumentHandler object at 0xffffaed1b5f8> 2021-01-20 07:16:09,818 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.install: calling handler <awscli.argprocess.ParamShorthandParser object at 0xffffaf2716a0> 2021-01-20 07:16:09,819 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.install.agent-installer: calling handler <awscli.paramfile.URIArgumentHandler object at 0xffffaed1b5f8> 2021-01-20 07:16:09,823 - MainThread - awscli.clidriver - DEBUG - Exception caught in main() Traceback (most recent call last): File "awscli/clidriver.py", line 457, in main File "awscli/clidriver.py", line 586, in call File "awscli/customizations/commands.py", line 191, in call File "awscli/customizations/codedeploy/install.py", line 65, in _run_main File "awscli/customizations/codedeploy/utils.py", line 119, in validate_instance RuntimeError: Only Ubuntu Server, Red Hat Enterprise Linux Server and Windows Server operating systems are supported.

Only Ubuntu Server, Red Hat Enterprise Linux Server and Windows Server operating systems are supported.

mckalexee commented 3 years ago

@kdaily I'm running into the same issue. Looking at the utils.py validate_instance function it looks like we're looking at /etc/lsb-release.

Here's the contents of mine on the server

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

I haven't tried to debug the _linux_distribution function yet, but it looks fine. https://github.com/aws/aws-cli/blob/4fd42b1bd5e670afc8ca6bed1666181397733398/awscli/compat.py#L458

kdaily commented 3 years ago

Hi @flash0591,

Looks like for your case the all caps UBUNTU in the DISTRIB_ID would cause it to fail here:

https://github.com/aws/aws-cli/blob/6887f0e053f4abd6f8f23dd2be9179b873ff9be4/awscli/customizations/codedeploy/utils.py#L111

@mckalexee - I'll have to investigate your scenario further, as the contents there look to be OK!

flash0591 commented 3 years ago

Hi @kdaily , sorry, there was a failure. I double checked, my /etc/lsb-release is equal to @mckalexee 's version. Just Ubuntu Version is slightly different. DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"

kdaily commented 3 years ago

I'm still looking into this. I tried this on an Ubuntu EC2 (18.04) and it detected the distribution fine. I'm not clear what could be different on a Raspberry Pi at the moment.

mckalexee commented 3 years ago

I'm still looking into this. I tried this on an Ubuntu EC2 (18.04) and it detected the distribution fine. I'm not clear what could be different on a Raspberry Pi at the moment.

If it's helpful we can pair and you can try it on the actual machine that's having an issue.

kdaily commented 3 years ago

Hi @mckalexee, thanks! I'm going to chat with my colleague who works on IoT devices to test there, and will let you know.

mckalexee commented 3 years ago

@kdaily I checked out the source directly and ran aws through it, and it does not have the same issue. It detects that's its Ubuntu just fine. The issue only seems to be with the compiled binary.

Although it does try to install 'ruby2.0' on Ubuntu 20.04, which isn't supported.

SushilShrestha commented 2 years ago

facing same issue, any new updates on this one ?

tim-finnigan commented 1 year ago

Although it does try to install 'ruby2.0' on Ubuntu 20.04, which isn't supported.

There is another open issue related to this: https://github.com/aws/aws-cli/issues/2976

tim-finnigan commented 3 months ago

The AWS CLI v2 documentation for installing on Linux notes:

We support the AWS CLI on 64-bit versions of recent distributions of CentOS, Fedora, Ubuntu, Amazon Linux 1, Amazon Linux 2, Amazon Linux 2023, and Linux ARM.

Ubuntu 18.04 is not a recent version, it was EOL last year: https://ubuntu.com/engage/still-running-ubuntu-1804-what-you-need-to-know. Please open a new issue if you're having trouble in a more recent version of Ubuntu.

github-actions[bot] commented 3 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.