Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-23083

Unable to sync the ansible inventory with filters on ansible role.

XMLWordPrintable

    • Endeavour
    • False
    • Moderate
    • None
    • None
    • None
    • None
    • No

      Description of problem:

      Ansible inventory script/Ansible Tower is getting an HTTP 500 error when attempting to synchronize inventory with Red Hat Satellite 6.6. Without filters we are able to sync the inventory without any issue.

      Satellite role/Filter:-

      ---|-------------|----------------------------------------------------------|----------|---------|-----|---------------
      ID | RESOURCE TYPE | SEARCH | UNLIMITED? | OVERRIDE? | ROLE | PERMISSIONS
      ---|-------------|----------------------------------------------------------|----------|---------|-----|---------------
      301 | Host | registered_at > "200 minutes ago" and installed_at = Today | no | no | tower | view_hosts
      302 | Hostgroup | none | no | no | tower | view_hostgroups
      303 | FactValue | none | no | no | tower | view_facts
      ---|-------------|----------------------------------------------------------|----------|---------|-----|---------------

      Error:-

      2019-11-13T18:19:53 [W|app|838e3f9c] Action failed
      2019-11-13T18:19:53 [D|app|838e3f9c] Backtrace for 'Action failed' error (ActiveRecord::ConfigurationError): Can't join 'Host::Base' to association named 'subscription_facet'; perhaps you misspelled it?
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:188:in `find_reflection'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:193:in `block in build'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:192:in `each'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:192:in `map'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:192:in `build'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:201:in `block in build'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:192:in `each'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:192:in `map'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:192:in `build'
      /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/associations/join_dependency.rb:72:in `initialize'

      Version-Release number of selected component (if applicable):
      Satellite 6.6

      How reproducible:

      Steps to Reproduce:
      1. Create the role/filters as mentioned above.
      2. Create a ansible user and associate the role.
      3. Provision a new host then check whether you are able to list using ansible inventory script or tower.

      Curl command is also failing with 500 error:-

      1. curl -k -v -u ansible:redhat -H "Content-Type: application/json" https://satellite/api/v2/hosts/12/facts?per_page=250&page=1

      Output:-

      {
      "error":

      {"message":"Can't join 'Host::Base' to association named 'subscription_facet'; perhaps you misspelled it?"}

      }

      Actual results:

      Getting below error:-

      error":

      {"message":"Can't join 'Host::Base' to association named 'subscription_facet'; perhaps you misspelled it?"}

      Expected results:

      We should be able to sync the inventory without any issue.

      Additional info:

              rhn-support-alazik Adam Lazik
              jira-bugzilla-migration RH Bugzilla Integration
              RH Bugzilla Integration RH Bugzilla Integration
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: