Describe the bug
If a non-existent suite is provided as the argument to cylc run, a suite directory & partially-populated .service sub-directory to it will be created under cylc-run/, before the command aborts the run with an error because it cannot locate a suite.rc file (in the very directory it just created without one)!
This means that every time a user makes a typo for a suite names, it will result in a redundant directory, & over time that could easily lead to a collection of them clogging up cylc-run/ (or users will go in to manually housekeep on each occurrence, but they should not have to).
Release version(s) and/or repository branch(es) affected?
8.0a1, via the current master branch, but I have also observed this on 7.X.
Steps to reproduce the bug
Execute cylc run with the name of an invalid suite, e.g. one which does not have a suite directory defined under cylc-run/, & observe the suite directory created in that name under cylc-run after the command exits.
For example, you should see (using no-such-suite-exists as an example name for the suite I have not registered locally):
$ cylc run no-such-suite-exists --debug
2019-10-10T15:51:47+01:00 DEBUG - Loading site/user config
files
2019-10-10T15:51:47+01:00 DEBUG - Generated
/home/h06/sbarth/cylc-run/no-such-suite-exists/.service/passphrase
2019-10-10T15:51:47+01:00 DEBUG - Extracting etc/job.sh to
/home/h06/sbarth/cylc-run/no-such-suite-exists/.service/etc/job.sh
2019-10-10T15:51:47+01:00 DEBUG - Loading site/user config
files
SuiteServiceFileError: no suite.rc in /home/h06/sbarth/cylc-run/no-such-suite-exists
As indicated from the debug information, a suite directory with a .service is created (looking at the above, it seems likely a os.makedirs() or similar has been used to make the force-create parent directories leading partly to the issue):
$ ls -a ~/cylc-run/no-such-suite-exists/.service/
. .. etc passphrase
Expected behavior
With an invalid suite argument (<name>), cylc run should not create a suite directory nor a .service within, & instead abort immediately with an error message such as "No valid suite directory found for \
Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read CONTRIBUTING.md before starting any work though).
I am quite sure I reported a similar bug some time ago and I think someone told me it was the expected behaviour... though I don't trust my memory, so let me look at the archives...
Ah, I think that's not the same issue, though only a bit similar https://github.com/cylc/cylc-flow/issues/3097
Ah, sorry @kinow that does indeed report (IMO, the very same) issue to this. I must have missed it when searching through existing GH Issues, possibly because my searches were based mainly around the keywords 'cylc run' & it looks like you missed the 'run' keyword in the command you quoted in the opening comment there.
So I can close this as duplicate.
I think someone told me it was the expected behaviour...
I really do not think it should be the default, though looking at the referenced Issue nobody seems to claim it is there.
@sadielbartholomew - yep pretty sure this isn't the intended behaviour (otherwise presumably we would have closed the other issue).