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

jupyter lab build fails with shutil [Errno 5] on templates #5233

Closed
katosh opened this issue Aug 28, 2018 · 14 comments · Fixed by #5237
Closed

jupyter lab build fails with shutil [Errno 5] on templates #5233

katosh opened this issue Aug 28, 2018 · 14 comments · Fixed by #5237

Comments

@katosh
Copy link
Contributor

@katosh katosh commented Aug 28, 2018

I have trouble Instilling extensions. Whether I run jupyter labextension install @jupyter-widgets/jupyterlab-manager --debug or just jupyter lab build --debug I get

[LabBuildApp] Searching ['/homes/olymp/dominik.otto/Software/python-flint', '/homes/olymp/dominik.otto/.jupyter', '/homes/olymp/dominik.otto/Envs/noteEnv2/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[LabBuildApp] Looking for jupyter_config in /etc/jupyter
[LabBuildApp] Looking for jupyter_config in /usr/local/etc/jupyter
[LabBuildApp] Looking for jupyter_config in /homes/olymp/dominik.otto/Envs/noteEnv2/etc/jupyter                        
[LabBuildApp] Looking for jupyter_config in /homes/olymp/dominik.otto/.jupyter
[LabBuildApp] Looking for jupyter_config in /homes/olymp/dominik.otto/Software/python-flint
[LabBuildApp] Looking for JupyterLab_config in /etc/jupyter                                                                        
[LabBuildApp] Looking for JupyterLab_config in /usr/local/etc/jupyter
[LabBuildApp] Looking for JupyterLab_config in /homes/olymp/dominik.otto/Envs/noteEnv2/etc/jupyter
[LabBuildApp] Looking for JupyterLab_config in /homes/olymp/dominik.otto/.jupyter              
[LabBuildApp] Looking for JupyterLab_config in /homes/olymp/dominik.otto/Software/python-flint
[LabBuildApp] JupyterLab 0.34.4
[LabBuildApp] Building in /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab                                                                                                                                                                                             Traceback (most recent call last):                                                                                                                                                                                                                                                File "/homes/olymp/dominik.otto/Envs/noteEnv2/bin/jupyter-lab", line 11, in <module>                                                                                                                                                                                              sys.exit(main())                                                                                                                                                                                                                                                              File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyter_core/application.py", line 266, in launch_instance                                                                                                                                         
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()                      
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/notebook/notebookapp.py", line 1571, in start                                                                                                                                                           super(NotebookApp, self).start()                                                                                                                                                                                                                                              File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyter_core/application.py", line 255, in start                                                                                                                                                        self.subapp.start()                                                                                                                                                                                                                                                           File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/labapp.py", line 67, in start                                                                                                                                                           
    command=command, logger=self.log)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/commands.py", line 270, in build
    command=command, clean_staging=clean_staging)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/commands.py", line 441, in build
    clean=clean_staging
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/commands.py", line 880, in _populate_staging
    shutil.copytree(pjoin(HERE, 'staging', 'templates'), templates)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/shutil.py", line 353, in copytree
    raise Error(errors)
shutil.Error: [('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/error.html', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/error.html', "[Errno 5] Input/output error: '/homes/olymp/dominik.ot
to/Envs/noteEnv2/share/jupyter/lab/staging/templates/error.html'"), ('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/template.html', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/template.htm
l', "[Errno 5] Input/output error: '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/template.html'"), ('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/partial.html', '/homes/olymp/dominik.otto/E
nvs/noteEnv2/share/jupyter/lab/staging/templates/partial.html', "[Errno 5] Input/output error: '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/partial.html'"), ('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/st
aging/templates', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates', "[Errno 5] Input/output error: '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates'")]

As the paths suggest, I run jupyter in a virtual env. Here are some specs:

$ python --version
Python 3.5.2
$ node --version
v8.9.4
$ npm --version
5.6.0
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial
$ jupyter labextension list                                       
JupyterLab v0.34.4
Known labextensions:
   app dir: /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v0.37.2  enabled  OK*

   local extensions:
        @jupyter-widgets/jupyterlab-manager: /homes/olymp/dominik.otto/Software/ipywidgets/packages/jupyterlab-manager

Build recommended, please run `jupyter lab build`:
    @jupyter-widgets/jupyterlab-manager needs to be included in build
$ python -m pip freeze
absl-py==0.2.2      
astor==0.6.2          
backcall==0.1.0
bleach==1.5.0
brewer2mpl==1.4.1
certifi==2018.4.16
cffi==1.11.5   
chardet==3.0.4 
click==6.7  
click-plugins==1.0.3
cligj==0.4.0    
cvxpy==1.0.6   
cycler==0.10.0        
Cython==0.28.3     
decorator==4.3.0   
descartes==1.1.0
dill==0.2.8.2
Django==2.0.6   
ecos==2.0.5     
entrypoints==0.2.3
fastcache==1.0.2    
Fiona==1.7.12       
future==0.16.0
gast==0.2.0
geopandas==0.3.0
ggplot==0.11.5   
grpcio==1.12.1      
h5py==2.7.1         
html5lib==0.9999999
idna==2.6  
ipykernel==4.8.2
ipython==6.3.1    
ipython-genutils==0.2.0
ipywidgets==7.2.1 
jedi==0.12.0     
Jinja2==2.10    
joblib==0.11    
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.3
jupyter-console==5.2.0
jupyter-core==4.4.0
jupyterlab==0.34.4
jupyterlab-launcher==0.13.1
jupyterlab-widgets==0.6.15
kiwisolver==1.0.1
Mako==1.0.7   
Markdown==2.6.11   
MarkupSafe==1.0 
matplotlib==2.2.2
mistune==0.8.3
mizani==0.4.6
mpmath==1.0.0
multiprocess==0.70.6.1
munch==2.3.2
nbconvert==5.3.1
nbformat==4.4.0
nbtop==0.5.1
ncephes==1.0.40
notebook==5.4.1
numexpr==2.6.8
numpy==1.14.3
osqp==0.4.0
palettable==3.1.0
pandas==0.21.1
pandocfilters==1.4.2
parso==0.2.0
patsy==0.5.0
pep8==1.7.1
pexpect==4.5.0
pickleshare==0.7.4
plotnine==0.4.0
progressbar2==3.38.0
prompt-toolkit==1.0.15
protobuf==3.6.0
psutil==5.4.7
ptyprocess==0.5.2
pycparser==2.18
pyflakes==2.0.0
Pygments==2.2.0
pygpu==0.7.6
pymc3==3.5
pyparsing==2.2.0
pyproj==1.9.5.1
python-dateutil==2.7.2
python-flint==0.1.2
python-utils==2.3.0
pytz==2018.4
pyzmq==17.0.0
qtconsole==4.3.1
requests==2.18.4
rpy2==2.9.3
scikit-learn==0.19.1
scikit-survival==0.5
scipy==1.0.1
scs==2.0.2
seaborn==0.8.1
Send2Trash==1.5.0
Shapely==1.6.4.post1
simplegeneric==0.8.1
simplejson==3.16.0
six==1.11.0
sklearn==0.0
statsmodels==0.8.0
sympy==1.1.1
tensorboard==1.8.0
tensorflow==1.8.0
termcolor==1.1.0
terminado==0.8.1
testpath==0.3.1
Theano==1.0.2
toolz==0.9.0
tornado==5.0.2
tqdm==4.23.1
traitlets==4.3.2
tyre-hug==0.1
tzlocal==1.5.1
urllib3==1.22
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
widgetsnbextension==3.2.1

I also checked on the template folder that shutil failed on e.g.

$ ls -l /homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/
total 14
-rw-r----- 1 dominik.otto aGroup 788 Aug 28 23:35 error.html
-rw-r----- 1 dominik.otto aGroup 503 Aug 28 23:35 partial.html
-rw-r----- 1 dominik.otto aGroup 933 Aug 28 23:35 template.html

The jupyter lab --dev-mode also fails:

[I 00:09:58.894 LabApp] The port 8899 is already in use, trying another port.
[I 00:09:58.969 LabApp] JupyterLab extension loaded from /homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab
[I 00:09:58.969 LabApp] JupyterLab application directory is /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab
[I 00:09:58.969 LabApp] Running JupyterLab in dev mode
[I 00:09:58.980 LabApp] > node /homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/yarn.js build:webpack
[W 00:09:58.987 LabApp] Error loading server extension jupyterlab
    Traceback (most recent call last):
      File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/notebook/notebookapp.py", line 1454, in init_server_extensions
        func(self)
      File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/extension.py", line 116, in load_jupyter_server_extension
        ensure_dev(logger)
      File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/commands.py", line 107, in ensure_dev
        logger=logger)
      File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab_launcher/process.py", line 106, in __init__
        self.proc = self._create_process(cwd=cwd, env=env, **kwargs)
      File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab_launcher/process.py", line 169, in _create_process
        proc = subprocess.Popen(cmd, **kwargs)
      File "/mnt/fhgfs_ribdata/easybuild/16.04/software/Python/3.5.2-foss-2016b/lib/python3.5/subprocess.py", line 947, in __init__
        restore_signals, start_new_session)
      File "/mnt/fhgfs_ribdata/easybuild/16.04/software/Python/3.5.2-foss-2016b/lib/python3.5/subprocess.py", line 1551, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: '/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/packages/theme-light-extension'
[W 00:09:58.998 LabApp] JupyterLab server extension not enabled, manually loading...
[I 00:09:59.000 LabApp] JupyterLab extension loaded from /homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab
[I 00:09:59.000 LabApp] JupyterLab application directory is /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab
[I 00:09:59.000 LabApp] Running JupyterLab in dev mode
[I 00:09:59.001 LabApp] > node /homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/yarn.js build:webpack
Traceback (most recent call last):
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/notebook/notebookapp.py", line 1510, in initialize
    self.init_server_extensions()
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/labapp.py", line 216, in init_server_extensions
    load_jupyter_server_extension(self)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/extension.py", line 116, in load_jupyter_server_extension
    ensure_dev(logger)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/commands.py", line 107, in ensure_dev
    logger=logger)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab_launcher/process.py", line 106, in __init__
    self.proc = self._create_process(cwd=cwd, env=env, **kwargs)
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab_launcher/process.py", line 169, in _create_process
    proc = subprocess.Popen(cmd, **kwargs)
  File "/mnt/fhgfs_ribdata/easybuild/16.04/software/Python/3.5.2-foss-2016b/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/mnt/fhgfs_ribdata/easybuild/16.04/software/Python/3.5.2-foss-2016b/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/packages/theme-light-extension'

This error can be understood since there is no folder packages in /homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages.

After first encountering the problem with jupyter lab build, I reinstalled jupyter lab with

python -m pip install "git+git://github.com/jupyterlab/jupyterlab.git#egg=jupyterlab"

What am I doing wrong?

@blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 29, 2018

Hi @katosh, I've never seen [Errno 5] Input/output error before. Are you able to manually create a file in /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates?

@katosh
Copy link
Contributor Author

@katosh katosh commented Aug 29, 2018

Yes I am:

$ touch /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/testfile
$ ls /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/
error.html  partial.html  template.html  testfile

@blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 29, 2018

Hmm, does shutil.rmtree('/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/') give an error?

@katosh
Copy link
Contributor Author

@katosh katosh commented Aug 29, 2018

Nope, that works just fine:

$ python
>>> import shutil
>>> shutil.rmtree('/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/')
>>> exit()
$ ls /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/
index.js  webpack.config.js  webpack.prod.config.js  yarn.js

@blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 29, 2018

Now does shutil.copytree('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/') throw the Errno 5?

@katosh
Copy link
Contributor Author

@katosh katosh commented Aug 29, 2018

Ok, that does produce the error, even know it does its job:

$ ls /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/
index.js  webpack.config.js  webpack.prod.config.js  yarn.js
$ python
Python 3.5.2 (default, Jan  5 2018, 14:10:32)
[GCC 5.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.copytree('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/shutil.py", line 353, in copytree
    raise Error(errors)
shutil.Error: [('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/error.html', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/error.html', "[Errno 5] Input/output error: '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/error.html'"), ('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/template.html', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/template.html', "[Errno 5] Input/output error: '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/template.html'"), ('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/partial.html', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/partial.html', "[Errno 5] Input/output error: '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/partial.html'"), ('/homes/olymp/dominik.otto/Envs/noteEnv2/lib/python3.5/site-packages/jupyterlab/staging/templates/', '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/', "[Errno 5] Input/output error: '/homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/'")]
>>> exit()
$ ls /homes/olymp/dominik.otto/Envs/noteEnv2/share/jupyter/lab/staging/templates/
error.html  partial.html  template.html

Is this a problem with my file system?

@katosh
Copy link
Contributor Author

@katosh katosh commented Aug 29, 2018

I can confirm: shutil fails on any folder on the same partition but copies successfully on a different drive. It also works to copy between the two in both direction but not within my home directory. I guess this problem is not related to jupyterlab. Thanks @blink1073 for the help!

@katosh katosh closed this Aug 29, 2018
@blink1073 blink1073 reopened this Aug 29, 2018
@blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 29, 2018

Does it copy the files but still kick out an error code?

@blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 29, 2018

If so we can handle that similar to how we handled another shutil problem:

if '[Errno 22]' not in str(error) or not osp.exists(templates):

@katosh
Copy link
Contributor Author

@katosh katosh commented Aug 29, 2018

Yes, the files are copied correctly. Maybe it is a check that fails.

@katosh
Copy link
Contributor Author

@katosh katosh commented Aug 29, 2018

The error seems related, since /homes/olymp is a nfs4 mount.

@blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 29, 2018

Not surprising. Want to make a PR?

@katosh
Copy link
Contributor Author

@katosh katosh commented Aug 29, 2018

Sure, working on it.

@blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 29, 2018

Thanks!

katosh added a commit to katosh/jupyterlab that referenced this issue Aug 29, 2018
shutil would throw an error [Errno 5] after copying from nfs4 to nfs4 that can be ignored.
jupyterlab#5233
blink1073 added a commit that referenced this issue Aug 31, 2018
shutil would throw an error [Errno 5] after copying from nfs4 to nfs4 that can be ignored.
#5233
@blink1073 blink1073 removed this from the 0.35 milestone Sep 5, 2018
@blink1073 blink1073 added this to the 1.0 milestone Sep 5, 2018
@blink1073 blink1073 mentioned this issue Sep 28, 2018
31 tasks
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants