Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Ruby 3.1.1 #673

Open
1 task done
chrilleferna opened this issue Mar 13, 2024 · 0 comments
Open
1 task done

Crash Ruby 3.1.1 #673

chrilleferna opened this issue Mar 13, 2024 · 0 comments

Comments

@chrilleferna
Copy link

Describe the bug

I have switched to Ruby 3.1.2 from a version of Ruby 2 (which I have problem re-installing on MacOs) and have problems running wordmove 5.2.2. For example

wordmove doctor first generates a warning:

Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead.

The crashes with error:

/Users/christer/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych.rb:323:in `safe_load': wrong number of arguments (given 4, expected 1) (ArgumentError)
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/movefile.rb:31:in `fetch'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/doctor/movefile.rb:11:in `initialize'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/doctor.rb:13:in `new'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/doctor.rb:13:in `movefile'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/doctor.rb:5:in `start'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:17:in `doctor'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/exe/wordmove:6:in `<top (required)>'
	from /Users/christer/.rbenv/versions/3.1.2/bin/wordmove:25:in `load'
	from /Users/christer/.rbenv/versions/3.1.2/bin/wordmove:25:in `<main>'

Seeing the error message "wrong number of commands" I made a patch in movefile.rb line 31:

Was:
YAML.safe_load(ERB.new(File.read(found)).result, [], [], true).deep_symbolize_keys!
Changed into:
YAML.safe_load(ERB.new(File.read(found)).result).deep_symbolize_keys!

wordmove doctor now runs withour errors and I can now push plugins, themes, uploads to the production site, but wordmove crashes when I try to push the database with the following error message:

/Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/openssl.rb:152:in `public_key=': pkeys are immutable on OpenSSL 3.0 (OpenSSL::PKey::PKeyError)
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/openssl.rb:152:in `read_keyblob'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/buffer.rb:325:in `read_keyblob'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/buffer.rb:248:in `read_key'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:148:in `block (2 levels) in keys_for'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:132:in `each_line'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:132:in `block in keys_for'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:131:in `open'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:131:in `keys_for'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:61:in `block in search_in'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:61:in `each'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:61:in `flat_map'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:61:in `search_in'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/known_hosts.rb:55:in `search_for'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:98:in `host_keys'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/algorithms.rb:277:in `prepare_preferred_algorithms!'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/algorithms.rb:153:in `initialize'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:88:in `new'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:88:in `initialize'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `new'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `start'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/photocopier-1.4.1/lib/photocopier/ssh.rb:71:in `session'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/photocopier-1.4.1/lib/photocopier/ssh.rb:44:in `exec!'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh.rb:66:in `remote_run'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh.rb:79:in `download_remote_db'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh/wpcli_sql_adapter.rb:6:in `backup_remote_db!'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/deployer/ssh.rb:37:in `push_db'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:116:in `block in push'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:40:in `block in handle_options'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:39:in `each'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:39:in `handle_options'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/lib/wordmove/cli.rb:115:in `push'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	from /Users/christer/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/wordmove-5.2.2/exe/wordmove:6:in `<top (required)>'
	from /Users/christer/.rbenv/versions/3.1.2/bin/wordmove:25:in `load'
	from /Users/christer/.rbenv/versions/3.1.2/bin/wordmove:25:in `<main>'

Maybe I would need to modify the wordmove.gemspec file to update other gems?

Wordmove command

wordmove push -e production -d

Expected behavior

A clear and concise description of what you expected to happen.

movefile.yml

Paste (removing personal data) the interesting part, if any, of your movefile.yml formatting it inside a code block with yml syntax and double checking the indentation.

Exception/trace

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

Environment (please complete the following information):

  • OS: Mac OS Ventura 13.6.4
  • Ruby: 3.1.2
  • Wordmove: 5.2.2

Doctor

  • running the wordmove doctor command returns all green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant