NoMethodError: undefined method `info?'
i get a strange error using 'elasticsearch/extensions/backup'
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] backup-gem-version 5.0.0.beta.2
stacktrace:
[2019/08/14 15:58:45][error] --- Wrapped Exception ---
[2019/08/14 15:58:45][error] NoMethodError: undefined method `info?' for #<Backup::Logger:0x0000000003099c70>
[2019/08/14 15:58:45][error] Did you mean? info
[2019/08/14 15:58:45][error]
[2019/08/14 15:58:45][error] Backtrace:
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-transport-7.3.0/lib/elasticsearch/transport/transport/loggable.rb:57:in `log_info'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-transport-7.3.0/lib/elasticsearch/transport/transport/base.rb:177:in `__log_response'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-transport-7.3.0/lib/elasticsearch/transport/transport/base.rb:319:in `perform_request'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-transport-7.3.0/lib/elasticsearch/transport/transport/http/faraday.rb:24:in `perform_request'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-transport-7.3.0/lib/elasticsearch/transport/client.rb:152:in `perform_request'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-api-7.3.0/lib/elasticsearch/api/actions/search.rb:147:in `search'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-extensions-0.0.31/lib/elasticsearch/extensions/backup.rb:161:in `__perform_single'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/elasticsearch-extensions-0.0.31/lib/elasticsearch/extensions/backup.rb:133:in `perform!'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/backup-5.0.0.beta.2/lib/backup/model.rb:267:in `each'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/backup-5.0.0.beta.2/lib/backup/model.rb:267:in `block in perform!'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/backup-5.0.0.beta.2/lib/backup/model.rb:266:in `each'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/backup-5.0.0.beta.2/lib/backup/model.rb:266:in `perform!'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/backup-5.0.0.beta.2/lib/backup/cli.rb:155:in `perform'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/gems/backup-5.0.0.beta.2/bin/backup:5:in `<top (required)>'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/bin/backup:23:in `load'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/bin/backup:23:in `<main>'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
[2019/08/14 15:58:45][error] /home/user/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>
any ideas? thx!
@bmaeser What is the Backup::Logger object? Did you define it yourself? The logging mechanism of the Ruby client assumes that logger objects implement the basic methods, including info?
Can you modify the Backup::Logger class to support info??
no, i did not define this myself, and i cannot change it. its part of the backup-gem (https://github.com/backup/backup), the 'backup' extension of elasticsearch-ruby was built to work with it.
One option is to open an issue with the backup gem repo and asking them to include the predicate methods warn?, debug?, info? on their Logger object. Then it will provide the same methods as the core Ruby Logger. Otherwise, I can change the code to check the level explicitly instead of calling this method.
@estolfo sorry for the late reply, i was on vacation.
i'd really appreciate if you could check the loglevels explicitly in the code, for two reasons:
- the
backup.gemis in kind of a "maintenance-only" state and is not under very active developement - as this is an extension, imho its smart to adapt to the "main" project, rather than the backup gem needs to adapt to this extension. (even if its not best practice, i think changing the logging in
backup.gemwould probably break other extensions)
are there any updates on this? sorry to ask, but if this issue needs much more time to resolve (which of course is totally ok) i need to know.
i ask because if i cannot use backup.gem for es-backups i need to start thinking about alternative solutions. i cannot have a production cluster running without proper offside backups.
thanks in advance
Closing this issue as elasticsearch-extensions has been deprecated and is not currently maintained.