unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52139: jupyter trying to modify /gnu/store
@ 2021-11-27 10:14 Alexander Asteroth
  2021-11-27 16:31 ` Alexander Asteroth
  2021-11-28  1:08 ` bug#52139: (no subject) jgart
  0 siblings, 2 replies; 12+ messages in thread
From: Alexander Asteroth @ 2021-11-27 10:14 UTC (permalink / raw)
  To: 52139

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:'




^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-11-27 10:14 bug#52139: jupyter trying to modify /gnu/store Alexander Asteroth
@ 2021-11-27 16:31 ` Alexander Asteroth
  2021-12-10 13:27   ` Ludovic Courtès
  2021-11-28  1:08 ` bug#52139: (no subject) jgart
  1 sibling, 1 reply; 12+ messages in thread
From: Alexander Asteroth @ 2021-11-27 16:31 UTC (permalink / raw)
  Cc: 52139

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.

Cheers,

        Alex

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

> 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:'





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: (no subject)
  2021-11-27 10:14 bug#52139: jupyter trying to modify /gnu/store Alexander Asteroth
  2021-11-27 16:31 ` Alexander Asteroth
@ 2021-11-28  1:08 ` jgart
  1 sibling, 0 replies; 12+ messages in thread
From: jgart @ 2021-11-28  1:08 UTC (permalink / raw)
  To: 52139


Hi Alex,

Would you like to submit a patch to remove those environment variables from being set in the jupyter package?




^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-11-27 16:31 ` Alexander Asteroth
@ 2021-12-10 13:27   ` Ludovic Courtès
  2021-12-10 13:59     ` Alexander Asteroth
  2021-12-11  9:36     ` Lars-Dominik Braun
  0 siblings, 2 replies; 12+ messages in thread
From: Ludovic Courtès @ 2021-12-10 13:27 UTC (permalink / raw)
  To: Alexander Asteroth; +Cc: Lars-Dominik Braun, 52139

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:

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

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’.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-12-10 13:27   ` Ludovic Courtès
@ 2021-12-10 13:59     ` Alexander Asteroth
  2021-12-11  9:36     ` Lars-Dominik Braun
  1 sibling, 0 replies; 12+ messages in thread
From: Alexander Asteroth @ 2021-12-10 13:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Lars-Dominik Braun, 52139

[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]

Hi Ludovic,

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

> 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

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-12-10 13:27   ` Ludovic Courtès
  2021-12-10 13:59     ` Alexander Asteroth
@ 2021-12-11  9:36     ` Lars-Dominik Braun
  2021-12-11 12:46       ` Alexander Asteroth
                         ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Lars-Dominik Braun @ 2021-12-11  9:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Alexander Asteroth, 52139

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





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-12-11  9:36     ` Lars-Dominik Braun
@ 2021-12-11 12:46       ` Alexander Asteroth
  2021-12-12 21:41       ` Ludovic Courtès
       [not found]       ` <8735mzpaep.fsf@h-brs.de>
  2 siblings, 0 replies; 12+ messages in thread
From: Alexander Asteroth @ 2021-12-11 12:46 UTC (permalink / raw)
  To: Lars-Dominik Braun; +Cc: 52139

[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]

Nope:

> 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:

> 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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-12-11  9:36     ` Lars-Dominik Braun
  2021-12-11 12:46       ` Alexander Asteroth
@ 2021-12-12 21:41       ` Ludovic Courtès
  2021-12-13  8:20         ` Lars-Dominik Braun
       [not found]       ` <8735mzpaep.fsf@h-brs.de>
  2 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2021-12-12 21:41 UTC (permalink / raw)
  To: Lars-Dominik Braun; +Cc: Alexander Asteroth, 52139

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

Hi Lars,

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

>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 524 bytes --]

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")

[-- Attachment #3: Type: text/plain, Size: 30 bytes --]


WDYT?

Thanks,
Ludo’.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-12-12 21:41       ` Ludovic Courtès
@ 2021-12-13  8:20         ` Lars-Dominik Braun
  2021-12-14 15:06           ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Lars-Dominik Braun @ 2021-12-13  8:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Alexander Asteroth, 52139

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

Hi Ludo,

> 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.

> 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

[1] https://jupyter.readthedocs.io/en/latest/use/jupyter-directories.html

[-- Attachment #2: jupyter-core-config-path.patch --]
[-- Type: text/x-diff, Size: 1466 bytes --]

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"

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-12-13  8:20         ` Lars-Dominik Braun
@ 2021-12-14 15:06           ` Ludovic Courtès
  2021-12-16  9:16             ` Lars-Dominik Braun
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2021-12-14 15:06 UTC (permalink / raw)
  To: Lars-Dominik Braun; +Cc: Alexander Asteroth, 52139

Hi Lars,

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

>> 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.

>> 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.

> +++ 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’.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
  2021-12-14 15:06           ` Ludovic Courtès
@ 2021-12-16  9:16             ` Lars-Dominik Braun
  0 siblings, 0 replies; 12+ messages in thread
From: Lars-Dominik Braun @ 2021-12-16  9:16 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Alexander Asteroth, 52139

Hi,

> 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





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#52139: jupyter trying to modify /gnu/store
       [not found]       ` <8735mzpaep.fsf@h-brs.de>
@ 2021-12-21 13:48         ` Lars-Dominik Braun
  0 siblings, 0 replies; 12+ messages in thread
From: Lars-Dominik Braun @ 2021-12-21 13:48 UTC (permalink / raw)
  To: Alexander Asteroth; +Cc: 52139-done

Hi Alexander,

> [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'
I’ve fixed this via
https://github.com/guix-science/guix-science/commit/ca5d2b79cc730f6d52f93f4e7347102b620ed988

Cheers,
Lars





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-12-21 13:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-27 10:14 bug#52139: jupyter trying to modify /gnu/store Alexander Asteroth
2021-11-27 16:31 ` Alexander Asteroth
2021-12-10 13:27   ` Ludovic Courtès
2021-12-10 13:59     ` Alexander Asteroth
2021-12-11  9:36     ` Lars-Dominik Braun
2021-12-11 12:46       ` Alexander Asteroth
2021-12-12 21:41       ` Ludovic Courtès
2021-12-13  8:20         ` Lars-Dominik Braun
2021-12-14 15:06           ` Ludovic Courtès
2021-12-16  9:16             ` Lars-Dominik Braun
     [not found]       ` <8735mzpaep.fsf@h-brs.de>
2021-12-21 13:48         ` Lars-Dominik Braun
2021-11-28  1:08 ` bug#52139: (no subject) jgart

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).