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

2.0.1: break showHiddenFiles in JupyterLab UI #1129

Closed
tarrade opened this issue Dec 13, 2022 · 11 comments
Closed

2.0.1: break showHiddenFiles in JupyterLab UI #1129

tarrade opened this issue Dec 13, 2022 · 11 comments
Labels

Comments

@tarrade
Copy link

tarrade commented Dec 13, 2022

Description

When switching from jupyter_server=1.23.3 to jupyter_server=2.0.1, in JupyterLab, I don't see anymore hidden files.

Reproduce

I am using:
jupyter_server=2.0.1
jupyterlab=3.5.1

and the following standard setup to see hidden file in JupyterLab:

{
    // File Browser
    // @jupyterlab/filebrowser-extension:browser
    // File Browser settings.
    // *****************************************

    // Show hidden files
    // Whether to show hidden files
    "showHiddenFiles": true
}

and:
c.ContentsManager.allow_hidden = True

Expected behavior

I am expecting to have the same UI and feature as with jupyter_server=1.23.3 as below
Expecting UI

Context

  • Operating System and version: Ubuntu 20.04.5 LTS
  • Browser and version: Google Chrome Version 108.0.5359.99 (Official Build) (64-bit)
  • Jupyter Server version: 2.0.1
Troubleshoot Output
Not sure I saw some meaningful information in the logfile because of other issues related to new jupyter_server like jupytext, jupyterlab-git
@tarrade tarrade added the bug label Dec 13, 2022
@welcome
Copy link

welcome bot commented Dec 13, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@tarrade
Copy link
Author

tarrade commented Dec 15, 2022

I managed to find some error in the log after some other issues got fixed (JupyterLab extension).

[ServerApp][m 500 PUT /lab/api/settings/@jupyterlab/filebrowser-extension:browser?1671117244643 (172.17.0.1): Failed writing settings (@jupyterlab/filebrowser-extension:browser): [Errno 13] Permission denied: '/opt/conda/envs/jupyter-notebook/etc/jupyter/lab'
[LabApp][m wrote error: "Failed writing settings (@jupyterlab/filebrowser-extension:browser): [Errno 13] Permission denied: '/opt/conda/envs/jupyter-notebook/etc/jupyter/lab'"

My setup is the same as for jupyter_server=1.23.3

I have a conda env in this location:

jupyter@:/opt/conda/envs/jupyter-notebook/etc/jupyter$ ls
jupyter_config.json  jupyter_notebook_config.d  jupyter_server_config.d  nbconfig

as you can see there is no folder called "/lab"

The ServerApp should be looking here:
/home/jupyter/.jupyter/lab
which is
~/.jupyter/lab/

so I am not sure why ServerApp is not looking at the right place. I am not sure how I should fix that. In my config file I have the following:

c.ServerApp.root_dir = "/home/jupyter"
c.ServerApp.notebook_dir = "/home/jupyter"

Suggestion are welcome. Maybe the issue is with my config that need to be updated for jupyter_server 2.0

@blink1073
Copy link
Contributor

Hi @tarrade, I believe this is related to jupyter/jupyter_core#323. For now you can set JUPYTER_PREFER_ENV_PATH=0.

@tarrade
Copy link
Author

tarrade commented Dec 16, 2022

Hi @blink1073, yes option this fix my issue. Thanks. I will follow the PR your mention.

@tarrade
Copy link
Author

tarrade commented Dec 16, 2022

I guess another cosmetic impact of the current default setup is that now kernel got a suffix "(Local)".

Before:
Python [conda env:jupyter-notebook]

Now:
Python [conda env:jupyter-notebook] (Local)


It is not coming from the kernel.json which is identical                                                                        

@kevin-bates
Copy link
Member

I guess another cosmetic impact of the current default setup is that now kernel got a suffix "(Local)".

It looks like you're using nb_conda_kernels, which is responsible for generating the kernel's display name. Might you have name_format configured to something that includes (or generates) "(Local)"?

Can you provide the content of kernel.json and the name of the directory in which it resides (as that is considered the kernel_name)?

Regardless, I suspect you'd need to take this particular issue up with the nb_conda_kernels folks.

@tarrade
Copy link
Author

tarrade commented Dec 21, 2022

Hi @kevin-bates ,

yes, I am using nb_conda_kernels which didn't change since sept 2020 (I only changed the jupyter_server version). My kernel.json doesn't contain "(Local)" but the following:

cat /opt/conda/envs/jupyter-notebook/share/jupyter/kernels/python3/kernel.json 
{
 "argv": [
  "/opt/conda/envs/jupyter-notebook/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3 (ipykernel)",
 "language": "python",
 "metadata": {
  "debugger": true
 }

it seems that the bad display is now gone after I introduced all the following:

export JUPYTER_CONFIG_DIR="/home/jupyter/.jupyter"
export JUPYTER_DATA_DIR="/home/jupyter/.local/share/jupyter"
export JUPYTER_RUNTIME_DIR="/home/jupyter/.local/share/jupyter"
## Jupyter server setup 2.0
export JUPYTER_PREFER_ENV_PATH=0

It seems to be related to jupyter/jupyter_core#324 and jupyter/jupyter_core#323.

On my side this is all good.

@tarrade
Copy link
Author

tarrade commented Dec 23, 2022

@blink1073 do I get it right that I could use jupyter_core v5.1.1 without JUPYTER_PREFER_ENV_PATH=0 and it should work in the same way as before ? Thanks

@blink1073
Copy link
Contributor

Yes, it should work now, please let us know either way!

@tarrade
Copy link
Author

tarrade commented Dec 26, 2022

@blink1073 @kevin-bates I confirm that using solved all previous issues mention in this tread. I am using:
jupyter_core 5.1.1 and jupyter_server 2.0.5

No need of the following anymore:

export JUPYTER_CONFIG_DIR="/home/jupyter/.jupyter"
export JUPYTER_DATA_DIR="/home/jupyter/.local/share/jupyter"
export JUPYTER_RUNTIME_DIR="/home/jupyter/.local/share/jupyter"
export JUPYTER_PREFER_ENV_PATH=0

Here the jupyter depedencies. I had to use pypi for jupyter-core as it was not (yet)available with conda-forge

# packages in environment at /opt/conda/envs/jupyter-notebook:
jupyter-core              5.1.1                    pypi_0    pypi
jupyter-server-mathjax    0.2.6                    pypi_0    pypi
jupyter_client            7.4.8           py310h06a4308_0    defaults
jupyter_events            0.5.0              pyhd8ed1ab_1    conda-forge
jupyter_server            2.0.5              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.3              pyhd8ed1ab_0    conda-forge
jupyterlab                3.5.2              pyhd8ed1ab_0    conda-forge
jupyterlab-git            0.41.0                   pypi_0    pypi
jupyterlab_pygments       0.1.2                      py_0    defaults
jupyterlab_server         2.16.3          py310h06a4308_0    defaults
jupyterlab_widgets        3.0.4              pyhd8ed1ab_0    conda-forge

Thanks for the help and all the fixes. Closing

@tarrade tarrade closed this as completed Dec 26, 2022
@blink1073
Copy link
Contributor

Fantastic, thanks again for the report and follow up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants