welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 165 forks source link

"Error: This does not seem to be a WordPress installation" when using sql_adapter: wpcli #648

Closed n8sb closed 2 years ago

n8sb commented 2 years ago

When running "wordmove push -e staging -d" I get the following error:

▬▬ Pushing Database ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

   remote | mysqldump --host=[secret] --user=wordpress --password=[secret] --result-file="[secret]wp-content/dump.sql" wp_f1rst_staging

   remote | gzip -9 -f "[secret]wp-content/dump.sql"

   remote | get: [secret]wp-content/dump.sql.gz [secret]wp-content/staging-backup-1645859494.sql.gz

   remote | delete: [secret]wp-content/dump.sql.gz

    local | mysqldump --host=[secret] --user=[secret] --password=[secret] --result-file="[secret]wp-content/dump.sql" --socket /Users/natebennett/Library/Application\ Support/Local/run/5w_uuyXS1/mysql/mysqld.sock local
mysqldump: [Warning] Using a password on the command line interface can be insecure.

    local | adapt dump for vhost

    local | wp search-replace --path=[secret] [secret] [secret] --quiet --skip-columns=guid --all-tables --allow-[secret]
Error: This does not seem to be a WordPress installation.
Pass --path=`path/to/wordpress` or run `wp core download`.
/Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/deployer/base.rb:95:in `run': Return code reports an error (Wordmove::ShellCommandError)
        from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh/wpcli_sql_adapter.rb:11:in `adapt_local_db!'
        from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh.rb:38:in `push_db'
        from /Library/Ruby/Gems/2.6.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:116:in `block in push'
        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:115:in `push'
        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>'

Using "sql_adapter: default" pushes the DB completely without error, but it is not replacing file url's correctly because it doesn't appear to be attempting to execute search-replace so I would like to use wp-cli instead.

movefile.yml

global:
  sql_adapter: wpcli

local:
  vhost: "http://f1rst.local"
  wordpress_path: "/Users/xxx/Local\ Sites/xxx/app/public/" # use an absolute path here

  database:
    name: "local"
    user: "root"
    password: "root" # could be blank, so always use quotes around
    host: "localhost"
    mysqldump_options: '--socket "/Users/xxx/Library/Application\ Support/Local/run/5w_uuyXS1/mysql/mysqld.sock"'
    mysql_options: '--socket "/Users/xxx/Library/Application\ Support/Local/run/5w_uuyXS1/mysql/mysqld.sock"'

staging:
  vhost: "https://staging.xxx"
  wordpress_path: "/var/www/staging.xxx/html/" # use an absolute path here

  database:
    name: "xxx"
    user: "xxx"
    password: "xxx"
    host: "localhost"

  exclude:
    - ".htaccess"
    - ".git/"
    - ".gitignore"
    - ".gitmodules"
    - ".env"
    - "node_modules/"
    - "bin/"
    - "tmp/*"
    - "Gemfile*"
    - "Movefile"
    - "movefile"
    - "movefile.yml"
    - "movefile.yaml"
    - "wp-config.php"
    - "wp-content/*.sql.gz"
    - "*.orig"
    - "wp-content/plugins/cache-enabler/"

  ssh:
    host: 159.203.191.61
    user: "root"
    port: 22

production:
  vhost: "https://xxx"
  wordpress_path: "/var/www/xxx/html/" # use an absolute path here

  database:
    name: "xxx"
    user: "xxx"
    password: "xxx"
    host: "localhost"

  exclude:
    - ".htaccess"
    - ".htpasswd"
    - ".git/"
    - ".gitignore"
    - ".gitmodules"
    - ".env"
    - "node_modules/"
    - "bin/"
    - "tmp/*"
    - "Gemfile*"
    - "Movefile"
    - "movefile"
    - "movefile.yml"
    - "movefile.yaml"
    - "wp-config.php"
    - "wp-content/*.sql.gz"
    - "wp-content/plugins/cache-enabler/"
    - "*.orig"

  ssh:
    host: 159.203.191.61
    user: "root"
    port: 22

Exception/trace

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

Environment (please complete the following information):

Doctor

▬▬ Validating movefile section: global ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ✅  success | Formal validation passed

▬▬ Validating movefile section: local ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ❌  error | [/database/mysql_options] key 'mysql_options:' is undefined.

▬▬ Validating movefile section: staging ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ✅  success | Formal validation passed

▬▬ Validating movefile section: production ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ✅  success | Formal validation passed

▬▬ Using Movefile: ./movefile.yml ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▬▬ Checking local database commands and connection ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ✅  success | `mysql` command is in $PATH

    ✅  success | `mysqldump` command is in $PATH

    ❌  error |   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 --host=localhost --user=root --password=root -e'QUIT'

    ❌  error |   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 --host=localhost --user=root --password=root local -e'QUIT'

▬▬ Checking local wp-cli installation ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ✅  success | wp-cli is correctly installed
PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 63
PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 73
PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 89
PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 102
PHP Deprecated:  Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Cookie/Jar.php on line 111
PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 40
PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 51
PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 68
PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 82
PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php on line 91

    ❌  error |   wp-cli is not up to date.
                Use `wp cli update` to update to the latest version.

▬▬ Checking rsync ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ✅  success | rsync is installed at version 2.6.9

▬▬ Checking SSH client ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    ✅  success | SSH command found
n8sb commented 2 years ago

Figured it out. Had to change Local (by Flywheel) home folder to LocalSites (from Local Sites) for wp-cli to recognize the wordpress installation folder correctly.

alessandro-fazzi commented 2 years ago

Hi,

since you were already escaping the space into you movefile.yml, the error was unexpected. BTW I'm glad you solved and I think that Local's default path should really be updated to be more command line friendly :)

Doctor's error on database are there due to a known bug; sorry for that.

I'm going to close because you said you solved, but feel free to reopen at your will.

derby commented 2 years ago

I have the same problem. Is there no way to use a path with white space characters?