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 1506865

Summary: Docker Tags auto complete broken
Product: Red Hat Satellite Reporter: Partha Aji <paji>
Component: Container Management - ContentAssignee: Partha Aji <paji>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: ehelms, paji, pcreech, sgraessl, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 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:
Attachments:
Description Flags
autocomplete-screen none

Description Partha Aji 2017-10-27 03:17:58 UTC
1) Sync a Docker Repo
2) Goto Content -> Docker Tags
3) Type anything in the Filters 

Expected:
A list showing the search/auto complete options

Actual:
ISE

"GET https://katello.example.com/katello/api/v2/docker_tags/auto_complete_search?grouped=true&organization_id=1&page=1&paged=true&per_page=20&search=&sort_by=name&sort_order=ASC 500 (Internal Server Error)"

with the server raising a stack trace

<pre>
2017-10-27T03:14:01 91094dbe [app] [I] Started GET "/katello/api/v2/docker_tags/auto_complete_search?grouped=true&organization_id=1&page=1&paged=true&per_page=20&search=&sort_by=name&sort_order=ASC" for ::1 at 2017-10-27 03:14:01 +0000
2017-10-27T03:14:01 91094dbe [app] [I] Processing by Katello::Api::V2::DockerTagsController#auto_complete_search as JSON
2017-10-27T03:14:01 91094dbe [app] [I]   Parameters: {"grouped"=>"true", "organization_id"=>"1", "page"=>"1", "paged"=>"true", "per_page"=>"20", "search"=>"", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
2017-10-27T03:14:01 91094dbe [app] [I] Current user: admin (administrator)
2017-10-27T03:14:01 91094dbe [app] [D] Setting current user thread-local variable to admin
2017-10-27T03:14:01 91094dbe [app] [D] Setting current organization thread-local variable to Default Organization
2017-10-27T03:14:02 91094dbe [app] [E] NoMethodError: undefined method `complete_for' for #<Katello::DockerMetaTag::ActiveRecord_Relation:0x007fc769a7d4a0>
 | /home/vagrant/.rvm/gems/ruby-2.2.4/gems/activerecord-4.2.9/lib/active_record/relation/delegation.rb:136:in `method_missing'
 | /home/vagrant/.rvm/gems/ruby-2.2.4/gems/activerecord-4.2.9/lib/active_record/relation/delegation.rb:99:in `method_missing'
 | /home/vagrant/katello/app/controllers/katello/concerns/filtered_auto_complete_search.rb:11:in `auto_complete_search'
 | /home/vagrant/.rvm/gems/ruby-2.2.4/gems/actionpack-4.2.9/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
</pre>

Comment 1 Partha Aji 2017-10-27 03:18:03 UTC
Created from redmine issue http://projects.theforeman.org/issues/21484

Comment 2 Partha Aji 2017-10-27 03:18:06 UTC
Upstream bug assigned to None

Comment 4 Satellite Program 2017-10-27 06:08:18 UTC
Upstream bug assigned to paji

Comment 5 Satellite Program 2017-10-27 06:08:21 UTC
Upstream bug assigned to paji

Comment 6 Satellite Program 2017-10-27 22:08:42 UTC
Upstream bug assigned to paji

Comment 7 Satellite Program 2017-10-27 22:08:44 UTC
Upstream bug assigned to paji

Comment 8 Satellite Program 2017-10-30 16:07:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21484 has been resolved.

Comment 9 Partha Aji 2017-11-08 20:30:07 UTC
Connecting redmine issue http://projects.theforeman.org/issues/21607 from this bug

Comment 10 Patrick Creech 2017-11-30 16:24:16 UTC
Partha,

This didn't cherry-pick cleanly, and I'm not that familiar with katello's codebase.  Could you do the pick for me?

Thanks,
Patrick

Comment 11 Peter Ondrejka 2017-12-19 13:14:35 UTC
Created attachment 1370031 [details]
autocomplete-screen

Comment 12 Peter Ondrejka 2017-12-19 13:15:12 UTC
Verified in Sat 6.3 snap 29

Comment 13 Satellite Program 2018-02-21 16:54:37 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