ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 224 forks source link

IR kernel dies when running cell on headless servers #2456

Closed spied closed 7 years ago

spied commented 7 years ago

I have an issue with the irkernel in a notebook when using jupyterhub. It dies on execution of code.

conda info
Current conda install:

               platform : linux-64
          conda version : 4.3.22
       conda is private : False
      conda-env version : 4.3.22
    conda-build version : not installed
         python version : 3.6.1.final.0
       requests version : 2.14.2
       root environment : /opt/anaconda/anaconda3  (writable)
    default environment : /opt/anaconda/anaconda3
       envs directories : /opt/anaconda/anaconda3/envs
                          /root/.conda/envs
          package cache : /opt/anaconda/anaconda3/pkgs
                          /root/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : None
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.22 requests/2.14.2 CPython/3.6.1 Linux/4.4.0-31-generic debian/jessie/sid glibc/2.19
                UID:GID : 0:0
conda list --show-channel-urls
# packages in environment at /opt/anaconda/anaconda3:
#
_license                  1.1                      py36_1    defaults
alabaster                 0.7.10                   py36_0    defaults
alembic                   0.9.2                     <pip>
anaconda                  4.4.0               np112py36_0    defaults
anaconda-client           1.6.3                    py36_0    defaults
anaconda-navigator        1.6.2                    py36_0    defaults
anaconda-project          0.6.0                    py36_0    defaults
asn1crypto                0.22.0                   py36_0    defaults
astroid                   1.4.9                    py36_0    defaults
astropy                   1.3.2               np112py36_0    defaults
babel                     2.4.0                    py36_0    defaults
backports                 1.0                      py36_0    defaults
beautifulsoup4            4.6.0                    py36_0    defaults
bitarray                  0.8.1                    py36_0    defaults
blaze                     0.10.1                   py36_0    defaults
bleach                    1.5.0                    py36_0    defaults
bokeh                     0.12.5                   py36_1    defaults
boto                      2.46.1                   py36_0    defaults
bottleneck                1.2.1               np112py36_0    defaults
bzip2                     1.0.6                         3    defaults
cairo                     1.14.8                        0    defaults
cffi                      1.10.0                   py36_0    defaults
chardet                   3.0.3                    py36_0    defaults
click                     6.7                      py36_0    defaults
cloudpickle               0.2.2                    py36_0    defaults
clyent                    1.2.2                    py36_0    defaults
colorama                  0.3.9                    py36_0    defaults
conda                     4.3.22                   py36_0    defaults
conda-env                 2.6.0                         0    defaults
contextlib2               0.5.5                    py36_0    defaults
cryptography              1.8.1                    py36_0    defaults
curl                      7.52.1                        0    defaults
cycler                    0.10.0                   py36_0    defaults
cython                    0.25.2                   py36_0    defaults
cytoolz                   0.8.2                    py36_0    defaults
dask                      0.14.3                   py36_1    defaults
datashape                 0.5.4                    py36_0    defaults
dbus                      1.10.10                       0    defaults
decorator                 4.0.11                   py36_0    defaults
distributed               1.16.3                   py36_0    defaults
docutils                  0.13.1                   py36_0    defaults
entrypoints               0.2.2                    py36_1    defaults
et_xmlfile                1.0.1                    py36_0    defaults
expat                     2.1.0                         0    defaults
fastcache                 1.0.2                    py36_1    defaults
flask                     0.12.2                   py36_0    defaults
flask-cors                3.0.2                    py36_0    defaults
fontconfig                2.12.1                        3    defaults
freetype                  2.5.5                         2    defaults
get_terminal_size         1.0.0                    py36_0    defaults
gevent                    1.2.1                    py36_0    defaults
glib                      2.50.2                        1    defaults
gmp                       6.1.0                         0    defaults
greenlet                  0.4.12                   py36_0    defaults
gsl                       2.2.1                         0    defaults
gst-plugins-base          1.8.0                         0    defaults
gstreamer                 1.8.0                         0    defaults
h5py                      2.7.0               np112py36_0    defaults
harfbuzz                  0.9.39                        2    defaults
hdf5                      1.8.17                        1    defaults
heapdict                  1.0.0                    py36_1    defaults
html5lib                  0.999                    py36_0    defaults
icu                       54.1                          0    defaults
idna                      2.5                      py36_0    defaults
imagesize                 0.7.1                    py36_0    defaults
ipykernel                 4.6.1                    py36_0    defaults
ipython                   5.3.0                    py36_0    defaults
ipython_genutils          0.2.0                    py36_0    defaults
ipywidgets                6.0.0                    py36_0    defaults
isort                     4.2.5                    py36_0    defaults
itsdangerous              0.24                     py36_0    defaults
jbig                      2.1                           0    defaults
jdcal                     1.3                      py36_0    defaults
jedi                      0.10.2                   py36_2    defaults
jinja2                    2.9.6                    py36_0    defaults
jpeg                      9b                            0    defaults
jsonschema                2.6.0                    py36_0    defaults
jupyter                   1.0.0                    py36_3    defaults
jupyter_client            5.0.1                    py36_0    defaults
jupyter_console           5.1.0                    py36_0    defaults
jupyter_core              4.3.0                    py36_0    defaults
jupyterhub                0.7.2                     <pip>
lazy-object-proxy         1.2.2                    py36_0    defaults
libffi                    3.2.1                         1    defaults
libgcc                    4.8.5                         2    defaults
libgfortran               3.0.0                         1    defaults
libiconv                  1.14                          0    defaults
libpng                    1.6.27                        0    defaults
libsodium                 1.0.10                        0    defaults
libtiff                   4.0.6                         3    defaults
libtool                   2.4.2                         0    defaults
libxcb                    1.12                          1    defaults
libxml2                   2.9.4                         0    defaults
libxslt                   1.1.29                        0    defaults
llvmlite                  0.18.0                   py36_0    defaults
locket                    0.2.0                    py36_1    defaults
lxml                      3.7.3                    py36_0    defaults
Mako                      1.0.6                     <pip>
markupsafe                0.23                     py36_2    defaults
matplotlib                2.0.2               np112py36_0    defaults
mistune                   0.7.4                    py36_0    defaults
mkl                       2017.0.1                      0    defaults
mkl-service               1.1.2                    py36_3    defaults
mpmath                    0.19                     py36_1    defaults
msgpack-python            0.4.8                    py36_0    defaults
multipledispatch          0.4.9                    py36_0    defaults
navigator-updater         0.1.0                    py36_0    defaults
nbconvert                 5.1.1                    py36_0    defaults
nbformat                  4.3.0                    py36_0    defaults
ncurses                   5.9                          10    defaults
networkx                  1.11                     py36_0    defaults
nltk                      3.2.3                    py36_0    defaults
nose                      1.3.7                    py36_1    defaults
notebook                  5.0.0                    py36_0    defaults
numba                     0.33.0              np112py36_0    defaults
numexpr                   2.6.2               np112py36_0    defaults
numpy                     1.12.1                   py36_0    defaults
numpydoc                  0.6.0                    py36_0    defaults
odo                       0.5.0                    py36_1    defaults
olefile                   0.44                     py36_0    defaults
openpyxl                  2.4.7                    py36_0    defaults
openssl                   1.0.2l                        0    defaults
packaging                 16.8                     py36_0    defaults
pamela                    0.3.0                     <pip>
pandas                    0.20.1              np112py36_0    defaults
pandoc                    1.15.0.6                      0    defaults
pandocfilters             1.4.1                    py36_0    defaults
pango                     1.40.3                        1    defaults
partd                     0.3.8                    py36_0    defaults
path.py                   10.3.1                   py36_0    defaults
pathlib2                  2.2.1                    py36_0    defaults
patsy                     0.4.1                    py36_0    defaults
pcre                      8.39                          1    defaults
pep8                      1.7.0                    py36_0    defaults
pexpect                   4.2.1                    py36_0    defaults
pickleshare               0.7.4                    py36_0    defaults
pillow                    4.1.1                    py36_0    defaults
pip                       9.0.1                    py36_1    defaults
pixman                    0.34.0                        0    defaults
ply                       3.10                     py36_0    defaults
prompt_toolkit            1.0.14                   py36_0    defaults
psutil                    5.2.2                    py36_0    defaults
ptyprocess                0.5.1                    py36_0    defaults
py                        1.4.33                   py36_0    defaults
pycosat                   0.6.2                    py36_0    defaults
pycparser                 2.17                     py36_0    defaults
pycrypto                  2.6.1                    py36_6    defaults
pycurl                    7.43.0                   py36_2    defaults
pyflakes                  1.5.0                    py36_0    defaults
pygments                  2.2.0                    py36_0    defaults
pylint                    1.6.4                    py36_1    defaults
pyodbc                    4.0.16                   py36_0    defaults
pyopenssl                 17.0.0                   py36_0    defaults
pyparsing                 2.1.4                    py36_0    defaults
pyqt                      5.6.0                    py36_2    defaults
pytables                  3.3.0               np112py36_0    defaults
pytest                    3.0.7                    py36_0    defaults
python                    3.6.1                         2    defaults
python-dateutil           2.6.0                    py36_0    defaults
python-editor             1.0.3                     <pip>
pytz                      2017.2                   py36_0    defaults
pywavelets                0.5.2               np112py36_0    defaults
pyyaml                    3.12                     py36_0    defaults
pyzmq                     16.0.2                   py36_0    defaults
qt                        5.6.2                         4    defaults
qtawesome                 0.4.4                    py36_0    defaults
qtconsole                 4.3.0                    py36_0    defaults
qtpy                      1.2.1                    py36_0    defaults
r-assertthat              0.1                    r3.3.2_4    defaults
r-backports               1.0.4                  r3.3.2_0    defaults
r-base                    3.3.2                         1    defaults
r-base64enc               0.1_3                  r3.3.2_0    defaults
r-bh                      1.62.0_1               r3.3.2_0    defaults
r-bitops                  1.0_6                  r3.3.2_2    defaults
r-boot                    1.3_18                 r3.3.2_0    defaults
r-broom                   0.4.1                  r3.3.2_0    defaults
r-car                     2.1_4                  r3.3.2_0    defaults
r-caret                   6.0_73                 r3.3.2_0    defaults
r-catools                 1.17.1                 r3.3.2_2    defaults
r-class                   7.3_14                 r3.3.2_0    defaults
r-cluster                 2.0.5                  r3.3.2_0    defaults
r-codetools               0.2_15                 r3.3.2_0    defaults
r-colorspace              1.3_1                  r3.3.2_0    defaults
r-crayon                  1.3.2                  r3.3.2_0    defaults
r-curl                    2.3                    r3.3.2_0    defaults
r-data.table              1.10.0                 r3.3.2_0    defaults
r-dbi                     0.5_1                  r3.3.2_0    defaults
r-dichromat               2.0_0                  r3.3.2_2    defaults
r-digest                  0.6.10                 r3.3.2_0    defaults
r-dplyr                   0.5.0                  r3.3.2_0    defaults
r-essentials              1.5.2                  r3.3.2_0    r
r-evaluate                0.10                   r3.3.2_0    defaults
r-forcats                 0.1.1                  r3.3.2_0    defaults
r-foreach                 1.4.3                  r3.3.2_0    defaults
r-foreign                 0.8_67                 r3.3.2_0    defaults
r-formatr                 1.4                    r3.3.2_0    defaults
r-ggplot2                 2.2.0                  r3.3.2_0    defaults
r-gistr                   0.3.6                  r3.3.2_0    defaults
r-glmnet                  2.0_5                  r3.3.2_0    defaults
r-gtable                  0.2.0                  r3.3.2_0    defaults
r-haven                   1.0.0                  r3.3.2_0    defaults
r-hexbin                  1.27.1                 r3.3.2_0    defaults
r-highr                   0.6                    r3.3.2_0    defaults
r-hms                     0.3                    r3.3.2_0    defaults
r-htmltools               0.3.5                  r3.3.2_0    defaults
r-htmlwidgets             0.8                    r3.3.2_0    defaults
r-httpuv                  1.3.3                  r3.3.2_0    defaults
r-httr                    1.2.1                  r3.3.2_0    defaults
r-irdisplay               0.4.4                  r3.3.2_0    defaults
r-irkernel                0.7.1                  r3.3.2_0    defaults
r-iterators               1.0.8                  r3.3.2_0    defaults
r-jsonlite                1.1                    r3.3.2_0    defaults
r-kernsmooth              2.23_15                r3.3.2_0    defaults
r-knitr                   1.15.1                 r3.3.2_0    defaults
r-labeling                0.3                    r3.3.2_2    defaults
r-lattice                 0.20_34                r3.3.2_0    defaults
r-lazyeval                0.2.0                  r3.3.2_0    defaults
r-lme4                    1.1_12                 r3.3.2_0    defaults
r-lubridate               1.6.0                  r3.3.2_0    defaults
r-magrittr                1.5                    r3.3.2_2    defaults
r-maps                    3.1.1                  r3.3.2_0    defaults
r-markdown                0.7.7                  r3.3.2_2    defaults
r-mass                    7.3_45                 r3.3.2_0    defaults
r-matrix                  1.2_7.1                r3.3.2_0    defaults
r-matrixmodels            0.4_1                  r3.3.2_0    defaults
r-mgcv                    1.8_16                 r3.3.2_0    defaults
r-mime                    0.5                    r3.3.2_0    defaults
r-minqa                   1.2.4                  r3.3.2_2    defaults
r-mnormt                  1.5_5                  r3.3.2_0    defaults
r-modelmetrics            1.1.0                  r3.3.2_0    defaults
r-modelr                  0.1.0                  r3.3.2_0    defaults
r-munsell                 0.4.3                  r3.3.2_0    defaults
r-nlme                    3.1_128                r3.3.2_0    defaults
r-nloptr                  1.0.4                  r3.3.2_2    defaults
r-nnet                    7.3_12                 r3.3.2_0    defaults
r-openssl                 0.9.5                  r3.3.2_0    defaults
r-pbdzmq                  0.2_4                  r3.3.2_0    defaults
r-pbkrtest                0.4_6                  r3.3.2_0    defaults
r-plyr                    1.8.4                  r3.3.2_0    defaults
r-pryr                    0.1.2                  r3.3.2_0    defaults
r-psych                   1.6.9                  r3.3.2_0    defaults
r-purrr                   0.2.2                  r3.3.2_0    defaults
r-quantmod                0.4_7                  r3.3.2_0    defaults
r-quantreg                5.29                   r3.3.2_0    defaults
r-r6                      2.2.0                  r3.3.2_0    defaults
r-randomforest            4.6_12                 r3.3.2_0    defaults
r-rbokeh                  0.5.0                  r3.3.2_0    defaults
r-rcolorbrewer            1.1_2                  r3.3.2_3    defaults
r-rcpp                    0.12.8                 r3.3.2_0    defaults
r-rcppeigen               0.3.2.9.0              r3.3.2_0    defaults
r-readr                   1.0.0                  r3.3.2_0    defaults
r-readxl                  0.1.1                  r3.3.2_0    defaults
r-recommended             3.3.2                  r3.3.2_0    defaults
r-repr                    0.10                   r3.3.2_0    defaults
r-reshape2                1.4.2                  r3.3.2_0    defaults
r-rmarkdown               1.3                    r3.3.2_0    defaults
r-rpart                   4.1_10                 r3.3.2_0    defaults
r-rprojroot               1.1                    r3.3.2_0    defaults
r-rvest                   0.3.2                  r3.3.2_0    defaults
r-scales                  0.4.1                  r3.3.2_0    defaults
r-selectr                 0.3_0                  r3.3.2_0    defaults
r-shiny                   0.14.2                 r3.3.2_0    defaults
r-sourcetools             0.1.5                  r3.3.2_0    defaults
r-sparsem                 1.74                   r3.3.2_0    defaults
r-spatial                 7.3_11                 r3.3.2_0    defaults
r-stringi                 1.1.2                  r3.3.2_0    defaults
r-stringr                 1.1.0                  r3.3.2_0    defaults
r-survival                2.40_1                 r3.3.2_0    defaults
r-tibble                  1.2                    r3.3.2_0    defaults
r-tidyr                   0.6.0                  r3.3.2_0    defaults
r-tidyverse               1.0.0                  r3.3.2_0    defaults
r-ttr                     0.23_1                 r3.3.2_0    defaults
r-uuid                    0.1_2                  r3.3.2_0    defaults
r-xml2                    1.0.0                  r3.3.2_0    defaults
r-xtable                  1.8_2                  r3.3.2_0    defaults
r-xts                     0.9_7                  r3.3.2_2    defaults
r-yaml                    2.1.14                 r3.3.2_0    defaults
r-zoo                     1.7_13                 r3.3.2_0    defaults
readline                  6.2                           2    defaults
requests                  2.14.2                   py36_0    defaults
rope                      0.9.4                    py36_1    defaults
ruamel_yaml               0.11.14                  py36_1    defaults
scikit-image              0.13.0              np112py36_0    defaults
scikit-learn              0.18.1              np112py36_1    defaults
scipy                     0.19.0              np112py36_0    defaults
seaborn                   0.7.1                    py36_0    defaults
setuptools                27.2.0                   py36_0    defaults
simplegeneric             0.8.1                    py36_1    defaults
singledispatch            3.4.0.3                  py36_0    defaults
sip                       4.18                     py36_0    defaults
six                       1.10.0                   py36_0    defaults
snowballstemmer           1.2.1                    py36_0    defaults
sortedcollections         0.5.3                    py36_0    defaults
sortedcontainers          1.5.7                    py36_0    defaults
sphinx                    1.5.6                    py36_0    defaults
spyder                    3.1.4                    py36_0    defaults
sqlalchemy                1.1.9                    py36_0    defaults
sqlite                    3.13.0                        0    defaults
statsmodels               0.8.0               np112py36_0    defaults
sympy                     1.0                      py36_0    defaults
tblib                     1.3.2                    py36_0    defaults
terminado                 0.6                      py36_0    defaults
testpath                  0.3                      py36_0    defaults
tk                        8.5.18                        0    defaults
toolz                     0.8.2                    py36_0    defaults
tornado                   4.5.1                    py36_0    defaults
traitlets                 4.3.2                    py36_0    defaults
unicodecsv                0.14.1                   py36_0    defaults
unixodbc                  2.3.4                         0    defaults
wcwidth                   0.1.7                    py36_0    defaults
werkzeug                  0.12.2                   py36_0    defaults
wheel                     0.29.0                   py36_0    defaults
widgetsnbextension        2.0.0                    py36_0    defaults
wrapt                     1.10.10                  py36_0    defaults
xlrd                      1.0.0                    py36_0    defaults
xlsxwriter                0.9.6                    py36_0    defaults
xlwt                      1.2.0                    py36_0    defaults
xz                        5.2.2                         1    defaults
yaml                      0.1.6                         0    defaults
zeromq                    4.1.5                         0    defaults
zict                      0.1.2                    py36_0    defaults
zlib                      1.2.8                         3    defaults

I have check the logs and the only obvious r related mention is:

[I 2017-06-21 13:06:01.990 gillespied multikernelmanager:127] Kernel shutdown: d254c8f4-5da6-4337-85cf-394b238aa117
[I 2017-06-21 13:06:02.010 gillespied kernelmanager:98] Kernel started: 2de9537b-9643-4dbb-98fd-7d011897b253
[I 2017-06-21 13:06:02.419 gillespied handlers:193] Adapting to protocol v5.0 for kernel 2de9537b-9643-4dbb-98fd-7d011897b253
Error in dev.control(displaylist = "enable") :
  dev.control() called without an open graphics device
Calls: <Anonymous> ... tryCatch -> tryCatchList -> evaluate -> dev.control
In addition: Warning messages:
1: In ok_device(filename, ...) :
  unable to load shared object '/opt/anaconda/anaconda3/lib/R/library/grDevices/libs//cairo.so':
  libXrender.so.1: cannot open shared object file: No such file or directory
2: In ok_device(filename, ...) : failed to load cairo DLL
Execution halted
[I 2017-06-21 13:06:17.012 gillespied restarter:103] KernelRestarter: restarting kernel (1/5)
WARNING:root:kernel 2de9537b-9643-4dbb-98fd-7d011897b253 restarted

I have checked and cairo.so is in that location.

ccordoba12 commented 7 years ago

The problem is not with cairo, it's with libXrender.so.1. Do you have Xorg installed in your system?

spied commented 7 years ago

No, Jupyterhub is installed on a headless machine. It might be worth mentioning that the Python 3 kernel is working fine.

ccordoba12 commented 7 years ago

Well, it's clear (from your error message) that you need to have Xorg installed to run IRKernel.

However, I'm pinging @mingwandroid and @flying-sheep to get confirmation about it.

mingwandroid commented 7 years ago

For R/cairo Xorg is needed, it's dumb not to separate needing an x display from needing to be able to handle some surface types. This is an upstream R issue. Python has nothing to do with it.

ccordoba12 commented 7 years ago

Ok, thanks for the confirmation @mingwandroid. Closing then.

spied commented 7 years ago

Thanks for the help in fixing this. I installed Xorg and all is well.

ccordoba12 commented 7 years ago

Great to know it!