sage docker error

33 views
Skip to first unread message

David Harvey

unread,
Aug 9, 2025, 7:37:43 AMAug 9
to sage-s...@googlegroups.com
I could not install sage on debian 13 trixie via apt, so I tried the
docker image instead.

It was working fine a few days ago, both command line and notebook
versions.

Today I am having problems with the notebook.

My command is:

sudo docker run \
--rm --interactive --tty \
--publish 8888:8888 \
--volume "$(pwd)":/home/sage/host \
sagemath/sagemath:latest \
sage-jupyter

When I run this, I get the following error message, over and over
again, a few seconds apart:

===============================

[W 2025-08-09 11:31:23.714 ServerApp] wrote error: 'Forbidden'
Traceback (most recent call last):
File "/home/sage/sage/local/var/lib/sage/venv-
python3.12.5/lib/python3.12/site-packages/tornado/web.py", line 1788,
in _execute
result = method(*self.path_args, **self.path_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sage/sage/local/var/lib/sage/venv-
python3.12.5/lib/python3.12/site-packages/tornado/web.py", line 3289,
in wrapper
url = self.get_login_url()
^^^^^^^^^^^^^^^^^^^^
File "/home/sage/sage/local/var/lib/sage/venv-
python3.12.5/lib/python3.12/site-
packages/jupyter_server/base/handlers.py", line 753, in get_login_url
raise web.HTTPError(403)
tornado.web.HTTPError: HTTP 403: Forbidden
[W 2025-08-09 11:31:23.717 ServerApp] 403 GET
/api/contents/host/elliptic-recurrences.ipynb/checkpoints?1754739083705
(@172.17.0.1) 3.68ms
referer=http://127.0.0.1:8888/notebooks/host/elliptic-recurrences.ipynb

===============================

It looks like it's trying to read the notebook elliptic-
recurrences.ipynb, which I was working on a few days ago. But my
understanding is that this should not be possible, because I am
starting up a new instance of the docker image, in a new container (I
checked the old one no longer exists via "docker container list --
all"). It should have completely forgotten about that notebook. It's
not even accessible in the current directory (which as you can see I
have mapped into the container via the --volume flag), because I am
starting it up in a different unrelated directory.

So what is going on? How can this instance "see" something from my
previous session? Is it somehow storing something on my actual
filesystem?

thanks

david

Confidential communication - This email and any files transmitted with it are confidential and are intended solely for the addressee. If you are not the intended recipient, please be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email and any file attachments is strictly prohibited. If you have received this email in error, please notify me immediately by return email and destroy this email.

Dima Pasechnik

unread,
Aug 10, 2025, 12:15:41 AMAug 10
to sage-s...@googlegroups.com
A *normal* way to run jupyter in such a scenario would be on the host,
with it talking to
the remote/guest/container. (If it's the case it would explain what's going on).

I would be surprised if you ran it on a browser from the container,
this seems to be suboptimal.
(but I don't know much about docker)

Dima


>
> thanks
>
> david
>
> Confidential communication - This email and any files transmitted with it are confidential and are intended solely for the addressee. If you are not the intended recipient, please be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email and any file attachments is strictly prohibited. If you have received this email in error, please notify me immediately by return email and destroy this email.
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/63cab78009f62a4f45722d76b2cfa734e4a5142e.camel%40unsw.edu.au.

Jan Groenewald

unread,
Aug 10, 2025, 3:10:23 AMAug 10
to sage-s...@googlegroups.com
Hi

On Sat, 9 Aug 2025 at 13:37, 'David Harvey' via sage-support <sage-s...@googlegroups.com> wrote:
I could not install sage on debian 13 trixie via apt, so I tried the
docker image instead.

It was working fine a few days ago, both command line and notebook
versions.

Today I am having problems with the notebook.

My command is:

sudo docker run \
    --rm --interactive --tty \
    --publish 8888:8888 \
    --volume "$(pwd)":/home/sage/host \
    sagemath/sagemath:latest \
    sage-jupyter

I just ran this on trixie and it works fine.
From a new tmp directory, with a notebook I opened in the previous session, I get

image.png
 
      File "/home/sage/sage/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/jupyter_server/services/contents/filemanager.py", line 861, in get
        raise web.HTTPError(404, "No such file or directory: %s" % path)
    tornado.web.HTTPError: HTTP 404: Not Found (No such file or directory: host/Untitled.ipynb)

... as expected.

sagemath:latest seems to track the develop branch, which was updated 4 hours ago.

I'm not sure about your query about the docker image persistently seeing/writing into your folders.
Maybe try again, try it in the previous folder, and check the underlying permissions of folders.

Regards,
Jan



Reply all
Reply to author
Forward
0 new messages