Problem: Unable to change Content Source from endpoint hosts, when trying to switch via the foreman GUI under Hosts > Change host content source it keeps giving me an error when selecting alternate content source.
Expected outcome: Ability to change content source
Foreman and Proxy versions:
foreman-release-3.5.1-1.el8.noarch
katello-4.7.2-1.el8.noarch
Foreman and Proxy plugin versions:
All packages latest 3.5.x and 4.7.x
Distribution and version:
RHEL 8.7
Other relevant data:
When I select the endpoint and try switchin the content source to a diffent one I keep getting the following error:
Something went wrong while loading the Smart Proxy. See the logs for more information
Under the foreman node production.log shows the following:
2023-02-15T08:09:27 [I|app|6617a2b2] Processing by Katello::Api::V2::CapsulesController#show as JSON
2023-02-15T08:09:27 [I|app|6617a2b2] Parameters: {“api_version”=>“v2”, “id”=>“1”}
2023-02-15T08:09:28 [I|app|6617a2b2] ActiveRecord::RecordNotFound (ActiveRecord::RecordNotFound)
2023-02-15T08:09:28 [I|app|6617a2b2] Rendered api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout (Duration: 4.2ms | Allocations: 2541)
2023-02-15T08:09:28 [I|app|6617a2b2] Rendered layout api/v2/layouts/error_layout.json.erb (Duration: 6.7ms | Allocations: 5056)
2023-02-15T08:09:28 [I|app|6617a2b2] Completed 404 Not Found in 71ms (Views: 7.7ms | ActiveRecord: 8.0ms | Allocations: 21810)
2023-02-15T08:09:28 [I|app|82203fc6] Started GET “/” for 10.x.x.x at 2023-02-15 08:09:28 -0800
Hi @cucu007 , can you grep 6617a2b2 /var/log/foreman/production.log so we can see what was the exact request and resource that had the 404 response?
Could you please let us know as well what exactly are you trying to achieve / desired end goal? For example, “migrate an already provisioned/registered host so that it pulls content from a different content proxy (capsule)”
Please let us know as well if this is a new or existing environment, and is this a workflow that previously worked for you, and when were the katello server and any content proxies last updated/upgraded?
To clarify a bit more, changing the content source for a host would typically require some changes on the host side configuration (i.e. for subscription-manager, which in turn controls the yum/dnf configuration for the host) so there is a remote execution job that should run when making the change.
If the error occurred at some point during that remote job, then you should be able to find it on the Monitor → Tasks UI and there will be a lot more information there about the exact step where the error occurred.
can you grep 6617a2b2 /var/log/foreman/production.log so we can see what was the exact request and resource that had the 404 response?
2023-02-15T08:09:27 [I|app|6617a2b2] Started GET “/katello/api/capsules/1” for 10.x.x.x at 2023-02-15 08:09:27 -0800
2023-02-15T08:09:27 [I|app|6617a2b2] Processing by Katello::Api::V2::CapsulesController#show as JSON
2023-02-15T08:09:27 [I|app|6617a2b2] Parameters: {“api_version”=>“v2”, “id”=>“1”}
2023-02-15T08:09:28 [I|app|6617a2b2] ActiveRecord::RecordNotFound (ActiveRecord::RecordNotFound)
2023-02-15T08:09:28 [I|app|6617a2b2] Rendered api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout (Duration: 4.2ms | Allocations: 2541)
2023-02-15T08:09:28 [I|app|6617a2b2] Rendered layout api/v2/layouts/error_layout.json.erb (Duration: 6.7ms | Allocations: 5056)
2023-02-15T08:09:28 [I|app|6617a2b2] Completed 404 Not Found in 71ms (Views: 7.7ms | ActiveRecord: 8.0ms | Allocations: 21810)
Could you please let us know as well what exactly are you trying to achieve / desired end goal? For example, “migrate an already provisioned/registered host so that it pulls content from a different content proxy (capsule)”
The quote statement is exactly what I am trying to achive.
Please let us know as well if this is a new or existing environment, and is this a workflow that previously worked for you, and when were the katello server and any content proxies last updated/upgraded?
I have one parent master server and 4 proxies distributed across 3 regions, this is an existing environment and all Foreman master and the proxies are running the same version and no failures on content sync.
To clarify a bit more, changing the content source for a host would typically require some changes on the host side configuration (i.e. for subscription-manager, which in turn controls the yum/dnf configuration for the host) so there is a remote execution job that should run when making the change.
This brings me to a good point, do I need to ensure that public key is imported into the endpoint from the foreman parent to ensure remote execution can happen. I am not sure if this is a requirement, but I guess is worth asking. I am not running any ansible on this environment at the moment or puppet just to clarify.
I will check the Monitor > Task UI to see if any more debug logs can shine some additional light. When you get a chance let me know your input. Thank you again @wbclark for the wonderful input always.
Hi @ekohl /@wbclark ,
I checked the UI logs and didnt find anything useful under task.
I am still not sure why changing content source to a different proxy is not working as intended, perhaps is a bug somewhere…I know this worked in the past but didnt track how far back this was working since now I am running the latest released. Below is another copy of the error via production.log.
2023-02-15T18:01:40 [I|app|1cc0c0aa] Processing by Katello::Api::V2::CapsulesController#show as JSON
2023-02-15T18:01:40 [I|app|1cc0c0aa] Parameters: {“api_version”=>“v2”, “id”=>“2”}
2023-02-15T18:01:40 [I|app|1cc0c0aa] ActiveRecord::RecordNotFound (ActiveRecord::RecordNotFound)
2023-02-15T18:01:40 [I|app|1cc0c0aa] Rendered api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout (Duration: 2.2ms | Allocations: 2572)
2023-02-15T18:01:40 [I|app|1cc0c0aa] Rendered layout api/v2/layouts/error_layout.json.erb (Duration: 3.8ms | Allocations: 5117)
2023-02-15T18:01:40 [I|app|1cc0c0aa] Completed 404 Not Found in 46ms (Views: 4.3ms | ActiveRecord: 6.4ms | Allocations: 21870)