Closed mtougeron closed 8 years ago
Interesting. I think for this case we can either have a better error message or fall back to or just print it all out without a pager.
Hi, this is still reproducible even though the issue has been closed.
To reproduce:
docker pull python:2.7
# ...
docker run -ti python:2.7 /bin/bash
root@some_container_id # pip install awscli
# ...
aws help
By the looks of it, it seems groff
is a hard dependency needed by aws
.
Which leads me to a question: shouldn't the tool take care of this?
More info:
aws-cli/1.11.8 Python/2.7.12 Linux/4.4.24-boot2docker botocore/1.4.65
why is it trying to run a pager? surely the unix was is to pip the output to a pager (a pager of our choice) if we want one. Or even to look at $PAGER and use that?
I just installed awscli and got the groff error so this issue isn't fixed:
root@27615407f778:/app# aws help
Could not find executable named "groff"
note that installing groff brings a ton more packages that I can't see why awscli would need:
The following extra packages will be installed:
dbus fonts-droid ghostscript groff-base gsfonts libavahi-client3 libavahi-common-data libavahi-common3 libcap-ng0 libcups2 libcupsfilters1 libcupsimage2 libdbus-1-3 libgs9
libgs9-common libijs-0.35 libjbig2dec0 libnetpbm10 libpaper-utils libpaper1 libxaw7 libxmu6 netpbm poppler-data psutils
A headless server now installs printing libraries when it will never connect to a printer? Also ghostscript? why?
I also have the same problem installing the aws-cli in an amazonlinux container using these commands:
docker pull amazonlinux
docker run -it amazonlinux:latest /bin/bash
yum -y install unzip
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Then as I run aws
I see the same error related to groff
bash-4.2# aws --version
aws-cli/1.11.35 Python/2.7.12 Linux/4.8.15-moby botocore/1.4.92
bash-4.2# aws help
Could not find executable named "groff"
Having this problem as well while running on dockerized debian arm linux on a headless raspberry pi (ssh console).
Installed groff (less was already present) and gave aws help
another try... and got a less
screen of emptyness. So something is still broken. Hmm...
Ok, since man
was missing but also uses less
, I installed it and found that man grep
for instance also results in a blank field of text. I suspect something isn't working with nroff/groff in my environment.
root@raspberrypi-bbe731b:/# nroff -man -Tascii /usr/share/man/man1/grep.1.gz
groff: can't find `DESC' file
groff:fatal error: invalid device `ascii'
After reviewing the archaeological records of ancient unix mailing lists indexed by google, I discovered what groff was trying to tell me - it couldn't find the needed output "device" files (ascii and utf8 in this case) nor their descriptions (DESC
files). These should be available, logically enough, at /usr/share/groff/current/font/
...
root@raspberrypi-bbe731b:/# ls -la /usr/share/groff/
total 0
drwxr-xr-x 1 root root 0 Jan 6 18:16 .
drwxr-xr-x 1 root root 230 Jan 6 18:16 ..
Why did apt-get leave this directory empty? Because the extra-slim base image of raspian I'm using asks dpkg to skip installing any of groff's shared files.
After commenting-out the line path-exclude /usr/share/groff/*
from /etc/dpkg/dpkg.cfg.d/01_nodoc
root@raspberrypi-bbe731b:/usr/share/groff# apt-get install --reinstall groff-base
Reading package lists... Done
...
Setting up groff-base (1.22.2-8) ...
root@raspberrypi-bbe731b:/usr/share/groff# ls current/font/
devascii devlatin1 devps devutf8
root@raspberrypi-bbe731b:/app# man cat
CAT(1) User Commands CAT(1)
NAME
cat - concatenate files and print on the standard output
------
root@raspberrypi-bbe731b:/app# aws help
AWS() AWS()
NAME
aws -
DESCRIPTION
The AWS Command Line Interface is a unified tool to manage your AWS
services.
YAY.
In conclusion, aws help
initially didn't work for two reasons:
pip install aws
had complained)Could not find executable named "groff"
The end of 2018 - AWS CLI still doesn't work out of box...
For alpine
linux run apk add groff less
.
My working Dockerfile - any further suggestions?
FROM python:3.6.7-jessie
RUN apt-get update -y
RUN apt-get install groff -y
RUN pip install awscli
The dependency on groff
adds CRAZY large amount of storage requirements :(
We also base on a python Docker (slim) version, and when we install groff
it adds nearly 160MB!
(app) root@7548cfaf4acd:/app# apt install groff less
(snip)
Need to get 47.8 MB of archives.
After this operation, 158 MB of additional disk space will be used.
Do you want to continue? [Y/n]
And a bunch of lbirary deps are missing from debian archives
Unable to fetch some archives, maybe run apt-get
libgs9-common, libglib2.0-0, libgs9, ghostscript, libdbus-1-3, dbus, libcups2, libcupsimage2, libglib2.0-data, xdg-user-dirs, ...
All these packages seem highly unlikely to actually be required.
So far I don't see any formal requirement to add groff
as a dependency (which is good if it will take 160MB+). Maybe awscli needs to move away from that dependency instead.
I have this issue on cli v2:
root@8cb4555a5708:~# aws2 lambda update-function-code --function-name FarmFoods2_InboundEvent_NewOrder --s3-bucket farmfoods2 --s3-key build-pipeline/lambda_function.zip --region us-east-1
[Errno 2] No such file or directory: 'less': 'less'
Version:
root@8cb4555a5708:~# aws2 --version
aws-cli/2.0.0dev3 Python/3.7.3 Linux/4.14.154-boot2docker botocore/2.0.0dev2
Installing less (apt-get install less
) fixes the issue.
Error message is a bit cryptic, should be fixed imo.
aws help
commands appear broken completely in python:3.8-slim
, even with groff
, groff-base
, and less
packages installed. Symptoms are similar to @100ideas comment here
Reproduced with the following Dockerfile
:
FROM python:3.8-slim
ENV AWSCLI_VERSION >=1.11,<1.12
ENV AWS_DEFAULT_REGION us-east-1
# Install groff + less so `help` works
RUN apt-get update && apt-get install -y groff groff-base less && apt-get install -y wget && apt-get clean
# Install awscli
RUN pip install "awscli${AWSCLI_VERSION}"
Add the following to the Dockerfile
, before installing groff
, groff-base
, and less
:
RUN sed -i'' -e '/^path-exclude \/usr\/share\/groff\/\*/d' /etc/dpkg/dpkg.cfg.d/docker
Just in case someone else runs into this. I also see this with the new SDK (on Ubuntu 16.04 docker image).
:/# aws help
Could not find executable named "groff"
:/# aws --version
aws-cli/2.0.46 Python/3.7.3 Linux/4.14.186-146.268.amzn2.x86_64 exe/x86_64.ubuntu.16
Install groff fixes it.
apt install groff
.
I also saw this just now when running aws help
in a debian:buster
Docker build image. I don't need to run the help command in the container, so it's not a big deal for me, unless other commands also depend on it (I hope not).
For the people installing groff: You should probably use --no-install-recommends
to avoid installing all the ghostscript, imagemagick, fonts, and printer related stuff that isn't needed at all.
Without recommended packages (only groff
, groff-base
, and libuchardet0
would be installed in this case):
root@405a8ff32f21:/opt/atlassian/bitbucketci/agent/build# apt-get --no-install-recommends --dry-run install groff
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
groff-base libuchardet0
Recommended packages:
ghostscript imagemagick libpaper1 netpbm psutils
The following NEW packages will be installed:
groff groff-base libuchardet0
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
...
Versus with recommendations, that's where the 160 MB are coming from:
root@405a8ff32f21:/opt/atlassian/bitbucketci/agent/build# apt-get --dry-run install groff
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
fonts-droid-fallback fonts-noto-mono ghostscript groff-base gsfonts imagemagick imagemagick-6-common imagemagick-6.q16 libcupsfilters1
libcupsimage2 libde265-0 libdjvulibre-text libdjvulibre21 libfftw3-double3 libgs9 libgs9-common libheif1 libijs-0.35 libilmbase23 libjbig2dec0
libjxr-tools libjxr0 liblqr-1-0 libltdl7 libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra libmagickwand-6.q16-6 libnetpbm10 libnuma1
libopenexr23 libopenjp2-7 libpaper-utils libpaper1 libuchardet0 libwebpmux3 libwmf0.2-7 libx265-165 netpbm poppler-data psutils
Suggested packages:
fonts-noto ghostscript-x imagemagick-doc autotrace cups-bsd | lpr | lprng enscript ffmpeg gimp gnuplot grads graphviz hp2xx html2ps libwmf-bin
mplayer povray radiance sane-utils texlive-base-bin transfig ufraw-batch xdg-utils libfftw3-bin libfftw3-dev inkscape libwmf0.2-7-gtk
poppler-utils fonts-japanese-mincho | fonts-ipafont-mincho fonts-japanese-gothic | fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming
fonts-nanum
The following NEW packages will be installed:
fonts-droid-fallback fonts-noto-mono ghostscript groff groff-base gsfonts imagemagick imagemagick-6-common imagemagick-6.q16 libcupsfilters1
libcupsimage2 libde265-0 libdjvulibre-text libdjvulibre21 libfftw3-double3 libgs9 libgs9-common libheif1 libijs-0.35 libilmbase23 libjbig2dec0
libjxr-tools libjxr0 liblqr-1-0 libltdl7 libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra libmagickwand-6.q16-6 libnetpbm10 libnuma1
libopenexr23 libopenjp2-7 libpaper-utils libpaper1 libuchardet0 libwebpmux3 libwmf0.2-7 libx265-165 netpbm poppler-data psutils
0 upgraded, 41 newly installed, 0 to remove and 0 not upgraded.
...
Fixed this by upgrading the CLI version
On Mac, upgrading cli with pip install awscli --upgrade
wasn't enough.
Also had to install the dependency explicitly with brew install groff
aws-cli/2.8.8 Python/3.10.8 Darwin/22.1.0 source/x86_64 prompt/off
still getting Could not find executable named "groff"
On Mac, upgrading cli with
pip install awscli --upgrade
wasn't enough. Also had to install the dependency explicitly withbrew install groff
sadly that this works, you have to install groff and its dependencies
I ran below commands and it worked for me.
sudo apt-get update -y
sudo apt-get install groff -y
On MacOS, I didn't need to install groff after seeing this error. Here's what I did:
command -v aws
In my case this was pointing at an older version of python:
❱ command -v aws
/Library/Frameworks/Python.framework/Versions/3.10/bin/aws
# Setting PATH for Python 3.10
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.10/bin:${PATH}"
export PATH
pip install awscli
❱ command -v aws
/Library/Frameworks/Python.framework/Versions/3.12/bin/aws
❱ aws eks update-kubeconfig help
I did not like the brew install groff
as it currently installs at least 24 packages (as seen by brew deps groff
).
Here's the commit in which this was fixed. Apparently mandoc
is currently used as a fallback, and this is only an issue in versions older than 1.27.6 or 2.8.11.
I ran into a case where the awscli help commands failed without
groff
&less
installed. The error message for not havinggroff
is pretty straight forward. But the error message aboutless
being missing just says[Errno 2] No such file or directory
.awscli version:
Running help for the first time:
So I installed
groff
:Then ran help again:
On another machine I found the
--debug
flag so I ranaws help
with that and found saw that it was trying to callless
at the end of the output.So I installed
less
:Ran help again and it worked:
(yes, I know that not having
less
installed is pretty rare but I thought I should report the bug anyway)