backup/backup

OpenSSL::PKey hasn't method p= for RUBY 2.5.1

AleksandrLeontev opened this issue · 3 comments

What went wrong?

[2018/07/13 11:54:03][info] Storage::SCP Started...
/home/deployer/.rvm/gems/ruby-2.5.1@gemset_name/gems/net-ssh-3.2.0/lib/net/ssh/transport/cipher_factory.rb:97: warning: constant OpenSSL::Cipher::Cipher is deprecated
[2018/07/13 11:54:03][error] Model::Error: Backup for Production backup (db_backup) Failed!
[2018/07/13 11:54:03][error] --- Wrapped Exception ---
[2018/07/13 11:54:03][error] NoMethodError: undefined method p=' for #<OpenSSL::PKey::DH:0x00005608b958d488> [2018/07/13 11:54:03][error] Did you mean? p [2018/07/13 11:54:03][error] [2018/07/13 11:54:03][error] Backtrace: [2018/07/13 11:54:03][error] /home/deployer/.rvm/gems/ruby-2.5.1@gemset_name/gems/net-ssh-3.2.0/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:118:in generate_key'
[2018/07/13 11:54:03][error] /home/deployer/.rvm/gems/ruby-2.5.1@gemset_name/gems/net-ssh-3.2.0/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb:51:in initialize' [2018/07/13 11:54:03][error] /home/deployer/.rvm/gems/ruby-2.5.1@gemset_name/gems/net-ssh-3.2.0/lib/net/ssh/transport/algorithms.rb:362:in new'

What steps did you follow?

I started backup process

  1. gem install backup --version 5.0.0.beta.2
  2. backup check -> Configuration Check Succeeded
  3. backup perform --trigger db_backup -> Catch the error described above

How is your copy of backup configured?

**Please attach the config.rb file that backup is using, and any relevant model files from the # load login info
db_config = YAML.load_file('/home/<...>/shared/config/database.yml')['production']

Model.new(:db_backup, 'Production backup') do

Gzip [Compressor]

compress_with Gzip

PostgreSQL [Database]

database PostgreSQL do |db|
db.name = db_config['database']
db.username = db_config['username']
db.password = db_config['password']
db.host = db_config['host']
db.additional_options = ["--column-inserts", "--no-owner", "--no-privileges"]
end

SCP (Secure Copy) [Storage]

store_with SCP do |server|
server.username = "...."
server.password = "...."
server.ip = "...."
server.port = 22
server.path = "~/production_backups/"
server.keep = 5
end

Slack [Notifier]

notify_by Slack do |slack|
slack.on_success = true
slack.on_warning = true
slack.on_failure = true

# The incoming webhook url
slack.webhook_url = '...'
slack.icon_emoji = ':ghost:'
slack.message = lambda do |model, data|
  "[#{data[:status][:message]}] #{model.label} (#{model.trigger})"
end

end

end

Tell us about the computer that runs the backup gem

Change the information below to match the details of your computer

  • Operating system: Ubuntu Server 18.04
  • Ruby version: 2.5.1
  • Tools or services used by backup: PostgreSQL 10.4

In general I think it is linked with OpenSSL::PKey which hasn't some methods in RUBY 2.5.1
What can you advice?
P.S.: But I don't want to use ruby less than 2.5.1

I fixed the problem by using ruby 2.3.8 for this gem.

damm commented

@jusantana yeah unfortunately the backup gem hasn't been updated in some time and people are running into it breaking on newer than 2.3 ruby.

the json gem is normally what I see.

wish they released the pre-release as a final version