Skip to content

Net::SSH::AuthenticationFailed when pulling db  #659

@martin-josef

Description

@martin-josef

Describe the bug

When pulling the db (-d) (hosted on rackspeed.de) I get the following error:

Net::SSH::AuthenticationFailed when pulling db

But I can pull the files (--all --no-db) without issues.

I specified an ssh-key in ~/.ssh/config (IdentityFile ).

▬▬ Pulling Database ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    local | mysqldump --host=[secret] --user=root --result-file="[secret]/web/app/local-backup-1663235937.sql" <local-db>

    local | gzip -9 -f "[secret]/web/app/local-backup-1663235937.sql"

   remote | mysqldump --user=<db-user> --password=[secret] --result-file="[secret]/web/app/dump.sql" <db-name>
/Library/Ruby/Gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:268:in `start': Authentication failed for user <ssh user>@<ip> (Net::SSH::AuthenticationFailed)
	from /Library/Ruby/Gems/2.6.0/gems/photocopier-1.4.0/lib/photocopier/ssh.rb:71:in `session'
	from /Library/Ruby/Gems/2.6.0/gems/photocopier-1.4.0/lib/photocopier/ssh.rb:44:in `exec!'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh.rb:66:in `remote_run'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh.rb:79:in `download_remote_db'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh/wpcli_sql_adapter.rb:34:in `adapt_remote_db!'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh.rb:48:in `pull_db'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:92:in `block in pull'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:40:in `block in handle_options'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:39:in `each'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:39:in `handle_options'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:91:in `pull'
	from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/exe/wordmove:6:in `<top (required)>'
	from /usr/local/bin/wordmove:23:in `load'
	from /usr/local/bin/wordmove:23:in `<main>'

Wordmove command

wordmove pull -e production -d

Expected behavior

I expected word move to pull the db.

movefile.yml

.env-file:

# ---- PRODUCTION env ('production') ----

### host & path
PROD_VHOST="<ip>"
PROD_PATH="<path>"

### database
PROD_DB_NAME="<db-name>"
PROD_DB_USER="<db-user>"
PROD_DB_PASS="<db-pass>"

### ssh
PROD_DB_SSH_HOST="<ssh-host>"
PROD_DB_SSH_USER="<ssh-user>"

movefile:

# ---- Production ---- #

production:
  vhost: '<%= ENV['PROD_VHOST'] %>'
  wordpress_path: '<%= ENV['PROD_PATH'] %>' # use an absolute path here

  database:
    name: '<%= ENV['PROD_DB_NAME'] %>'
    user: '<%= ENV['PROD_DB_USER'] %>'
    password: '<%= ENV['PROD_DB_PASS'] %>'
    host: '<%= ENV['PROD_DB_HOST'] %>'

  paths:
    wp_content: 'web/app' # wp_content
    mu_plugins: 'web/app/mu-plugins'
    plugins:  'web/app/plugins'
    themes: 'web/app/themes'
    uploads: 'web/app/uploads'
    languages: 'web/app/languages'

  ssh:
    host: '<%= ENV['PROD_DB_SSH_HOST'] %>'
    user: '<%= ENV['PROD_DB_SSH_USER'] %>'

Exception/trace

Paste (removing personal data) the entire trace of error/exception you encountered, if any

Environment (please complete the following information):

  • OS: macOS 12.6 (Silicon M1 Mac)
  • Ruby: ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
  • Wordmove: 5.2.2

Doctor

  • running the wordmove doctor command returns all green

(If it is not, report the error you got.)

▬▬�[0;97;49m Checking local database commands and connection �[0m▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

�[0;32;49m    ✅  success�[0m�[0;30;49m | �[0m`mysql` command is in $PATH

�[0;32;49m    ✅  success�[0m�[0;30;49m | �[0m`mysqldump` command is in $PATH

�[0;31;49m    ❌  error�[0m�[0;30;49m | �[0m  We can't connect to the MySQL server using credentials
                specified in the Movefile. Double check them or try
                to debug your system configuration.

                The command used to test was:

                mysql -e'QUIT'


�[0;31;49m    ❌  error�[0m�[0;30;49m | �[0m  We can't connect to the database using credentials
                specified in the Movefile, or the database does not
                exists. Double check them or try to debug your
                system configuration.

                The command used to test was:

                mysql -e'QUIT'

To add, this configuration (.env, movefile) works with other hosts flawlessly. This is rackspeed specific.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions