Bug 1933157 - Cannot filter hosts by plan_id: 'search_by_plan_id' failed with error: 404 Not Found (ScopedSearch::QueryNotSupported)
Summary: Cannot filter hosts by plan_id: 'search_by_plan_id' failed with error: 404 N...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.4.0
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: 6.8.5
Assignee: Ondřej Ezr
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-25 20:24 UTC by James Jeffers
Modified: 2023-10-06 21:34 UTC (History)
16 users (show)

Fixed In Version: redhat_access-2.2.19
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1644832
Environment:
Last Closed: 2021-03-18 15:51:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github redhataccess foreman-plugin pull 58 0 None closed Fix filtering Hosts by plan_id for shortnames 2021-02-25 20:25:02 UTC
Red Hat Knowledge Base (Solution) 5066471 0 None None None 2021-02-25 20:25:02 UTC

Comment 2 Lukas Pramuk 2021-03-16 03:09:05 UTC
FailedQA.

@Satellite 6.8.5 Snap1
tfm-rubygem-redhat_access-2.2.19-1.el7sat.noarch
tfm-rubygem-redhat_access_lib-1.1.5-1.el7sat.noarch
insights-client-3.1.1-1.el7_9.noarch (@host)

I'm not able to create a inventory

1) Register the host to Satellite (no short hostname, just normal host fails)

2) Assign RedHatInsights.insights-client ansible role to the host

3) Run ansible roles for the host

4) No hosts in inventory


@host # insights-client --status
Unable to fetch egg url. Defaulting to /release
System is registered locally via .registered file. Registered at 2021-03-15T20:10:02.533542
Insights API says this machine is NOT registered.

@host # insights-client --register
Unable to fetch egg url. Defaulting to /release
Successfully registered host host1.example.com
Automatic scheduling for Insights has been enabled.
Starting to collect Insights data for host1.example.com
Uploading Insights data.
Upload archive failed with status code  500
Upload attempt 1 of 1 failed! Status Code: 500
All attempts to upload have failed!
Please see /var/log/insights-client/insights-client.log for additional information
Upload failed.

@SAT # tail -f /var/log/foreman/production.log 
2021-03-15T20:38:00 [I|app|ac08c1ad] Started GET "/redhat_access/r/insights/v1/branch_info" for <HOST_IP> at 2021-03-15 20:38:00 -0500
2021-03-15T20:38:00 [I|app|ac08c1ad] Processing by RedhatAccess::RedhatAccessController#index as JSON
2021-03-15T20:38:00 [I|app|ac08c1ad]   Parameters: {"path"=>"r/insights/v1/branch_info"}
2021-03-15T20:38:00 [I|app|ac08c1ad] Filter chain halted as :authorize rendered or redirected
2021-03-15T20:38:00 [I|app|ac08c1ad] Completed 401 Unauthorized in 10ms (Views: 0.4ms | ActiveRecord: 2.7ms | Allocations: 1092)
2021-03-15T20:38:00 [I|app|6fceb951] Started POST "/redhat_access/r/insights/platform/module-update-router/v1/event" for <HOST_IP> at 2021-03-15 20:38:00 -0500
2021-03-15T20:38:00 [F|app|6fceb951]   
ActionController::RoutingError (No route matches [POST] "/redhat_access/r/insights/platform/module-update-router/v1/event"):
  
lib/foreman/middleware/logging_context_request.rb:11:in `call'
katello (3.16.0.23) lib/katello/prevent_json_parsing.rb:12:in `call'
2021-03-15T20:38:01 [I|app|5a5c9032] Started GET "/redhat_access/r/insights/v1/branch_info" for <HOST_IP> at 2021-03-15 20:38:01 -0500
2021-03-15T20:38:01 [I|app|5a5c9032] Processing by RedhatAccess::RedhatAccessController#index as JSON
2021-03-15T20:38:01 [I|app|5a5c9032]   Parameters: {"path"=>"r/insights/v1/branch_info"}
2021-03-15T20:38:01 [I|app|5a5c9032] Filter chain halted as :authorize rendered or redirected
2021-03-15T20:38:01 [I|app|5a5c9032] Completed 401 Unauthorized in 7ms (Views: 0.3ms | ActiveRecord: 2.3ms | Allocations: 1092)
2021-03-15T20:38:01 [I|app|4d3a601a] Started GET "/redhat_access/r/insights/platform/module-update-router/v1/channel?module=insights-core" for <HOST_IP> at 2021-03-15 20:38:01 -0500
2021-03-15T20:38:01 [I|app|4d3a601a] Processing by RedhatAccess::RedhatAccessController#index as JSON
2021-03-15T20:38:01 [I|app|4d3a601a]   Parameters: {"module"=>"insights-core", "path"=>"r/insights/platform/module-update-router/v1/channel"}
2021-03-15T20:38:01 [I|app|4d3a601a] Filter chain halted as :authorize rendered or redirected
2021-03-15T20:38:01 [I|app|4d3a601a] Completed 401 Unauthorized in 7ms (Views: 0.2ms | ActiveRecord: 2.2ms | Allocations: 1093)
2021-03-15T20:38:01 [I|app|1cf04f7c] Started GET "/redhat_access/r/insights/v1/static/release/insights-core.egg" for <HOST_IP> at 2021-03-15 20:38:01 -0500
2021-03-15T20:38:01 [I|app|1cf04f7c] Processing by RedhatAccess::RedhatAccessController#index as JSON
2021-03-15T20:38:01 [I|app|1cf04f7c]   Parameters: {"path"=>"r/insights/v1/static/release/insights-core.egg"}
2021-03-15T20:38:01 [I|app|1cf04f7c] Filter chain halted as :authorize rendered or redirected
2021-03-15T20:38:01 [I|app|1cf04f7c] Completed 401 Unauthorized in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 507)
2021-03-15T20:38:01 [I|app|104100b3] Started POST "/redhat_access/r/insights/platform/module-update-router/v1/event" for <HOST_IP> at 2021-03-15 20:38:01 -0500
2021-03-15T20:38:01 [F|app|104100b3]   
ActionController::RoutingError (No route matches [POST] "/redhat_access/r/insights/platform/module-update-router/v1/event"):
  
lib/foreman/middleware/logging_context_request.rb:11:in `call'
katello (3.16.0.23) lib/katello/prevent_json_parsing.rb:12:in `call'
2021-03-15T20:38:02 [I|app|e7e059ac] Started GET "/redhat_access/r/insights/v1/branch_info" for <HOST_IP> at 2021-03-15 20:38:02 -0500
2021-03-15T20:38:02 [I|app|e7e059ac] Processing by RedhatAccess::RedhatAccessController#index as JSON
2021-03-15T20:38:02 [I|app|e7e059ac]   Parameters: {"path"=>"r/insights/v1/branch_info"}
2021-03-15T20:38:02 [I|app|e7e059ac] Filter chain halted as :authorize rendered or redirected
2021-03-15T20:38:02 [I|app|e7e059ac] Completed 401 Unauthorized in 6ms (Views: 0.2ms | ActiveRecord: 1.8ms | Allocations: 1092)
2021-03-15T20:38:02 [I|app|8d4597e4] Started GET "/redhat_access/r/insights/v1/systems/83e6fbf4-09cf-4625-980d-08dbba4c82be" for <HOST_IP> at 2021-03-15 20:38:02 -0500
2021-03-15T20:38:02 [I|app|8d4597e4] Processing by RedhatAccess::RedhatAccessController#index as JSON
2021-03-15T20:38:02 [I|app|8d4597e4]   Parameters: {"path"=>"r/insights/v1/systems/83e6fbf4-09cf-4625-980d-08dbba4c82be"}
2021-03-15T20:38:02 [I|app|8d4597e4] Filter chain halted as :authorize rendered or redirected
2021-03-15T20:38:02 [I|app|8d4597e4] Completed 401 Unauthorized in 6ms (Views: 0.2ms | ActiveRecord: 1.8ms | Allocations: 1092)
2021-03-15T20:38:02 [I|app|8ec1b6bf] Started POST "/redhat_access/r/insights/v1/systems" for <HOST_IP> at 2021-03-15 20:38:02 -0500
2021-03-15T20:38:02 [F|app|8ec1b6bf]   
ActionController::RoutingError (No route matches [POST] "/redhat_access/r/insights/v1/systems"):
  
lib/foreman/middleware/logging_context_request.rb:11:in `call'
katello (3.16.0.23) lib/katello/prevent_json_parsing.rb:12:in `call'
2021-03-15T20:38:02 [I|app|ae21e125] Started POST "/redhat_access/r/insights/platform/module-update-router/v1/event" for <HOST_IP> at 2021-03-15 20:38:02 -0500
2021-03-15T20:38:02 [F|app|ae21e125]   
ActionController::RoutingError (No route matches [POST] "/redhat_access/r/insights/platform/module-update-router/v1/event"):
  
lib/foreman/middleware/logging_context_request.rb:11:in `call'
katello (3.16.0.23) lib/katello/prevent_json_parsing.rb:12:in `call'
2021-03-15T20:38:03 [I|app|294799e5] Started GET "/redhat_access/r/insights/v1/branch_info" for <HOST_IP> at 2021-03-15 20:38:03 -0500
2021-03-15T20:38:03 [I|app|294799e5] Processing by RedhatAccess::RedhatAccessController#index as JSON
2021-03-15T20:38:03 [I|app|294799e5]   Parameters: {"path"=>"r/insights/v1/branch_info"}
2021-03-15T20:38:03 [I|app|294799e5] Filter chain halted as :authorize rendered or redirected
2021-03-15T20:38:03 [I|app|294799e5] Completed 401 Unauthorized in 7ms (Views: 0.2ms | ActiveRecord: 2.8ms | Allocations: 1092)
2021-03-15T20:38:06 [I|app|3527f08b] Started GET "/rhsm/consumers/a05e312f-4c19-41ee-a48c-b2ed300b90ac/owner" for <HOST_IP> at 2021-03-15 20:38:06 -0500
2021-03-15T20:38:06 [I|app|3527f08b] Processing by Katello::Api::Rhsm::CandlepinProxiesController#get as JSON
2021-03-15T20:38:06 [I|app|3527f08b]   Parameters: {"id"=>"a05e312f-4c19-41ee-a48c-b2ed300b90ac"}
2021-03-15T20:38:07 [I|app|3527f08b] Completed 200 OK in 83ms (Views: 0.2ms | ActiveRecord: 2.5ms | Allocations: 4027)
2021-03-15T20:38:07 [I|app|eb14fc32] Started GET "/rhsm/" for <HOST_IP> at 2021-03-15 20:38:07 -0500
2021-03-15T20:38:07 [I|app|eb14fc32] Processing by Katello::Api::V2::RootController#rhsm_resource_list as JSON
2021-03-15T20:38:07 [I|app|eb14fc32]   Parameters: {"root"=>{}}
2021-03-15T20:38:07 [I|app|eb14fc32]   Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.23/app/views/katello/api/v2/root/resource_list.json.rabl within katello/api/v2/layouts/collection
2021-03-15T20:38:07 [I|app|eb14fc32]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.23/app/views/katello/api/v2/root/resource_list.json.rabl within katello/api/v2/layouts/collection (Duration: 3.4ms | Allocations: 1917)
2021-03-15T20:38:07 [I|app|eb14fc32] Completed 200 OK in 25ms (Views: 8.6ms | ActiveRecord: 1.8ms | Allocations: 12711)
2021-03-15T20:38:07 [I|app|7cc98759] Started GET "/rhsm/consumers/a05e312f-4c19-41ee-a48c-b2ed300b90ac" for <HOST_IP> at 2021-03-15 20:38:07 -0500
2021-03-15T20:38:07 [I|app|7cc98759] Processing by Katello::Api::Rhsm::CandlepinProxiesController#consumer_show as JSON
2021-03-15T20:38:07 [I|app|7cc98759]   Parameters: {"id"=>"a05e312f-4c19-41ee-a48c-b2ed300b90ac"}
2021-03-15T20:38:07 [I|app|7cc98759] Completed 200 OK in 109ms (Views: 3.1ms | ActiveRecord: 3.2ms | Allocations: 9821)
2021-03-15T20:38:13 [I|app|a34e7fc8] Started GET "/rhsm/consumers/a05e312f-4c19-41ee-a48c-b2ed300b90ac/certificates/serials" for <HOST_IP> at 2021-03-15 20:38:13 -0500
2021-03-15T20:38:13 [I|app|a34e7fc8] Processing by Katello::Api::Rhsm::CandlepinProxiesController#serials as JSON
2021-03-15T20:38:13 [I|app|a34e7fc8]   Parameters: {"id"=>"a05e312f-4c19-41ee-a48c-b2ed300b90ac"}
2021-03-15T20:38:13 [I|app|a34e7fc8] Completed 200 OK in 83ms (Views: 0.4ms | ActiveRecord: 5.1ms | Allocations: 4952)
2021-03-15T20:38:13 [I|app|e3d38aaa] Started GET "/rhsm/status" for <HOST_IP> at 2021-03-15 20:38:13 -0500
2021-03-15T20:38:13 [I|app|e3d38aaa] Processing by Katello::Api::Rhsm::CandlepinProxiesController#server_status as JSON
2021-03-15T20:38:13 [I|app|e3d38aaa] Completed 200 OK in 34ms (Views: 0.4ms | ActiveRecord: 2.2ms | Allocations: 3140)
2021-03-15T20:38:13 [I|app|3e85c77a] Started GET "/rhsm/consumers/a05e312f-4c19-41ee-a48c-b2ed300b90ac/content_overrides" for <HOST_IP> at 2021-03-15 20:38:13 -0500
2021-03-15T20:38:13 [I|app|3e85c77a] Processing by Katello::Api::Rhsm::CandlepinProxiesController#get as JSON
2021-03-15T20:38:13 [I|app|3e85c77a]   Parameters: {"id"=>"a05e312f-4c19-41ee-a48c-b2ed300b90ac"}
2021-03-15T20:38:13 [I|app|3e85c77a] Completed 200 OK in 44ms (Views: 0.2ms | ActiveRecord: 2.1ms | Allocations: 3941)
2021-03-15T20:38:13 [I|app|79c7f1ab] Started GET "/rhsm/consumers/a05e312f-4c19-41ee-a48c-b2ed300b90ac/release" for <HOST_IP> at 2021-03-15 20:38:13 -0500
2021-03-15T20:38:13 [I|app|79c7f1ab] Processing by Katello::Api::Rhsm::CandlepinProxiesController#get as JSON
2021-03-15T20:38:13 [I|app|79c7f1ab]   Parameters: {"id"=>"a05e312f-4c19-41ee-a48c-b2ed300b90ac"}
2021-03-15T20:38:14 [I|app|79c7f1ab] Completed 200 OK in 49ms (Views: 0.1ms | ActiveRecord: 1.9ms | Allocations: 3954)
2021-03-15T20:38:18 [I|app|68e76aef] Started POST "/redhat_access/r/insights/uploads/83e6fbf4-09cf-4625-980d-08dbba4c82be" for <HOST_IP> at 2021-03-15 20:38:18 -0500
2021-03-15T20:38:18 [I|app|68e76aef] Processing by RedhatAccess::Api::MachineTelemetryApiController#proxy_upload as JSON
2021-03-15T20:38:18 [I|app|68e76aef]   Parameters: {"file"=>#<ActionDispatch::Http::UploadedFile:0x00000000114eff28 @tempfile=#<Tempfile:/tmp/RackMultipart20210312-69463-155layl.gz>, @original_filename="insights-host1.example.com-20210313013803.tar.gz", @content_type="application/x-gzip; charset=binary", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"insights-host1.example.com-20210313013803.tar.gz\"\r\nContent-Type: application/x-gzip; charset=binary\r\n">, "id"=>"83e6fbf4-09cf-4625-980d-08dbba4c82be"}
2021-03-15T20:38:18 [W|app|68e76aef] Action failed
2021-03-15T20:38:18 [I|app|68e76aef] Completed 500 Internal Server Error in 16ms (ActiveRecord: 3.8ms | Allocations: 3272)
2021-03-15T20:38:18 [F|app|68e76aef]   
ActionView::MissingTemplate (Missing template common/500 with {:locale=>[:en], :formats=>[:json], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :rabl]}. Searched in:
  * "/usr/share/foreman/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-2.0.13.1/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-4.0.5/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-17.0.2/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/redhat_access-2.2.19/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_virt_who_configure-0.5.2/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.23/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.23/engines/bastion/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-9.0.1/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_azure_rm-2.1.2/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-5.1.3.2/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-3.3.7.2/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.3/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-6.0.1.7/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-dsl-2.2.2/app/views"
  * "/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.17/app/views"
):
  
app/controllers/application_controller.rb:352:in `generic_exception'
katello (3.16.0.23) lib/katello/middleware/event_daemon.rb:10:in `call'
lib/foreman/middleware/telemetry.rb:10:in `call'
lib/foreman/middleware/catch_json_parse_errors.rb:9:in `call'
lib/foreman/middleware/logging_context_session.rb:22:in `call'
lib/foreman/middleware/logging_context_request.rb:11:in `call'
katello (3.16.0.23) lib/katello/prevent_json_parsing.rb:12:in `call'
2021-03-15T20:38:18 [I|app|9f223516] Started POST "/redhat_access/r/insights/platform/module-update-router/v1/event" for <HOST_IP> at 2021-03-15 20:38:18 -0500
2021-03-15T20:38:18 [F|app|9f223516]   
ActionController::RoutingError (No route matches [POST] "/redhat_access/r/insights/platform/module-update-router/v1/event"):
  
lib/foreman/middleware/logging_context_request.rb:11:in `call'
katello (3.16.0.23) lib/katello/prevent_json_parsing.rb:12:in `call'

Comment 3 Lukas Pramuk 2021-03-16 03:15:08 UTC
# insights-client --net-debug --register
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 401
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 401
GET https://sat.example.com:443/redhat_access/r/insights/platform/module-update-router/v1/channel?module=insights-core
Unable to fetch egg url. Defaulting to /release
GET https://sat.example.com:443/redhat_access/r/insights/v1/static/release/insights-core.egg
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 401
GET https://sat.example.com:443/redhat_access/r/insights/v1/systems/83e6fbf4-09cf-4625-980d-08dbba4c82be
POST https://sat.example.com:443/redhat_access/r/insights/v1/systems
Successfully registered host host1.example.com
Automatic scheduling for Insights has been enabled.
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 401
Starting to collect Insights data for host1.example.com
Uploading Insights data.
POST https://sat.example.com:443/redhat_access/r/insights/uploads/83e6fbf4-09cf-4625-980d-08dbba4c82be
Upload status: 500 Internal Server Error {"status":500,"error":"Internal Server Error"}
Upload archive failed with status code  500
Upload attempt 1 of 1 failed! Status Code: 500
All attempts to upload have failed!
Please see /var/log/insights-client/insights-client.log for additional information
Upload failed.

Comment 4 Lukas Pramuk 2021-03-16 03:28:42 UTC
6.8.5 Snap1 ^^^


vs. 


6.8.4 (or downgrade to tfm-rubygem-redhat_access-2.2.18-1.el7sat)

# insights-client --net-debug --register
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
GET https://sat.example.com:443/redhat_access/r/insights/platform/module-update-router/v1/channel?module=insights-core
GET https://sat.example.com:443/redhat_access/r/insights/v1/static/release/insights-core.egg
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
GET https://sat.example.com:443/redhat_access/r/insights/v1/systems/83e6fbf4-09cf-4625-980d-08dbba4c82be
This host has already been registered.
Automatic scheduling for Insights has been enabled.
GET https://sat.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
Starting to collect Insights data for host1.example.com
Uploading Insights data.
POST https://sat.example.com:443/redhat_access/r/insights/uploads/83e6fbf4-09cf-4625-980d-08dbba4c82be
Upload status: 201 Created {"request_id":"1d178efe200d475da45d670e7a41dd2c","upload":{"account_number":"6212943"}}
Successfully uploaded report from host1.example.com to account 6212943.
View the Red Hat Insights console at https://cloud.redhat.com/insights/
GET https://sat.example.com:443/redhat_access/r/insights/platform/inventory/v1/hosts?insights_id=83e6fbf4-09cf-4625-980d-08dbba4c82be
View details about this system on cloud.redhat.com:
https://cloud.redhat.com/insights/inventory/a76ea644-a032-4d53-a2d2-a1fc60dc4378

Comment 13 James Jeffers 2021-03-18 15:25:49 UTC
@egolov I am watching this and will take care of it wherever it lands.

Comment 14 James Jeffers 2021-03-18 15:51:49 UTC
Per discussion, this is being closed for 6.8 z-stream. This issue will be addressed in 6.9.

Comment 15 Red Hat Bugzilla 2023-09-15 01:02:24 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


Note You need to log in before you can comment on or make changes to this bug.