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

Backup fails because of a NoMethodError: undefined method 'chomp' for nil:NilClass exception #671

Closed
adrenth-mixcom opened this issue Jun 1, 2015 · 3 comments

Comments

@adrenth-mixcom
Copy link

My backup job is failing. The temporary backup folder is not being emptied because of an Exception.

Using backup version 4.1.10

My logfile contains the following Exception:
(removed some sensitive information)

[2015/05/19 02:06:40][error] Model::Error: Backup for [my job] Failed!
[2015/05/19 02:06:40][error] --- Wrapped Exception ---
[2015/05/19 02:06:40][error] NoMethodError: undefined method `chomp' for nil:NilClass
[2015/05/19 02:06:40][error] 
[2015/05/19 02:06:40][error] Backtrace:
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/prompt.rb:73:in `prompt'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/methods/password.rb:57:in `ask_password'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/methods/password.rb:22:in `authenticate'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:79:in `block in authenticate'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:66:in `each'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:66:in `authenticate'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/net-ssh-2.9.2/lib/net/ssh.rb:211:in `start'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/storage/scp.rb:30:in `connection'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/storage/scp.rb:36:in `transfer!'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/storage/base.rb:35:in `perform!'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/model.rb:269:in `each'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/model.rb:269:in `block in perform!'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/model.rb:268:in `each'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/model.rb:268:in `perform!'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/lib/backup/cli.rb:156:in `perform'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
[2015/05/19 02:06:40][error]   /var/lib/gems/2.1.0/gems/backup-4.1.10/bin/backup:5:in `<top (required)>'
[2015/05/19 02:06:40][error]   /usr/local/bin/backup:23:in `load'
[2015/05/19 02:06:40][error]   /usr/local/bin/backup:23:in `<main>'
[2015/05/19 02:06:40][warn] Cleaner::Error: Cleanup Warning

Here the layout of the model being used:

Model.new(:job, 'job name) do

  archive :job do |archive|
    archive.root ...
    archive.add ...
    archive.exclude ...
  end

  archive :system do |archive|
    archive.add "/etc"
    archive.add "/var/log"
  end

  database MongoDB, :job do |db|
    db.name               = ...
    # ...
  end

  database MySQL, :job do |db|
    # ...
  end

  store_with SCP do |server|
    server.username   = "backup"
    # ...
  end

  compress_with Gzip

  notify_by Mail do |mail|
    mail.on_success           = true
    mail.on_warning           = true
    mail.on_failure           = true
  end

end

Is this information enough to fix this issue? Please let me know if you need more details.

@tombruijn
Copy link
Member

Hi @adrenth-mixcom, sorry for the month delay. Being in an accident forced me to take some time off.

I looked at the issue and it doesn't seem to be a backup issue.

It's either a configuration or network issue for SCP.
In the configuration, check if anything is defined as nil by accident. I don't have the full picture so I don't know what configuration options you're really setting.
On the net-ssh gem, which backup uses, there's an issue about the same error: net-ssh/net-ssh#234 . Maybe have a look there to see if it sounds similar?

@tombruijn
Copy link
Member

@adrenth-mixcom any update on this?

@stale
Copy link

stale bot commented Nov 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 24, 2020
@stale stale bot closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants