Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: run command removes saved servers (without --force) #32

Open
svicalifornia opened this issue Jun 24, 2022 · 0 comments · May be fixed by #33
Open

Bug: run command removes saved servers (without --force) #32

svicalifornia opened this issue Jun 24, 2022 · 0 comments · May be fixed by #33

Comments

@svicalifornia
Copy link

svicalifornia commented Jun 24, 2022

If there is already a saved server config for myapp, and a user runs the run command for another server named myapp, chalet will correctly report the name conflict:

Configuration already exists with name 'fp2' (use -f to force creation)

However, it then proceeds to run the specified command anyway, and when that command exits, it proceeds to remove the config file for the previously saved myapp server — thereby removing the myapp server from chalet.

This result is very destructive and unexpected — especially since chalet is already detecting the name collision. A previously saved server should never be modified or removed by the run command unless the --force option is given.

Even worse, this can happen even if the run command does not specify a -n/--name option — because it will use the current directory name as the default server name and will proceed to remove any saved server matching that name.

Unless the --force option is given, then there currently is no clean way to run a server (specified or derived from cwd) with the same name as an existing server, since the run command currently works by writing to a temporary config file (and thus would overwrite the existing server's config file). Therefore, if such a name collision is detected, then the run command should display the name-collision error message (as shown above) and then exit immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant