# Cylc hub not loading cylc ui

**URL:** <https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075>\
**Category:** Cylc Support\
**Created:** [December 2, 2024, 5:10pm UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075 "2024-12-02T17:10:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gturek](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gturek](https://cylc.discourse.group/u/gturek)\
**Post date:** [December 2, 2024, 5:10pm UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/1 "2024-12-02T17:10:18Z")

</div>

Hi there! I am trying to set up a cylc hub. I managed to get to the point of users being able to login but the cylc UI does not show, only a page that says “A Jupyter Server is running”. I am at a bit of a loss. There are no errors in the logs.  
I am running version 5.2.1 of jupyterhub with “out of the box” configuration, using sudospawner.  
Some pointers would be highly appreciated.  
Cheers!  
Gaby

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [December 3, 2024, 12:18am UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/2 "2024-12-03T00:18:31Z")

</div>

Hi Gaby,

> [@gturek](#):
>
> I am running version 5.2.1 of jupyterhub with “out of the box” configuration,

Are you starting it as `cylc hub`?

> [@gturek](#):
>
> , using sudospawner.

Have you read the Jupyter docs on how to do that?  
[Run JupyterHub without root privileges using sudo — JupyterHub documentation](https://jupyterhub.readthedocs.io/en/latest/howto/configuration/config-sudo.html)

Notably:

> **Note:** Setting up `sudo` permissions involves many pieces of system configuration. It is quite easy to get wrong and very difficult to debug. Only do this if you are very sure you must.  
> …  
> Since JupyterHub needs to spawn processes as other users, the simplest way is to run it as root, spawning user servers with [setuid](https://linux.die.net/man/2/setuid). But this isn’t especially safe, because you have a process running on the public web as root.  
> …  
> A **more prudent way** to run the server while preserving functionality is to create a dedicated user with `sudo` access restricted to launching and monitoring single-user servers.

It might be worth back-tracking to try running the hub as root on (e.g.) your own Linux box, to see how it should work.

If I do that, “out of the box” the server starts, and I can’t log in to it, but it prints a warning for the default PAM authenticator,

> No allow config found, it’s possible that nobody can login to your Hub!  
> You can set `c.Authenticator.allow_all = True` to allow any user who can login to access the Hub,  
> or e.g. `allowed_users` to a set of users who should have access.

If then add the `c.Authenticator.allow_all = True` to `$HOME/.cylc/uiserver/jupyter_config.py`, I can log in with my system username and password, and everything works like a charm.

On logging in to the hub, it takes me straight to my Cylc UI, but I can get back to the Hub via the Cylc UI dashboard. The Hub Home page looks like this (clicking on My Server take me back to my Cylc UI):

 ![image](https://global.discourse-cdn.com/free1/uploads/cylc1/original/1X/737eec943e3ec28cd2eb8cb89a6cc3daa1dce65f.png)

The Hub Admin page looks like this:

 ![image](https://global.discourse-cdn.com/free1/uploads/cylc1/original/1X/97e35bb0d55d1f792560e707ec0bb502fa795f9e.png)

> [@gturek](#):
>
> only a page that says “A Jupyter Server is running”. I

I take it that page does not look like my screenshots above?

---

<div class="post-metadata">

**Author:** ![gturek](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gturek](https://cylc.discourse.group/u/gturek)\
**Post date:** [December 3, 2024, 9:06am UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/3 "2024-12-03T09:06:34Z")

</div>

I was able to run as root without any issues. But this is not an acceptable solution on the server that will eventually host cylc\_hub (mind you, using sudospawner is not a given either ☹ )  
What I am getting when I login is a “plain” page:

 ![Screenshot 2024-12-03 at 10.04.37](https://global.discourse-cdn.com/free1/uploads/cylc1/original/1X/de4eb76654229b46935b488dc3b5707152b870db.jpeg)  
Once I am there I am “stuck”, no way to log out even.  
I am thinking that I am now missing some settings on the user side.  
It’s not clear to me exactly what settings are required at the site and user level as described in [UI Server Configuration — Cylc 8.3.4 documentation](https://cylc.github.io/cylc-doc/latest/html/reference/config/ui-server.html). I have a feeling that it is not working because (some of) those settings are missing.  
As the test user, I have installed cylc-flow and cylc-uiserver.

---

<div class="post-metadata">

**Author:** ![oliver.sanders](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/oliver.sanders/32/110_2.png) [@oliver.sanders](https://cylc.discourse.group/u/oliver.sanders)\
**Post date:** [December 3, 2024, 9:48am UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/4 "2024-12-03T09:48:34Z")

</div>

Hi,

You appear to be running a vanilla Juypyter setup (this provides the hub and server model), however, you have not configured any apps for Jupyter to run. The hub and server are working, but with no apps to run, it will just show you the “A Jupyter Server is running” message.

We provide a Jupyter config for running the Cylc app which is activated automatically when you start the hub using the `cylc hub` command (this launches Jupyter Hub with the Cylc configuration). This is the recommended way to run the Cylc UI Server.

Alternatively, you can configure a vanilla Jupyter setup to run the Cylc app. This is how sites can add Cylc to pre-existing Jupyter Hub deployments. The config that the `cylc hub` command is defined in the file linked below, copy the relevant bits to your own Jupyter config and restart the service:

> <https://github.com/cylc/cylc-uiserver/blob/master/cylc/uiserver/jupyter_config.py>

---

<div class="post-metadata">

**Author:** ![gturek](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gturek](https://cylc.discourse.group/u/gturek)\
**Post date:** [December 3, 2024, 9:57am UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/5 "2024-12-03T09:57:38Z")

</div>

Aha, it may be a path issue maybe? Because the file is definitively there, in the python environment installation folder /home/cylc/.conda/envs/cylc/lib/python3.9/site-packages/cylc/uiserver  
I added two lines to it:  
c.Authenticator.delete\_invalid\_users = True  
c.JupyterHub.spawner\_class = ‘sudospawner.SudoSpawner’ (replacement)

Mind you, it must see that file, because it knows to use sudospawner

---

<div class="post-metadata">

**Author:** ![oliver.sanders](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/oliver.sanders/32/110_2.png) [@oliver.sanders](https://cylc.discourse.group/u/oliver.sanders)\
**Post date:** [December 3, 2024, 10:26am UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/6 "2024-12-03T10:26:26Z")

</div>

If you’re using sudospawner, then I think you either need to:

1. Modify the command sudospawner runs (what we do)

2. Configure jupyter server to use any required Cylc config.

---

<div class="post-metadata">

**Author:** ![gturek](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gturek](https://cylc.discourse.group/u/gturek)\
**Post date:** [December 3, 2024, 12:09pm UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/7 "2024-12-03T12:09:09Z")

</div>

Yes!!! That did it. Thank you soo much Oliver.

---

<div class="post-metadata">

**Author:** ![gturek](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gturek](https://cylc.discourse.group/u/gturek)\
**Post date:** [December 3, 2024, 3:52pm UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/8 "2024-12-03T15:52:13Z")

</div>

Now I have another problem as a user. I can log in, and I see all my workflows, but I cannot play them. The error is:  
Command failed: play - [Errno 2] No such file or directory: ‘cylc’

---

<div class="post-metadata">

**Author:** ![MetRonnie](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/metronnie/32/125_2.png) [@MetRonnie](https://cylc.discourse.group/u/MetRonnie)\
**Post date:** [December 3, 2024, 4:01pm UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/9 "2024-12-03T16:01:38Z")

</div>

Are you using a wrapper script for Cylc? [Installation — Cylc 8.3.4 documentation](https://cylc.github.io/cylc-doc/latest/html/installation.html#managing-environments)

---

<div class="post-metadata">

**Author:** ![gturek](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@gturek](https://cylc.discourse.group/u/gturek)\
**Post date:** [December 4, 2024, 1:56pm UTC](https://cylc.discourse.group/t/cylc-hub-not-loading-cylc-ui/1075/10 "2024-12-04T13:56:53Z")

</div>

Wrapper worked! Thanx a bunch
