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

Adding keep number causes cycler to fail #709

Closed
MattCastellana opened this issue Oct 8, 2015 · 8 comments
Closed

Adding keep number causes cycler to fail #709

MattCastellana opened this issue Oct 8, 2015 · 8 comments

Comments

@MattCastellana
Copy link

Just set up backup for the first time, ran the default generator and set up a simple backup, ran it and got this error:

[2015/10/08 19:32:41][info] Storage::Local Started...
[2015/10/08 19:32:41][info] Storing '/Users/Matthew/backups/my_backup/2015.10.08.19.31.35/my_backup.tar'...
[2015/10/08 19:32:41][info] Cycling Started...
[2015/10/08 19:32:41][error] Model::Error: Backup for Description for my_backup (my_backup) Failed!
[2015/10/08 19:32:41][error] --- Wrapped Exception ---
[2015/10/08 19:32:41][error] ArgumentError: negative array size
[2015/10/08 19:32:41][error]
[2015/10/08 19:32:41][error] Backtrace:
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/storage/cycler.rb:25:in `last'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/storage/cycler.rb:25:in `cycle!'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/storage/base.rb:47:in `perform!'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:334:in `block in store!'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:332:in `map'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:332:in `store!'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:306:in `block in procedures'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:269:in `call'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:269:in `block in perform!'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:268:in `each'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/model.rb:268:in `perform!'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/lib/backup/cli.rb:156:in `perform'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/gems/backup-4.2.1/bin/backup:5:in `<top (required)>'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/bin/backup:23:in `load'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/bin/backup:23:in `<main>'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
[2015/10/08 19:32:41][error]   /Users/Matthew/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

After some debug, I found that the local.keep = 5 command was failing. I've tried it with different numbers, same result. If I disable the keep completely, the backup works perfectly.

Not sure if this is an issue with my configuration, or if this is a bug. Considering this is a very simple backup, I assume it's a bug.

My specs: Mac OSX 10.11 El Capitan, Backup 4.2.1 : ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]

My backup file:

# encoding: utf-8

##
# Backup Generated: my_backup
# Once configured, you can run the backup with the following command:
#
# $ backup perform -t my_backup [-c <path_to_configuration_file>]
#
# For more information about Backup's components, see the documentation at:
# http://backup.github.io/backup
#
Model.new(:my_backup, 'Description for my_backup') do

  archive :my_archive do |archive|
    archive.root '~'
    archive.add "rails/misc/"
  end

  store_with Local do |local|
    local.path       = "~/backups/"
    local.keep       = 5
  end

  compress_with Gzip
end
@demetrodon
Copy link

I have this error too, when I'm trying analogy configuration.
My specs: ubuntu 14.04, Backup 4.2.1, ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

@tombruijn
Copy link
Member

I see where it's coming from. I'll fix it when I get home. For now you can use version 4.2.0 where it works.

@jamesjefferies
Copy link
Contributor

I am experiencing this with db.keep being set in the dropbox configuration.
My specs: ubuntu 14.04, Backup 4.2.1, ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

I think that in the cycler.rb file, the cycle! method needs to check whether the excess is > 0 before setting cycled packages.

Locally I tried that (and reset my Dropbox location) and it then works and cycles correctly.

@tombruijn
Copy link
Member

I yanked 4.2.1 and will work on a fix

@jamesjefferies
Copy link
Contributor

Thanks @tombruijn - I was just forking to create a pull request, but I will stop for now :)

@tombruijn
Copy link
Member

@jamesjefferies I'm not saying that you shouldn't make a PR. Makes my live a little bit easier ;)

@jamesjefferies
Copy link
Contributor

@tombruijn hope this PR makes your life a little bit easier ;)

@tombruijn
Copy link
Member

Closed by #712

Released v4.2.2 with the fix

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

4 participants