problems in sage cell server configuration and running

Skip to first unread message

Varvara Karpova

Sep 13, 2022, 10:34:59 AM9/13/22
to sage-cell

I was able to install sagecell according to the Installation instructions at  with 2 differences: in step 2 I didn't source sage from github, but used a 9.6 version of sage compiled from source, and in step 4 I passed the argument -B to make to force rebuild. The installation has completed successfully. 

Afterwards, I tried to launch the sagecell server directly according to the Step 5 of Configuration instructions from  .

(As I work on a private and firewalled server, I didn't set up any ssh account/keys for now and I didn't change anything in, or files, but left them as they were originally.) Launching sagecell as in Step 5 
$ ../sage/sage-9.6/sage -p 8888 &
produced the error posted below.

The surprising part is, a colleague of mine was able to follow the Installation instructions of sagecell from  some time ago 
and then proceeded directly to Step 5 of Configuration as I did (i.e, without setting up ssh or changing anything in or and he could launch the sagecell server with no errors.

Could anyone advise me on where my error could come from and how can try to fix it? Something is wrong with tornado (first warning, current loop missing) and paramiko (last warning)... But I have no idea what the problem could be. 
Thanks a lot!

varvara@zage:~/sagecell$ /home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/tornado/ DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
/home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/tornado/platform/ DeprecationWarning: There is no current event loop
  super().initialize(asyncio.get_event_loop(), **kwargs)
/home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/zmq/eventloop/ DeprecationWarning: zmq.eventloop.ioloop is deprecated in pyzmq 17. pyzmq now works with default tornado and asyncio eventloops.
  self.io_loop = io_loop or IOLoop.current()
Traceback (most recent call last):
  File "/home/varvara/sagecell/", line 147, in <module>
    app = SageCellServer(args.baseurl, args.dir)
  File "/home/varvara/sagecell/", line 79, in __init__
    start_providers(self.kernel_dealer.port, config.get("providers"), dir)
  File "/home/varvara/sagecell/", line 39, in start_providers
    client.connect(config["host"], username=config["username"])
  File "/home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/paramiko/", line 435, in connect
  File "/home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/paramiko/", line 766, in _auth
    raise saved_exception
  File "/home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/paramiko/", line 742, in _auth
    self._transport.auth_publickey(username, key)
  File "/home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/paramiko/", line 1635, in auth_publickey
    return self.auth_handler.wait_for_response(my_event)
  File "/home/varvara/sage/sage-9.6/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/paramiko/", line 259, in wait_for_response
    raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.

Andrey Novoseltsev

Sep 16, 2022, 3:48:30 PM9/16/22
to sage-cell
Hi Varvara!

Does "ssh localhost" work for you on the command line where you are trying to start SageMathCell without entering anything (i.e. your password)? This is NOT the case by default! While nothing is achieved by running workers as the same user as the server in terms of security, it is still useful for development to see that the code for launching workers as separate users works. The output you get suggests that this is the issue - public key authorization is not configured.

Thank you!

Varvara Karpova

Sep 22, 2022, 7:25:59 AM9/22/22
to sage-cell
Hi Andrey! 

No, you are right, when I type "ssh localhost" on the command line (while being in the sagecell directory) I get the message Permission denied (publickey).

Let me explain my setup a bit better: 
  • I am remotely connected to a Debian secured server (to connect to my server I use a pair of ssh keys, no password). 
  • I installed both sage and sagecell on my secured server and I am for the moment trying to lauch the sagecell server from the command line on my secured server. 
  • (Later on, the idea will be obviously to set everything up, so that I can connect to sagecell running on my server from an external laptop. But for now I wanted to test how things work while working the whole time wihtin my server.)
  • So technically, I thought I wouldn't need a second layer of ssh security to connect to sagecell for the moment, since I am launching it within my server. 

But did I understand your previous answer correctly, that this type of connection to sagecell  without ssh is not possible, and that I need to configure another ssh connection via a pair of keys according to the step 3 from Installtion Guide (below)? 
I am not sure which identifiers for username and host should I then use? Still my username and my server name, just generating a second rsa key pair for the connection my server <> sagecell ? 
Sorry, I am a bit lost for the moment... :)

Thank you very much for your advice!


Edit according to your needs. Of particular interest are host and username entries of the provider_info dictionary: you should be able to SSH to username@host without typing in a password. For example, by default, it assumes you can do ssh localhost without typing in a password. Unless you are running a private and firewalled server for youself, you’ll want to change this to a more restrictive account; otherwise anyone will be able to execute any code under your username

Varvara Karpova

Sep 22, 2022, 11:07:55 AM9/22/22
to sage-cell
Hi Andrey, 

Update: After some research I was able to found the source of the problem!
It looks like my server was configured for a public key authentication as a server, but not as a client (i.e., when connecting in the role of a client to itself on localhost). So I changed this setting in /etc/ssh/config and afterwards was able to successfully set up a pair of ssh keys for configuration of sagecell as required in Step 3 and launch sagecell from terminal. 

Best wishes!

Reply all
Reply to author
0 new messages