jupyter trying to modify /gnu/store

  • Done
  • quality assurance status badge
Details
4 participants
  • Alexander Asteroth
  • jgart
  • Lars-Dominik Braun
  • Ludovic Courtès
Owner
unassigned
Submitted by
Alexander Asteroth
Severity
normal
Merged with
A
A
Alexander Asteroth wrote on 27 Nov 2021 11:14
(address . bug-guix@gnu.org)
87pmqlq4s1.fsf@h-brs.de
Dear all,

yesterday I added jupyter to my profile and it worked perfectly
fine. Overnight I shut down the computer and rebooted today.
Now jupyter refuses to start with the messages below. It seems that
jupyter-notebook tries to create directories (or modifiy them) in the location it
is installed wich is mounted ro. I have no idea why this didn't happen
yesterday but it seems that there is some misconfiguration somewhere...

Cheers,
Alex

PS: same effect with jupyterlab from the guix-science channel.

-------------------------------
~$ jupyter-notebook
Traceback (most recent call last):
File "/gnu/store/1v8dgchnis87a4p3g9i3j1ayv0dfr4ds-python-notebook-6.3.0/bin/.jupyter-notebook-real", line 11, in <module>
load_entry_point('notebook==6.3.0', 'console_scripts', 'jupyter-notebook')()
File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py", line 254, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/gnu/store/i037rnmqzwcc7nrgcswzb8dcckfrngzp-python-traitlets-4.3.3/lib/python3.8/site-packages/traitlets/config/application.py", line 663, in launch_instance
app.initialize(argv)
File "/gnu/store/f7y0fd230nc6l2qwq58g7q26rlkwjkf3-python-decorator-5.0.9/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/gnu/store/i037rnmqzwcc7nrgcswzb8dcckfrngzp-python-traitlets-4.3.3/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/gnu/store/1v8dgchnis87a4p3g9i3j1ayv0dfr4ds-python-notebook-6.3.0/lib/python3.8/site-packages/notebook/notebookapp.py", line 2122, in initialize
super().initialize(argv)
File "/gnu/store/f7y0fd230nc6l2qwq58g7q26rlkwjkf3-python-decorator-5.0.9/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/gnu/store/i037rnmqzwcc7nrgcswzb8dcckfrngzp-python-traitlets-4.3.3/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py", line 229, in initialize
self.migrate_config()
File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py", line 155, in migrate_config
migrate()
File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/migrate.py", line 244, in migrate
ensure_dir_exists(env['jupyter_config'])
File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/utils/__init__.py", line 11, in ensure_dir_exists
os.makedirs(path, mode=mode)
File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
[Previous line repeated 7 more times]
File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/home/[user]/.guix-profile/etc/jupyter:'
A
A
Alexander Asteroth wrote on 27 Nov 2021 17:31
871r318spu.fsf@h-brs.de
I found the cause:

in ~/.guix-profile/etc/profile environment variables are set for jupyter:

Toggle quote (3 lines)
> export JUPYTER_PATH="${GUIX_PROFILE:-/gnu/store/ichrcarq2k4lhdmm2izc3f1xjbziz49v-profile}/share/jupyter${JUPYTER_PATH:+:}$JUPYTER_PATH"
> export JUPYTER_CONFIG_DIR="${GUIX_PROFILE:-/gnu/store/ichrcarq2k4lhdmm2izc3f1xjbziz49v-profile}/etc/jupyter${JUPYTER_CONFIG_DIR:+:}$JUPYTER_CONFIG_DIR"

The jupyter config path causes the problem, since jupyter tries to write
into it (and it is located in a read only filesystem). Unsetting the
environment variable solves the issue.

Cheers,

Alex

On Sat, Nov 27 2021, 11:14:07, Alexander Asteroth <alexander.asteroth@h-brs.de> wrote:

Toggle quote (51 lines)
> Dear all,
>
> yesterday I added jupyter to my profile and it worked perfectly
> fine. Overnight I shut down the computer and rebooted today.
> Now jupyter refuses to start with the messages below. It seems that
> jupyter-notebook tries to create directories (or modifiy them) in the location it
> is installed wich is mounted ro. I have no idea why this didn't happen
> yesterday but it seems that there is some misconfiguration somewhere...
>
> Cheers,
> Alex
>
> PS: same effect with jupyterlab from the guix-science channel.
>
> -------------------------------
> ~$ jupyter-notebook
> Traceback (most recent call last):
> File "/gnu/store/1v8dgchnis87a4p3g9i3j1ayv0dfr4ds-python-notebook-6.3.0/bin/.jupyter-notebook-real", line 11, in <module>
> load_entry_point('notebook==6.3.0', 'console_scripts', 'jupyter-notebook')()
> File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py", line 254, in launch_instance
> return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
> File "/gnu/store/i037rnmqzwcc7nrgcswzb8dcckfrngzp-python-traitlets-4.3.3/lib/python3.8/site-packages/traitlets/config/application.py", line 663, in launch_instance
> app.initialize(argv)
> File "/gnu/store/f7y0fd230nc6l2qwq58g7q26rlkwjkf3-python-decorator-5.0.9/lib/python3.8/site-packages/decorator.py", line 232, in fun
> return caller(func, *(extras + args), **kw)
> File "/gnu/store/i037rnmqzwcc7nrgcswzb8dcckfrngzp-python-traitlets-4.3.3/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in catch_config_error
> return method(app, *args, **kwargs)
> File "/gnu/store/1v8dgchnis87a4p3g9i3j1ayv0dfr4ds-python-notebook-6.3.0/lib/python3.8/site-packages/notebook/notebookapp.py", line 2122, in initialize
> super().initialize(argv)
> File "/gnu/store/f7y0fd230nc6l2qwq58g7q26rlkwjkf3-python-decorator-5.0.9/lib/python3.8/site-packages/decorator.py", line 232, in fun
> return caller(func, *(extras + args), **kw)
> File "/gnu/store/i037rnmqzwcc7nrgcswzb8dcckfrngzp-python-traitlets-4.3.3/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in catch_config_error
> return method(app, *args, **kwargs)
> File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py", line 229, in initialize
> self.migrate_config()
> File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py", line 155, in migrate_config
> migrate()
> File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/migrate.py", line 244, in migrate
> ensure_dir_exists(env['jupyter_config'])
> File "/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/utils/__init__.py", line 11, in ensure_dir_exists
> os.makedirs(path, mode=mode)
> File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 213, in makedirs
> makedirs(head, exist_ok=exist_ok)
> File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 213, in makedirs
> makedirs(head, exist_ok=exist_ok)
> File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 213, in makedirs
> makedirs(head, exist_ok=exist_ok)
> [Previous line repeated 7 more times]
> File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/os.py", line 223, in makedirs
> mkdir(name, mode)
> OSError: [Errno 30] Read-only file system: '/home/[user]/.guix-profile/etc/jupyter:'
J
(no subject)
(address . 52139@debbugs.gnu.org)
20211127200835.GB7916@gac.attlocal.net
Hi Alex,

Would you like to submit a patch to remove those environment variables from being set in the jupyter package?
A
A
Alexander Asteroth wrote on 28 Nov 2021 10:51
Re: bug-Guix Digest, Vol 109, Issue 119
(address . 52139@debbugs.gnu.org)
87sfvg7gfr.fsf@h-brs.de
I'd like to but feel still too much of a newbie currently. If someone
would point me to the right steps to take, I'd do so - and in future I
will be able to help and contribute (and not just report errors).

Cheers,
Alex

PS: BTW I didn't receive this message directly only found it in the
bug-guix digest. Shouldn't I receive replies to the bug i filed?

On Sun, Nov 28 2021, 02:41:05, bug-guix-request@gnu.org wrote:
Toggle quote (16 lines)
> ------------------------------
>
> Message: 2
> Date: Sat, 27 Nov 2021 20:08:35 -0500
> From: jgart <jgart@dismail.de>
> To: 52139@debbugs.gnu.org
> Subject: bug#52139: (no subject)
> Message-ID: <20211127200835.GB7916@gac.attlocal.net>
> Content-Type: text/plain; charset=utf-8
>
>
> Hi Alex,
>
> Would you like to submit a patch to remove those environment variables from being set in the jupyter package?
>
>
L
L
Ludovic Courtès wrote on 8 Dec 2021 18:23
control message for bug #52139
(address . control@debbugs.gnu.org)
87o85rggeg.fsf@gnu.org
merge 52139 52159
quit
L
L
Ludovic Courtès wrote on 10 Dec 2021 14:27
Re: bug#52139: jupyter trying to modify /gnu/store
(name . Alexander Asteroth)(address . alexander.asteroth@h-brs.de)
87pmq4a8tm.fsf@gnu.org
Hi Alexander,

Alexander Asteroth <alexander.asteroth@h-brs.de> skribis:

Toggle quote (11 lines)
> I found the cause:
>
> in ~/.guix-profile/etc/profile environment variables are set for jupyter:
>
>> export JUPYTER_PATH="${GUIX_PROFILE:-/gnu/store/ichrcarq2k4lhdmm2izc3f1xjbziz49v-profile}/share/jupyter${JUPYTER_PATH:+:}$JUPYTER_PATH"
>> export JUPYTER_CONFIG_DIR="${GUIX_PROFILE:-/gnu/store/ichrcarq2k4lhdmm2izc3f1xjbziz49v-profile}/etc/jupyter${JUPYTER_CONFIG_DIR:+:}$JUPYTER_CONFIG_DIR"
>
> The jupyter config path causes the problem, since jupyter tries to write
> into it (and it is located in a read only filesystem). Unsetting the
> environment variable solves the issue.

I can’t reproduce it with:

Toggle snippet (9 lines)
$ guix describe
Generacio 196 Dec 06 2021 11:23:08 (nuna)
guix 9478a25
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 9478a252509a93f3e7f486cbc549631185ba071d
$ guix shell jupyter -CN --no-cwd -- jupyter notebook

Perhaps that’s because I didn’t trigger actions that would cause Jupyter
to attempt to write to $JUPYTER_CONFIG_DIR?

The JUPYTER_CONFIG_DIR search path was added to ‘python-jupyter-core’ in
commit 1683e9d9677d54f695a54fc44ed309287989fc34. Lars, what are you
thoughts?

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 10 Dec 2021 14:29
control message for bug #52139
(address . control@debbugs.gnu.org)
87o85oa8qg.fsf@gnu.org
merge 52139 52159
quit
A
A
Alexander Asteroth wrote on 10 Dec 2021 14:59
Re: bug#52139: jupyter trying to modify /gnu/store
(name . Ludovic Courtès)(address . ludo@gnu.org)
875yrwftj3.fsf@h-brs.de
Hi Ludovic,

On Fri, Dec 10 2021, 14:27:49, Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (28 lines)
> Hi Alexander,
>
> Alexander Asteroth <alexander.asteroth@h-brs.de> skribis:
>
>> I found the cause:
>>
>> in ~/.guix-profile/etc/profile environment variables are set for jupyter:
>>
>>> export JUPYTER_PATH="${GUIX_PROFILE:-/gnu/store/ichrcarq2k4lhdmm2izc3f1xjbziz49v-profile}/share/jupyter${JUPYTER_PATH:+:}$JUPYTER_PATH"
>>> export JUPYTER_CONFIG_DIR="${GUIX_PROFILE:-/gnu/store/ichrcarq2k4lhdmm2izc3f1xjbziz49v-profile}/etc/jupyter${JUPYTER_CONFIG_DIR:+:}$JUPYTER_CONFIG_DIR"
>>
>> The jupyter config path causes the problem, since jupyter tries to write
>> into it (and it is located in a read only filesystem). Unsetting the
>> environment variable solves the issue.
>
> I can’t reproduce it with:
>
> $ guix describe
> Generacio 196 Dec 06 2021 11:23:08 (nuna)
> guix 9478a25
> repository URL: https://git.savannah.gnu.org/git/guix.git
> branch: master
> commit: 9478a252509a93f3e7f486cbc549631185ba071d
> $ guix shell jupyter -CN --no-cwd -- jupyter notebook
>
> Perhaps that’s because I didn’t trigger actions that would cause Jupyter
> to attempt to write to $JUPYTER_CONFIG_DIR?

Yes. I happes for also only if I used jupyter once. At the second attempt
the error occured.

The problem is easily solved by setting the config dir to (e.g.)
~/.config/jupyter.

Cheers,

Alex

Toggle quote (7 lines)
>
> The JUPYTER_CONFIG_DIR search path was added to ‘python-jupyter-core’ in
> commit 1683e9d9677d54f695a54fc44ed309287989fc34. Lars, what are you
> thoughts?
>
> Thanks,
> Ludo’.
-----BEGIN PGP SIGNATURE-----

iQFQBAEBCAA6FiEEXU8UwBfdlxG/YNXXLg/GxGpHPCwFAmGzXcAcHGFsZXhhbmRl
ci5hc3Rlcm90aEBoLWJycy5kZQAKCRAuD8bEakc8LKHoB/0WujJfuhObFpB8jEFc
gZ9X6hyu4mkh/hHxUPTwneVF/oNryEft7Ho4FpAEiuHkTFulGav4Q1v762+nRkjI
1BWKhBX2csjV4k+GFpTdHlfR9Gj4GIes+B6TozQtpQc7K1pn0+eExH0sM8a7Z682
IqhuG9gzqnnXd6HBZMkp4XF/ntwmpJI0WPoKX/k9W8iH2hO1l8PkRS1bA2qGOoty
x7FgD0WXBgRLnF2ENcVgKP3hm1g+RLa0I+yTP8gnXBt9/etwwg5FQFV/6NdOUebJ
D23AdXDFG8VIKI5UDBEI8d8DkE//qNFdDXZeCLdOEffJ5unUOhYxk4owyAuBu2bA
JrSl
=M/rq
-----END PGP SIGNATURE-----

L
L
Lars-Dominik Braun wrote on 11 Dec 2021 10:36
(name . Ludovic Courtès)(address . ludo@gnu.org)
YbRxLXNkQ4/URUDp@noor.fritz.box
Hi,

Toggle quote (1 lines)
> I can’t reproduce it with: […]
I cannot reproduce it either and this migration should not happen™,
because the phase 'disable-migration should disable it. (See
/gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py:145).

Alexander: Does this file exists for you too?

guix shell python-notebook -- sh -c "stat \$JUPYTER_CONFIG_DIR/migrated"

Toggle quote (3 lines)
> The JUPYTER_CONFIG_DIR search path was added to ‘python-jupyter-core’ in
> commit 1683e9d9677d54f695a54fc44ed309287989fc34. Lars, what are you
> thoughts?
Please *do not* remove this environment variable. It is required, because
packages like jupyterlab drop a config file into this directory. Without
it the jupyterlab extension will not be loaded by default and a simple
`guix shell python-jupyterlab -- jupyter lab` will not work.

Cheers,
Lars
A
A
Alexander Asteroth wrote on 11 Dec 2021 13:46
(name . Lars-Dominik Braun)(address . lars@6xq.net)
877dcbpatg.fsf@h-brs.de
Nope:

Toggle quote (2 lines)
> stat: cannot statx '/gnu/store/djb0y6kn86ijbvkx93q48q484krp1kbb-profile/etc/jupyter:/home/aster/.config/jupyter/migrated': No such file or directory

Cheers,
Alex

On Sat, Dec 11 2021, 10:36:45, Lars-Dominik Braun <lars@6xq.net> wrote:

Toggle quote (21 lines)
> Hi,
>
>> I can’t reproduce it with: […]
> I cannot reproduce it either and this migration should not happen™,
> because the phase 'disable-migration should disable it. (See
> /gnu/store/8ncan0ipzb240h23fwfspdhrzkzdw277-python-jupyter-core-4.7.1/lib/python3.8/site-packages/jupyter_core/application.py:145).
>
> Alexander: Does this file exists for you too?
>
> guix shell python-notebook -- sh -c "stat \$JUPYTER_CONFIG_DIR/migrated"
>
>> The JUPYTER_CONFIG_DIR search path was added to ‘python-jupyter-core’ in
>> commit 1683e9d9677d54f695a54fc44ed309287989fc34. Lars, what are you
>> thoughts?
> Please *do not* remove this environment variable. It is required, because
> packages like jupyterlab drop a config file into this directory. Without
> it the jupyterlab extension will not be loaded by default and a simple
> `guix shell python-jupyterlab -- jupyter lab` will not work.
>
> Cheers,
> Lars
-----BEGIN PGP SIGNATURE-----

iQFQBAEBCAA6FiEEXU8UwBfdlxG/YNXXLg/GxGpHPCwFAmG0nfscHGFsZXhhbmRl
ci5hc3Rlcm90aEBoLWJycy5kZQAKCRAuD8bEakc8LHOLCACMILTTc+zpm999BDhe
J+4PiVLbrSnZd1wHHlxUFgJ5v6O5yprtQBu9eK+c7AJXGMIHaYI29u9OGjROhzkP
ylxbjap9154EkaTjQQ89p8nI0HW4ulAW+LGCMDeHfeAcTnXDDPy7V6xRkTm7+jNs
q0Pu55zxjXDlbN7jH6S4knhULe2rcxcvsFL9ar9GzTsNtL2c9ANn8Kr3nfLCFEj/
NdGx1bgSwhhm+WjqV3vX8vdfb2TMV9EYoLNGBOalvDUJsMpxupbBoL7X1CaPSSNo
ZMmyEimxGkgxI85mFsSji19UkXrW1ZB4jQfBkqHzXGLuE306zLblbLjngzD48V2y
CCam
=FGaA
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 12 Dec 2021 22:41
(name . Lars-Dominik Braun)(address . lars@6xq.net)
87k0g94i2m.fsf@gnu.org
Hi Lars,

Lars-Dominik Braun <lars@6xq.net> skribis:

Toggle quote (6 lines)
>> The JUPYTER_CONFIG_DIR search path was added to ‘python-jupyter-core’ in
>> commit 1683e9d9677d54f695a54fc44ed309287989fc34. Lars, what are you
>> thoughts?
> Please *do not* remove this environment variable. It is required, because
> packages like jupyterlab drop a config file into this directory.

But precisely: as Alexander wrote, when JUPYTER_CONFIG_DIR points to the
store, jupyterlab cannot drop a config file there. Or am I missing
something?

BTW, if JUPYTER_CONFIG_DIR is meant to contain a directory name, as
opposed to a colon-separated search path, we should make this change:
Toggle diff (12 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b3a350aca4..57f66e18f1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8479,6 +8479,7 @@ (define-public python-jupyter-core
(native-search-paths
(list (search-path-specification
(variable "JUPYTER_CONFIG_DIR")
+ (separator #f) ;single entry
(files '("etc/jupyter")))
(search-path-specification
(variable "JUPYTER_PATH")
WDYT?

Thanks,
Ludo’.
L
L
Lars-Dominik Braun wrote on 13 Dec 2021 09:20
(name . Ludovic Courtès)(address . ludo@gnu.org)
YbcCVVTC6L5+QV8g@noor.fritz.box
Hi Ludo,

Toggle quote (3 lines)
> But precisely: as Alexander wrote, when JUPYTER_CONFIG_DIR points to the
> store, jupyterlab cannot drop a config file there. Or am I missing
> something?
sorry, my message was unclear here. The config file is written at
build time.

Toggle quote (2 lines)
> BTW, if JUPYTER_CONFIG_DIR is meant to contain a directory name, as
> opposed to a colon-separated search path, we should make this change:
Looking at the documentation[1] again this is correct, but I feel we
should use JUPYTER_CONFIG_PATH instead, because it supports
colon-delimited entries, see attached patch. However that does not get
rid of error messages like these, when trying to use Settings→JupyterLab
Theme for example:

[W 08:10:14.476 LabApp] 500 PUT /lab/api/workspaces/lab?1639383014500 (127.0.0.1): [Errno 30] Read-only file system: '/gnu/store/8q7wdpdddfqh46plbbsa3rwci5092n5y-profile/etc/jupyter/lab'

So it seems that JUPYTER_CONFIG_PATH overrides the default
JUPYTER_CONFIG_DIR, when the latter is not set. Or maybe guix-science’s
jupyterlab is simply too old – not sure right now.

Cheers,
Lars

Toggle diff (31 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index db2ab8e5f0..450d17208f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8478,7 +8478,7 @@ (define-public python-jupyter-core
;; search paths.
(native-search-paths
(list (search-path-specification
- (variable "JUPYTER_CONFIG_DIR")
+ (variable "JUPYTER_CONFIG_PATH")
(files '("etc/jupyter")))
(search-path-specification
(variable "JUPYTER_PATH")
@@ -12145,8 +12145,6 @@ (define-public python-nbconvert
(when tests?
;; Some tests invoke the installed nbconvert binary.
(add-installed-pythonpath inputs outputs)
- ;; Tries to write to this path.
- (unsetenv "JUPYTER_CONFIG_DIR")
;; Tests depend on templates installed to output.
(setenv "JUPYTER_PATH"
(string-append
@@ -12254,6 +12252,8 @@ (define-public python-notebook
;; Some tests do not expect all files to be installed in the
;; same directory, but JUPYTER_PATH contains multiple entries.
(unsetenv "JUPYTER_PATH")
+ ;; Interferes with tests that check paths.
+ (unsetenv "JUPYTER_CONFIG_PATH")
;; Some tests need HOME
(setenv "HOME" "/tmp")
(with-directory-excursion "/tmp"
L
L
Ludovic Courtès wrote on 14 Dec 2021 16:06
(name . Lars-Dominik Braun)(address . lars@6xq.net)
87v8zrz0ml.fsf@gnu.org
Hi Lars,

Lars-Dominik Braun <lars@6xq.net> skribis:

Toggle quote (6 lines)
>> But precisely: as Alexander wrote, when JUPYTER_CONFIG_DIR points to the
>> store, jupyterlab cannot drop a config file there. Or am I missing
>> something?
> sorry, my message was unclear here. The config file is written at
> build time.

Oh I see.

Toggle quote (14 lines)
>> BTW, if JUPYTER_CONFIG_DIR is meant to contain a directory name, as
>> opposed to a colon-separated search path, we should make this change:
> Looking at the documentation[1] again this is correct, but I feel we
> should use JUPYTER_CONFIG_PATH instead, because it supports
> colon-delimited entries, see attached patch. However that does not get
> rid of error messages like these, when trying to use Settings→JupyterLab
> Theme for example:
>
> [W 08:10:14.476 LabApp] 500 PUT /lab/api/workspaces/lab?1639383014500 (127.0.0.1): [Errno 30] Read-only file system: '/gnu/store/8q7wdpdddfqh46plbbsa3rwci5092n5y-profile/etc/jupyter/lab'
>
> So it seems that JUPYTER_CONFIG_PATH overrides the default
> JUPYTER_CONFIG_DIR, when the latter is not set. Or maybe guix-science’s
> jupyterlab is simply too old – not sure right now.

OK.

Toggle quote (29 lines)
> +++ b/gnu/packages/python-xyz.scm
> @@ -8478,7 +8478,7 @@ (define-public python-jupyter-core
> ;; search paths.
> (native-search-paths
> (list (search-path-specification
> - (variable "JUPYTER_CONFIG_DIR")
> + (variable "JUPYTER_CONFIG_PATH")
> (files '("etc/jupyter")))
> (search-path-specification
> (variable "JUPYTER_PATH")
> @@ -12145,8 +12145,6 @@ (define-public python-nbconvert
> (when tests?
> ;; Some tests invoke the installed nbconvert binary.
> (add-installed-pythonpath inputs outputs)
> - ;; Tries to write to this path.
> - (unsetenv "JUPYTER_CONFIG_DIR")
> ;; Tests depend on templates installed to output.
> (setenv "JUPYTER_PATH"
> (string-append
> @@ -12254,6 +12252,8 @@ (define-public python-notebook
> ;; Some tests do not expect all files to be installed in the
> ;; same directory, but JUPYTER_PATH contains multiple entries.
> (unsetenv "JUPYTER_PATH")
> + ;; Interferes with tests that check paths.
> + (unsetenv "JUPYTER_CONFIG_PATH")
> ;; Some tests need HOME
> (setenv "HOME" "/tmp")
> (with-directory-excursion "/tmp"

If that works for you, go for it.

Thanks,
Ludo’.
L
L
Lars-Dominik Braun wrote on 16 Dec 2021 10:16
(name . Ludovic Courtès)(address . ludo@gnu.org)
YbsD3goJVJSsHu6Z@noor.fritz.box
Hi,

Toggle quote (1 lines)
> If that works for you, go for it.
merged as c63b55d1283d9a4bfc5ecaf1cab01cd98a467b69. I’ll investigate why
jupyterlab is trying to write to /gnu/store when trying to save settings.

Cheers,
Lars
L
L
Lars-Dominik Braun wrote on 21 Dec 2021 14:48
(name . Alexander Asteroth)(address . alexander.asteroth@h-brs.de)(address . 52139-done@debbugs.gnu.org)
YcHbFGZm7SeB6YBg@noor.fritz.box
Hi Alexander,

Toggle quote (1 lines)
> [W 13:52:18.502 LabApp] 500 PUT /lab/api/workspaces/lab?1639227138494 (127.0.0.1): [Errno 30] Read-only file system: '[user]/.guix-profile/etc/jupyter/lab'
Closed
?