Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1326032

Summary: Rake tasks fail under rake 11.x with undefined method `last_comment'
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: ProvisioningAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukas Zapletal <lzap>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, cwelton, lzap
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/14114
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:44:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bryan Kearney 2016-04-11 15:48:31 UTC
Since rake 11.x was released, rake tasks are failing with the following:

<pre>
NoMethodError: undefined method `last_comment' for #<Rake::Application:0x00000000cc8350>
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/rubocop-0.35.1/lib/rubocop/rake_task.rb:23:in `initialize'
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.1/slave/fast/lib/tasks/rubocop.rake:5:in `new'
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.1/slave/fast/lib/tasks/rubocop.rake:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:241:in `load'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:241:in `block in load'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:232:in `load_dependency'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:241:in `load'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/railties-4.1.14.2/lib/rails/engine.rb:654:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/railties-4.1.14.2/lib/rails/engine.rb:654:in `each'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/railties-4.1.14.2/lib/rails/engine.rb:654:in `run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/railties-4.1.14.2/lib/rails/application.rb:400:in `run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/railties-4.1.14.2/lib/rails/engine.rb:449:in `load_tasks'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/railties-4.1.14.2/lib/rails/railtie.rb:194:in `public_send'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/railties-4.1.14.2/lib/rails/railtie.rb:194:in `method_missing'
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.1/slave/fast/Rakefile:7:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/bin/ruby_executable_hooks:15:in `<main>'
</pre>

This is a bug in rubocop to be fixed in https://github.com/bbatsov/rubocop/pull/2931.  In the meantime and for stable branches, the version of rake should probably be pinned to avoid updating rubocop.

Comment 1 Bryan Kearney 2016-04-11 15:48:33 UTC
Created from redmine issue http://projects.theforeman.org/issues/14114

Comment 2 Bryan Kearney 2016-04-11 16:00:35 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14114 has been closed
-------------
Dominic Cleal
Applied in changeset commit:d29a748f6653bcae41272d9faa1aae61a4bcfb6e.

Comment 4 Lukas Zapletal 2017-08-09 09:00:19 UTC
[root@zzzap ~]# foreman-rake about
/opt/theforeman/tfm/root/usr/share/gems/gems/redhat_access-2.0.3/app/services/redhat_access/telemetry/look_ups.rb:171: warning: key :hosts is duplicated and overwritten on line 172
About your application's environment
Rails version             4.2.6
Ruby version              2.3.1-p112 (x86_64-linux)
RubyGems version          2.5.1
Rack version              1.6.2
Middleware                SecureHeaders::Middleware, Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x000000051c4418>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Middleware::TaggedLogging, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::ActiveRecordStore, ActionDispatch::Flash, Middleware::CatchJsonParseErrors, Katello::ParamsParserWrapper, Rack::Head, Rack::ConditionalGet, Rack::ETag, Apipie::Middleware::ChecksumInHeaders, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, ActionDispatch::Static, Apipie::Extractor::Recorder::Middleware, Apipie::StaticDispatcher, ActionDispatch::Static, ActionDispatch::Static
Application root          /usr/share/foreman
Environment               production
Database adapter          postgresql
Database schema version   20170629080604

[root@zzzap ~]# rpm -q foreman katello
foreman-1.15.2-1.el7sat.noarch
katello-3.4.4-2.el7sat.noarch

Comment 5 Satellite Program 2018-02-21 16:44:36 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336