# \[bug?\] Can't clean remote jobs from the gui if platform not set at launch

**URL:** <https://cylc.discourse.group/t/bug-cant-clean-remote-jobs-from-the-gui-if-platform-not-set-at-launch/888>\
**Category:** Cylc Support\
**Created:** [February 17, 2024, 12:16am UTC](https://cylc.discourse.group/t/bug-cant-clean-remote-jobs-from-the-gui-if-platform-not-set-at-launch/888 "2024-02-17T00:16:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abarral](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@abarral](https://cylc.discourse.group/u/abarral)\
**Post date:** [February 17, 2024, 12:16am UTC](https://cylc.discourse.group/t/bug-cant-clean-remote-jobs-from-the-gui-if-platform-not-set-at-launch/888/1 "2024-02-17T00:16:22Z")

</div>

Following the wonderful help I received [here](https://cylc.discourse.group/t/metomi-missing-when-running-on-remote-host/887/7), I’m now able to run jobs from on my remote cluster, orchestrated from my local computer.

However if I tried to clean them (after they’re stopped) _from the web GUI_, I got:

```bash
Command failed: clean - CylcError: Clean failed:
Workflow: basic_cycle_python/run1
Error: Cannot clean my_flow/run1 on remote platforms as the workflow database is out of date/inconsistent with the global config - No matching platform "ada" found

```

However, if I used `cylc clean my_flow` (from my local machine, same as the GUI), then everything worked fine:

```bash
INFO - Cleaning basic_cycle_python/run1 on install target: ada
INFO - [ada]
    INFO - Removing directory: /home/[xxx]/cylc-run/my_flow/run1
    INFO - Removing directory: /home/[xxx]/cylc-run/my_flow
INFO - Removing directory: /home/[xxx]/cylc-run/my_flow/run1
INFO - Removing directory: /home/[xxx]/cylc-run/my_flow/_cylc-install
INFO - Removing directory: /home/[xxx]/cylc-run/my_flow

```

After a bit of fiddling around, here’s what I think happens: for some reason, the GUI sources `global.cylc` at launch. If a platform is added _after_ the GUI is launched, then the GUI won’t recognize it, and won’t allow cleaning.

This clearly feels like a bug, since for every other command (start/stop, kill, …) the GUI works fine.

---

<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:** [February 18, 2024, 8:31pm UTC](https://cylc.discourse.group/t/bug-cant-clean-remote-jobs-from-the-gui-if-platform-not-set-at-launch/888/2 "2024-02-18T20:31:40Z")

</div>

Yeah, I think the UI Server only loads the global config, which includes platforms definitions, at start-up.

I wouldn’t say it’s a high priority bug - platforms definitions don’t tend to change much, and you can just restart your UI Server - but I’ll post an issue on GitHub to consider periodic reloading of global config.

> <https://github.com/cylc/cylc-uiserver/issues/559>
>
> User reports GUI-initiated clean failure, due to platforms definitions being set… after UI Server start-up: 
> Ref: https://cylc.discourse.group/t/bug-cant-clean-remote-jobs-from-the-gui-if-platform-not-set-at-launch/888
> 
> Should we periodically reload the global config?

---

<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:** [February 19, 2024, 11:03am UTC](https://cylc.discourse.group/t/bug-cant-clean-remote-jobs-from-the-gui-if-platform-not-set-at-launch/888/3 "2024-02-19T11:03:35Z")

</div>

(Note, at present both workflows and `cylc gui` servers must be restarted to pick up changes to the global config)
