Handling Missing ~/.ssh Host entries can be improved #570

Open
opened 2024-02-11 16:52:53 +00:00 by basebuilder · 1 comment
Member

When adding a new server via abra the process is not as user friendly as it can be #537. The requirement 1. a server with SSH access... implies simply being able to run ssh user@website.org and be into a server. However, as the Docs mention later:

... You should have a working SSH configuration before you can do this (e.g. a matching Host <server-domain> entry in ~/.ssh/config with the correct SSH connection details) ...

This is not as clear as it can be (as it needs a specifically formatted host entry #566). When following the New Operators Tutorial for the second time, I made the mistake to not add an SSH entry which then threw the following stacktrace.

$ abra server add website.org
INFO[0000] successfully created /home/user/.abra/servers/website.org 
panic: runtime error: index out of range [2] with length 2

goroutine 1 [running]:
coopcloud.tech/abra/pkg/ssh.GetHostConfig({0x7ffde86dc163, 0xd})
	/home/decentral1se/work/coop-cloud/abra/pkg/ssh/ssh.go:50 +0x5d5
coopcloud.tech/abra/cli/server.glob..func1(0xc0001f9b80)
	/home/decentral1se/work/coop-cloud/abra/cli/server/add.go:161 +0x305
github.com/urfave/cli.HandleAction({0xd69820?, 0xf893e8?}, 0x3?)
	/home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 +0x50
github.com/urfave/cli.Command.Run({{0xed6fcc, 0x3}, {0x0, 0x0}, {0x1701ab0, 0x1, 0x1}, {0xf0c226, 0x22}, {0x0, ...}, ...}, ...)
	/home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:173 +0x63e
github.com/urfave/cli.(*App).RunAsSubcommand(0xc00022b6c0, 0xc0001f9760)
	/home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:405 +0xdc7
github.com/urfave/cli.Command.startApp({{0xedaf64, 0x6}, {0x0, 0x0}, {0x1701af0, 0x1, 0x1}, {0xef2006, 0xe}, {0x0, ...}, ...}, ...)
	/home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:378 +0xb58
github.com/urfave/cli.Command.Run({{0xedaf64, 0x6}, {0x0, 0x0}, {0x1701af0, 0x1, 0x1}, {0xef2006, 0xe}, {0x0, ...}, ...}, ...)
	/home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:102 +0x7e5
github.com/urfave/cli.(*App).Run(0xc00022afc0, {0xc0001d6040, 0x4, 0x4})
	/home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:277 +0xb07
coopcloud.tech/abra/cli.RunApp({0x1090018?, 0x1695f58?}, {0x1099d60?, 0xc0000061a0?})
	/home/decentral1se/work/coop-cloud/abra/cli/cli.go:203 +0x37
main.main()
	/home/decentral1se/work/coop-cloud/abra/cmd/abra/main.go:22 +0xa9

This is a confusing UX. The first message written is INFO[0000] successfully created... the result is an empty folder and is added to the servers list. I see two viable things to slightly improve the UX for new Operator onboarding and abra

  • Docs: specify a clear step Step 1. Create SSH host entry
  • abra: show a nice help error message such as
$ abra server add website.org
ERROR[0000] unable to create /home/user/.abra/servers/website.org

Please make sure you have an entry in your ~/.ssh/config file like

host website.org
    HostName website.org
    User root
    ...
When adding a new server via abra the process is not as user friendly as it can be #537. The requirement `1. a server with SSH access...` implies simply being able to run `ssh user@website.org` and be into a server. However, as the Docs mention later: ``` ... You should have a working SSH configuration before you can do this (e.g. a matching Host <server-domain> entry in ~/.ssh/config with the correct SSH connection details) ... ``` This is not as clear as it can be (as it needs a specifically formatted `host` entry #566). When following the [New Operators Tutorial](https://docs.coopcloud.tech/operators/tutorial/#deploy-your-first-app) for the second time, I made the mistake to not add an SSH entry which then threw the following stacktrace. ``` $ abra server add website.org INFO[0000] successfully created /home/user/.abra/servers/website.org panic: runtime error: index out of range [2] with length 2 goroutine 1 [running]: coopcloud.tech/abra/pkg/ssh.GetHostConfig({0x7ffde86dc163, 0xd}) /home/decentral1se/work/coop-cloud/abra/pkg/ssh/ssh.go:50 +0x5d5 coopcloud.tech/abra/cli/server.glob..func1(0xc0001f9b80) /home/decentral1se/work/coop-cloud/abra/cli/server/add.go:161 +0x305 github.com/urfave/cli.HandleAction({0xd69820?, 0xf893e8?}, 0x3?) /home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 +0x50 github.com/urfave/cli.Command.Run({{0xed6fcc, 0x3}, {0x0, 0x0}, {0x1701ab0, 0x1, 0x1}, {0xf0c226, 0x22}, {0x0, ...}, ...}, ...) /home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:173 +0x63e github.com/urfave/cli.(*App).RunAsSubcommand(0xc00022b6c0, 0xc0001f9760) /home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:405 +0xdc7 github.com/urfave/cli.Command.startApp({{0xedaf64, 0x6}, {0x0, 0x0}, {0x1701af0, 0x1, 0x1}, {0xef2006, 0xe}, {0x0, ...}, ...}, ...) /home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:378 +0xb58 github.com/urfave/cli.Command.Run({{0xedaf64, 0x6}, {0x0, 0x0}, {0x1701af0, 0x1, 0x1}, {0xef2006, 0xe}, {0x0, ...}, ...}, ...) /home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:102 +0x7e5 github.com/urfave/cli.(*App).Run(0xc00022afc0, {0xc0001d6040, 0x4, 0x4}) /home/decentral1se/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:277 +0xb07 coopcloud.tech/abra/cli.RunApp({0x1090018?, 0x1695f58?}, {0x1099d60?, 0xc0000061a0?}) /home/decentral1se/work/coop-cloud/abra/cli/cli.go:203 +0x37 main.main() /home/decentral1se/work/coop-cloud/abra/cmd/abra/main.go:22 +0xa9 ``` This is a confusing UX. The first message written is `INFO[0000] successfully created...` the result is an empty folder and is added to the servers list. I see two viable things to slightly improve the UX for new Operator onboarding and `abra` - [ ] Docs: specify a clear step `Step 1. Create SSH host entry` - [ ] abra: show a nice help error message such as ``` $ abra server add website.org ERROR[0000] unable to create /home/user/.abra/servers/website.org Please make sure you have an entry in your ~/.ssh/config file like host website.org HostName website.org User root ... ```
basebuilder added the
bug
documentation
abra
labels 2024-02-11 16:52:53 +00:00
Owner

Oh yeh, totally agree 🤘 Great Report ™

Oh yeh, totally agree 🤘 Great Report ™
decentral1se added the
good first issue
label 2024-02-11 17:56:03 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#570
No description provided.