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

Too many arguments error with vvv-wordmove #636

Closed colin-marshall closed 2 years ago

colin-marshall commented 2 years ago

Describe the bug Get the following error when running most wordmove commands. I'm using VVV and your vvv-wordmove utility. I have used in the past and it worked fine.

vagrant@vvv:/srv/www/mywebsite/public_html$ wordmove pull -e production -u
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
/snap/ruby/247/lib/ruby/3.1.0/psych.rb:323:in `safe_load': wrong number of arguments (given 4, expected 1) (ArgumentError)
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/movefile.rb:30:in `fetch'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/movefile.rb:46:in `environment'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/movefile.rb:34:in `load_dotenv'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/deployer/base.rb:11:in `deployer_for'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/cli.rb:81:in `pull'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/exe/wordmove:6:in `<top (required)>'
    from /home/vagrant/.gem/bin/wordmove:25:in `load'
    from /home/vagrant/.gem/bin/wordmove:25:in `<main>'

Wordmove command wordmove list wordmove doctor wordmove pull -e production (and any other flags)

Expected behavior

movefile.yml

global:
  sql_adapter: wpcli

local:
  vhost: https://mywebsite.test
  wordpress_path: /srv/www/mywebsite/public_html # use an absolute path here

  database:
    name: wp
    user: wp
    password: "wp" # could be blank, so always use quotes around
    host: localhost

production:
  vhost: https://mywebsite.com
  wordpress_path: /home/www/mywebsite.com/public_html # use an absolute path here

  database:
    name: wp
    user: wp
    password: pass
    host: myhost.com
    # port: 3308 # Use just in case you have exotic server config
    # mysqldump_options: '--max_allowed_packet=1G' # Only available if using SSH
    # mysql_options: '--protocol=TCP' # mysql command is used to import db

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

  # paths: # you can customize wordpress internal paths
  #   wp_content: wp-content
  #   uploads: wp-content/uploads
  #   plugins: wp-content/plugins
  #   mu_plugins: wp-content/mu-plugins
  #   themes: wp-content/themes
  #   languages: wp-content/languages

  ssh:
    host: mywebsite.com
    user: user
  #   password: password # password is optional, will use public keys if available.
    port: 18765 # Port is optional
    rsync_options: '--verbose --itemize-changes --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r' # Additional rsync options, optional
  #   gateway: # Gateway is optional
  #     host: host
  #     user: user
  #     password: password # password is optional, will use public keys if available.

  # ftp:
  #   user: user
  #   password: password
  #   host: host
  #   passive: true
  #   port: 21 # Port is optional
  #   scheme: ftps # default `ftp`. alternative `sftp`

  # hooks: # Remote hooks won't work with FTP
  #   push:
  #     before:
  #       local:
  #         - 'echo "Do something locally before push"'
  #       remote:
  #         - 'echo "Do something remotely before push"'
  #     after:
  #       local:
  #         - 'echo "Do something locally after push"'
  #       remote:
  #         - 'echo "Do something remotely after push"'
  #   pull:
  #     before:
  #       local:
  #         - 'echo "Do something locally before pull"'
  #       remote:
  #         - 'echo "Do something remotely before pull"'
  #     after:
  #       local:
  #         - 'echo "Do something locally after pull"'
  #       remote:
  #         - 'echo "Do something remotely after pull"'
  # forbid:
  #   push:
  #     db: false
  #     plugins: false
  #     themes: false
  #     languages: false
  #     uploads: false
  #     mu-plugins: false
  #   pull:
  #     db: false
  #     plugins: false
  #     themes: false
  #     languages: false
  #     uploads: false
  #     mu-plugins: false

# staging: # multiple environments can be specified
#   [...]

Exception/trace

Shown in first section

Environment (please complete the following information):

Doctor

vagrant@vvv:/srv/www/mywebsite/public_html$ wordmove doctor
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
        .------------------------.
        |       PSYCHIATRIC      |
        |         HELP  5¢       |
        |________________________|
        ||     .-"""--.         ||
        ||    /        \.-.     ||
        ||   |     ._,     \    ||
        ||   \_/`-'   '-.,_/    ||
        ||   (_   (' _)') \     ||
        ||   /|           |\    ||
        ||  | \     __   / |    ||
        ||   \_).,_____,/}/     ||
      __||____;_--'___'/ (      ||
     |\ ||   (__,\\    \_/------||
     ||\||______________________||
     ||||                        |
     ||||       THE DOCTOR       |
     \|||         IS [IN]   _____|
      \||                  (______)
       `|___________________//||\\
                           //=||=\\
                           `  ``  `

▬▬ Using Movefile: ./Movefile.yml ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
/snap/ruby/247/lib/ruby/3.1.0/psych.rb:323:in `safe_load': wrong number of arguments (given 4, expected 1) (ArgumentError)
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/movefile.rb:30:in `fetch'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/doctor/movefile.rb:11:in `initialize'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/doctor.rb:13:in `new'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/doctor.rb:13:in `movefile'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/doctor.rb:5:in `start'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/lib/wordmove/cli.rb:17:in `doctor'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    from /home/vagrant/.gem/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
    from /home/vagrant/.gem/gems/wordmove-5.2.2/exe/wordmove:6:in `<top (required)>'
    from /home/vagrant/.gem/bin/wordmove:25:in `load'
    from /home/vagrant/.gem/bin/wordmove:25:in `<main>'
alessandro-fazzi commented 2 years ago

Hi @colin-marshall ,

please downgrade your installed ruby version to 3.0.3 and it should come back.

Wordmove 5.x should actually be fixed by restricting supported ruby version to < 3.1.

lemme know if it helps.

colin-marshall commented 2 years ago

Thanks @pioneerskies! That fixed it.

I put in a PR on https://github.com/welaika/vvv-wordmove to lock in version 3.0 for the vvv utlity.

alessandro-fazzi commented 2 years ago

@colin-marshall I merged the PR 🎉

Close this issue if you think we're done ;)