I've been using aws cli on this laptop for a while to interact with s3 buckets. Suddenly, the tool has stopping printing any output whatsoever:
C:\>aws
C:\>aws --debug
C:\>aws --help
C:\>where aws
C:\Users\Andrew\AppData\Roaming\Python\Python37\Scripts\aws
C:\Users\Andrew\AppData\Roaming\Python\Python37\Scripts\aws.cmd
This is in an administrator command prompt, but it's the same in an admin powershell prompt. Windows version 10.0.18362 Build 18362 - I took the anniversary update a few weeks ago but am not sure if it's correlated or not.
aws cli on my other (Win 10, anniversary update) machine, using the same authentication, works fine.
I've tried straight-up uninstalling and reinstalling aws cli, but after the reinstall I can't even get it to print anything to authenticate me.
Any ideas? Any more information I can give you?
For anyone stumbling across this, it seems that certain v2 versions (2.2.7 in my case) fail silently if less isn't installed.
In these cases, setting AWS_PAGER to an empty string should fix the problem.
Later AWS CLI versions (e.g. 2.2.18) are decidedly more helpful:
aws sts get-caller-identity
Unable to redirect output to pager. Received the following error when opening pager:
[Errno 2] No such file or directory: 'less'
Learn more about configuring the output pager by running "aws help config-vars".
I also faced the same issue.
It was like:
$aws sts get-caller-identity
Unable to redirect output to pager. Received the following error when opening pager:
[Errno 2] No such file or directory: 'less'
Learn more about configuring the output pager by running "aws help config-vars".
And the solution is yum install less or apt-get install less. After that, it will show the proper status, like:
{
"UserId": "AIDASAMPLEUSERID",
"Account": "123456789012",
"Arn": "arn:aws:iam::123456789012:user/DevAdmin"
}
I had the same problem and for me the solution was to install version 2 of aws cli.
From the quick read it might have been caused by Python and aws version dependency mismatch.
An easy way to solve this issue is by piping the output to cat.
Take your command aws sts get-caller-identity and add | cat
$ aws sts get-caller-identity | cat =
For Ubuntu and Linux users
sudo apt-get update && sudo apt-get install -yy less
Related
I am a newbie to both AWS and MobaXterm. I am trying to use MobaXterm to manage AWS instances because it comes with bash.
I am following the commands as per https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html.
When I run the following command $ sudo ./aws/install, I get the following error:
Unable to start 'install': There is no application associated with the
given file name extension.
I did run chmod 777 to ensure that I am able to read/write/execute. Please see attached image.
I do know that I can use Windows CLI installer in command line. However, doing SSH to EC2 is a nightmare in Windows with all certificates. With MobaXterm (because of bash), it is very easy. So, my preference is to use MobaXterm instead of Windows command prompt.
Moreover, I don't want to directly install Ubuntu. Hence, I am looking for some guidance here. I'd appreciate any help.
I am hoping that I am not missing any package. Thanks for any help.
In order for AWS cli to run on MobaXterm, you will need to run the following commands in MobaXterm:
MobApt install python2-pip
pip2 install awscli
It will take some time for MobaXterm to complete steps 1 and 2. Also, AWS cli runs super slow in MobaXterm. You are better off using cmd.
This is the site that helped me ran AWS cli on MobaXterm.
https://majornetwork.net/2017/07/installing-aws-cli-on-cygwin/
I am trying to install aws elastic beanstalk cli on my mac machine. In the prerequisites it says that Python requires following:
Xcode openssl zlib readline
But, on running the command, I get:
-bash: Xcode: command not found
How am I suppose to install this?
An alternative solution is to run the aws cli inside a docker container. It will eliminate the possible issues which may be caused by the OS/library upgrading in the future.
I just installed the aws cli (via pip install awscli per Amazon's installation instructions) on macOS 10.12.5. The installation completed without issue. But when I run the app (e.g. $ aws help) it just hangs for about a minute and finally fails with:
$ aws help
ssh: connect to host xxx.xxx.xxx.xxx port 22: Operation timed out
I've tried running it from both Python 3.6.1 and 2.7.13 environments. The macOS firewall is disabled so I'm not blocking any outbound requests.
I'm not sure what else to try at this point.
That is very strange behaviour. The AWS CLI does not activate ssh.
I would suggest that you have another script called aws somewhere in your PATH that you previously used to connect to an Amazon EC2 instance, and that script is running rather than the AWS CLI.
Run this command to discover which one it is running:
$ which aws
/usr/local/bin/aws
In this case, mine is in $ /usr/local/bin/aws help, but yours is likely to be elsewhere.
To run the correct one, use:
$ /usr/local/bin/aws help
I am trying to use Cloud9 IDE on a server. I added the SSH key and once I try to SSH into the server the error message
Could not execute node.js on root#xxx.xxx.xxx.xxx
appears.
I have nodejs installed on the server, v0.10.25
You need to install the package "nodejs-legacy".
apt-get install nodejs-legacy
The SSH dialog allows you to set the path to the Node.js binary. That should solve your issue.
I found it is necessary to scroll down and click on the advanced tab. Then I entered /usr/bin/nodejs from my "which nodejs" output in my SSH session. This worked for me even though the documentation states AWS tries to do this by default. That left me in the AWS file work space on the server I ssh'ed into as desired.
nodejs was not installed on my EC2 instance, so I installed using the instructions from the following link, and it work perfectly. Tutorial: Setting Up Node.js on an Amazon EC2 Instance
sudo apt-get install nodejs worked for me
I am installing AWS Autoscaling tools on linux redhat, But unfortunately the as-cmd command is not working.
I am getting this error :
-bash: as-cmd: command not found
How to resolve the error ?
Any lead is appreciated
To Answer your question:
run below:
$ updatedb
$ locate as-cmd
This should provide you the path of the command like /usr/bin/as-cmd. Either you should use this complete path while running the command OR you need to update your $PATH variable to include this path. Google if you want to know how to update PATH variable.
Now, some suggestions:
You should not use as-cmd anymore. Please use AWS CLI. Here is the AWS CLI relevant autoscaling commands
The reason being, as-cmd is not maintained by Amazon anymore and all the old CLI features have been exported to AWS CLI. AWS CLI is a one stop shop for all the AWS Services unlike older CLIs where you had to install a separate CLI for individual services.
AWS CLI provides output in JSON format which is much more easier to parse.
BESIDES, You don't have to play with CLI for autoscaling. Now, you can do the same job via AWS Console.