abra app secret generate tries to look up SSH host keys for an unrelated server #242

Closed
opened 2021-11-09 12:41:16 +00:00 by 3wordchant · 4 comments
Owner

Steps to reproduce

abra app new minio
# choose server demo.coopcloud.tech, accept defaults for others
abra app secret generate --all --pass minio_demo_coopcloud_tech

Describe the expected behavior

Secrets generated, and stored on demo.coopcloud.tech

Describe the current behavior

➜ abra app secret generate --all --pass minio_demo_coopcloud_tech

You are attempting to make an SSH connection to a server but there is no entry
in your ~/.ssh/known_hosts file which confirms that this is indeed the server
you want to connect to. Please take a moment to validate the following SSH host
key, it is important.

    Host:        centreforthestudyof.net
    Fingerprint: SHA256:vO418MfU0mq0fyrKGawGmQ9Jy6ABGkqn8Zw3cLixxUs

I indeed do not have centreforthestudyof.net in ~/.ssh/authorized_keys, but I do have demo.coopcloud.tech.

Any idea how this might be fixed?

Maybe it's scanning all servers instead of just the one it needs to access for the app secret generate command?

Additional information

abra version dev-9fa2cae

## Steps to reproduce ``` abra app new minio # choose server demo.coopcloud.tech, accept defaults for others abra app secret generate --all --pass minio_demo_coopcloud_tech ``` ## Describe the expected behavior Secrets generated, and stored on demo.coopcloud.tech ## Describe the current behavior ``` ➜ abra app secret generate --all --pass minio_demo_coopcloud_tech You are attempting to make an SSH connection to a server but there is no entry in your ~/.ssh/known_hosts file which confirms that this is indeed the server you want to connect to. Please take a moment to validate the following SSH host key, it is important. Host: centreforthestudyof.net Fingerprint: SHA256:vO418MfU0mq0fyrKGawGmQ9Jy6ABGkqn8Zw3cLixxUs ``` I indeed do not have `centreforthestudyof.net` in `~/.ssh/authorized_keys`, but I do have `demo.coopcloud.tech`. ## Any idea how this might be fixed? Maybe it's scanning all servers instead of just the one it needs to access for the `app secret generate` command? ## Additional information <!-- run "abra -v" on the command-line --> `abra version dev-9fa2cae`
3wordchant added the
bug
abra
labels 2021-11-09 12:41:16 +00:00
Author
Owner

Related: if I accept the host key, the command then fails on another server:

DEBU[0005] no hostname found in SSH config, assuming mutualnudes.net  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/ssh/ssh.go:519 GetHostConfig"
DEBU[0005] constructed SSH config {mutualnudes.net  22 f} for mutualnudes.net  caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/ssh/ssh.go:550 GetHostConfig"
FATA[0010] dial tcp 35.185.44.232:22: i/o timeout        caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/internal/validate.go:94 ValidateApp" stack="/home/f/Projects/Autonomic/CoopCloud/abra/cli/internal/validate.go:94 ValidateApp\n/home/f/Projects/Autonomic/CoopCloud/abra/cli/app/secret.go:36        glob..func26\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163    (*Command).Run\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434        (*App).RunAsSubcommand\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278    (*Command).startApp\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94     (*Command).Run\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434        (*App).RunAsSubcommand\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278    (*Command).startApp\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94     (*Command).Run\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313        (*App).RunContext\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224        RunApp\n/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:119              RunApp\n/home/f/Projects/Autonomic/CoopCloud/abra/cmd/abra/main.go:23         main\n/usr/lib/golang/src/runtime/proc.go:225                               main\n/usr/lib/golang/src/runtime/asm_amd64.s:1371                          goexit"
Related: if I accept the host key, the command then fails on another server: ``` DEBU[0005] no hostname found in SSH config, assuming mutualnudes.net caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/ssh/ssh.go:519 GetHostConfig" DEBU[0005] constructed SSH config {mutualnudes.net 22 f} for mutualnudes.net caller="/home/f/Projects/Autonomic/CoopCloud/abra/pkg/ssh/ssh.go:550 GetHostConfig" FATA[0010] dial tcp 35.185.44.232:22: i/o timeout caller="/home/f/Projects/Autonomic/CoopCloud/abra/cli/internal/validate.go:94 ValidateApp" stack="/home/f/Projects/Autonomic/CoopCloud/abra/cli/internal/validate.go:94 ValidateApp\n/home/f/Projects/Autonomic/CoopCloud/abra/cli/app/secret.go:36 glob..func26\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 (*Command).Run\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434 (*App).RunAsSubcommand\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278 (*Command).startApp\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94 (*Command).Run\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434 (*App).RunAsSubcommand\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278 (*Command).startApp\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94 (*Command).Run\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 (*App).RunContext\n/home/f/.go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 RunApp\n/home/f/Projects/Autonomic/CoopCloud/abra/cli/cli.go:119 RunApp\n/home/f/Projects/Autonomic/CoopCloud/abra/cmd/abra/main.go:23 main\n/usr/lib/golang/src/runtime/proc.go:225 main\n/usr/lib/golang/src/runtime/asm_amd64.s:1371 goexit" ```
Owner

Hmm right yep, I see the place I've hooked in for host checking is not working for here and other commands. I'm gonna work it into each command where appropriate, seems to be a few cases to be handled. Fix coming shortly.

Hmm right yep, I see the place I've hooked in for host checking is not working for here and other commands. I'm gonna work it into each command where appropriate, seems to be a few cases to be handled. Fix coming shortly.
Owner

@3wordchant if you could test 6f26b51f3e that'd be great!

@3wordchant if you could test https://git.coopcloud.tech/coop-cloud/abra/commit/6f26b51f3e46b17c235da2df4eadaae90aefbc73 that'd be great!
decentral1se added the
awaiting-feedback
label 2021-11-13 22:17:37 +00:00
Author
Owner

Yeah that's working fine now, nice one! 🎊

Yeah that's working fine now, nice one! 🎊
decentral1se removed the
awaiting-feedback
label 2021-11-20 14:37:16 +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#242
No description provided.