Capsule sync fails with Error: Unable to update hosts (500 Internal Server Error) for Capsule after upgrading to Red Hat Satellite Capsule 6.18
Environment
- Red Hat Satellite 6.18
- Red Hat Satellite Capsule 6.18
Issue
-
After upgrading the Red Hat Satellite and Capsule servers to
6.18, any attempts to synchronize the external capsule server fail with the following error:[ProxyAPI::ProxyException]: Unable to update hosts ([RestClient::InternalServerError]: 500 Internal Server Error) for Capsule https://capsule.example.com:9090/container_gateway/update_hosts (ProxyAPI::ProxyException)
Resolution
-
This issue has been reported to the Red Hat Satellite Engineering team via the This content is not included.JIRA SAT-40496 has been fixed with the Errata RHBA-2026:0260.
-
The same information has been documented in the release notes as well.
-
Meanwhile, refer to the
Diagnostic Stepsto confirm this issue and open a This content is not included.support case with RedHat to obtain the hotfix rpm. The steps to install the hotfix are mentioned below:-
Obtain the hotfix package
rubygem-katello-4.18.0.5-1-hotfix-SAT-39794.el9sat.noarch.rpmfrom the Red Hat Support team and copy the same to /tmp of the affected Red Hat Satellite 6.18 server. -
Execute the following steps to install the hotfix after ensuring the presence of a recent and healthy backup or VM snapshot of the affected satellite server.
# dnf install rubygem-katello-4.18.0.5-1-hotfix-SAT-39794.el9sat.noarch.rpm --disableplugin=foreman-protector # satellite-maintain service restart # satellite-maintain service status -b # hammer ping -
Retry a new capsule synchronization and observe how it behaves.
-
-
If the problem persists, then collect the following data to submit a This content is not included.case with Red Hat Technical Support.
-
Ensure that a failed capsule sync was attempted well within the last 12 hours.
-
Collect the
/var/log/foreman/production.logfile from the concerned satellite server -
Collect these two log files from the concerned capsule server.
-
/var/log/foreman-proxy/proxy.log -
/var/lib/pgsql/data/log/postgresql-$(date +%a).log
-
-
Output of the following command from the affected Red Hat Satellite server showing the offending host entries causing problems:
# cat << EOF | foreman-rake console conf.echo = false SmartProxy.all.each do |sp| pp sp.name pp sp.content_facets.where(uuid: nil) end EOF # su - postgres -c "psql foreman -c \"SELECT katello_content_facets.uuid,hosts.name,hosts.id FROM hosts INNER JOIN katello_content_facets ON katello_content_facets.host_id = hosts.id WHERE katello_content_facets.uuid is null;\"" # rpm -q satellite katello rubygem-katelloNOTE: Re-registration or removal of the offending host entry would be able to fix the issue.
-
-
In the event of the presence of outdated information, the Red Hat Support team may ask for additional information to investigate the problem.
For more KB articles/solutions related to Red Hat Satellite 6.x Capsule Sync Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Capsule Sync Issues
Root Cause
-
The problem happens because of the presence of one or more host records ( registered through that capsule server ) with no
uuidspecified in their content_facet data. -
The offending host ID can either be found from the capsule side of logs ( as displayed in the Diagnostic Steps section ) or using the following command on the main satellite server.
cat << EOF | foreman-rake console conf.echo = false SmartProxy.all.each do |sp| pp sp.name pp sp.content_facets.where(uuid: nil) end EOF -
By re-registering or removing the offending system profiles, this issue can be fixed.
Diagnostic Steps
-
The following errors were observed in the
/var/log/foreman/production.logfile of the satellite server.2025-11-19T07:17:32 [I|bac|304ba691] Task {label: Actions::Katello::CapsuleContent::Sync, id: a9f98d90-7e04-4562-b613-b7431f2a8a94, execution_plan_id: af675f05-612d-4b0a-a5f5-fb9ce4863c83} state changed: planned 2025-11-19T07:17:32 [I|app|304ba691] Rendered /usr/share/gems/gems/katello-4.18.0.3/app/views/katello/api/v2/common/async.json.rabl within katello/api/v2/layouts/resource (Duration: 49.0ms | Allocations: 73176) 2025-11-19T07:17:32 [I|app|304ba691] Rendered layout /usr/share/gems/gems/katello-4.18.0.3/app/views/katello/api/v2/layouts/resource.json.erb (Duration: 49.4ms | Allocations: 73285) 2025-11-19T07:17:32 [I|app|304ba691] Completed 202 Accepted in 28970ms (Views: 48.6ms | ActiveRecord: 662.5ms | Allocations: 1298819) 2025-11-19T07:17:33 [I|bac|304ba691] Task {label: Actions::Katello::CapsuleContent::Sync, id: a9f98d90-7e04-4562-b613-b7431f2a8a94, execution_plan_id: af675f05-612d-4b0a-a5f5-fb9ce4863c83} state changed: running 2025-11-19T07:17:41 [E|bac|304ba691] ERF12-0457 [ProxyAPI::ProxyException]: Unable to update hosts ([RestClient::InternalServerError]: 500 Internal Server Error) for Capsule https://capsule-fqdn:9090/container_gateway/update_hosts (ProxyAPI::ProxyException) 304ba691 | /usr/share/gems/gems/katello-4.18.0.3/lib/proxy_api/container_gateway.rb:37:in `rescue in update_hosts' 304ba691 | /usr/share/gems/gems/katello-4.18.0.3/lib/proxy_api/container_gateway.rb:32:in `update_hosts' 304ba691 | /usr/share/gems/gems/katello-4.18.0.3/app/models/katello/concerns/smart_proxy_extensions.rb:251:in `update_container_gateway_hosts' 304ba691 | /usr/share/gems/gems/katello-4.18.0.3/app/models/katello/concerns/smart_proxy_extensions.rb:238:in `sync_container_gateway' 304ba691 | /usr/share/gems/gems/katello-4.18.0.3/app/lib/actions/katello/capsule_content/sync_capsule.rb:97:in `run' 304ba691 | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/action.rb:590:in `block (3 levels) in execute_run' .. .. 304ba691 | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/executors/sidekiq/serialization.rb:28:in `perform' 304ba691 | [ sidekiq ] 304ba691 | [ concurrent-ruby ] 2025-11-19T07:35:37 [I|bac|304ba691] Task {label: Actions::Katello::CapsuleContent::Sync, id: a9f98d90-7e04-4562-b613-b7431f2a8a94, execution_plan_id: af675f05-612d-4b0a-a5f5-fb9ce4863c83} state changed: stopped result: warning 2025-11-19T07:35:37 [I|app|304ba691] ForemanWebhooks::EventSubscriber: actions.katello.capsule_content.sync_failed.event.foreman event received -
The following errors were observed in the
/var/log/foreman-proxy/proxy.logfile of the affected capsule server.2025-11-19T18:17:34 304ba691 [I] Started PUT /container_gateway/repository_list/ 2025-11-19T18:17:34 304ba691 [I] Finished PUT /container_gateway/repository_list/ with 200 (78.07 ms) 2025-11-19T18:17:34 304ba691 [I] Started GET /container_gateway/users 2025-11-19T18:17:34 304ba691 [I] Finished GET /container_gateway/users with 200 (1.46 ms) 2025-11-19T18:17:34 304ba691 [I] Started PUT /container_gateway/update_hosts/ 2025-11-19T18:17:34 304ba691 [W] Error processing request '304ba691-0f1e-41aa-b6c8-1a97b290b35a: <Sequel::NotNullConstraintViolation>: PG::NotNullViolation: ERROR: null value in column "uuid" of relation "hosts" violates not-null constraint DETAIL: Failing row contains (107, null). /usr/share/gems/gems/sequel-5.95.1/lib/sequel/adapters/postgres.rb:171:in `exec' /usr/share/gems/gems/sequel-5.95.1/lib/sequel/adapters/postgres.rb:171:in `block in execute_query' /usr/share/gems/gems/sequel-5.95.1/lib/sequel/database/logging.rb:38:in `log_connection_yield' /usr/share/gems/gems/sequel-5.95.1/lib/sequel/adapters/postgres.rb:171:in `execute_query' /usr/share/gems/gems/sequel-5.95.1/lib/sequel/adapters/postgres.rb:159:in `block in execute' /usr/share/gems/gems/sequel-5.95.1/lib/sequel/adapters/postgres.rb:136:in `check_disconnect_errors' -
On the same capsule, the following SQL error can be seen from the PostgreSQL logs in
/var/lib/pgsql/data/log/as well. Here, the ID 107 seems to be the offending ID to inspect further.2025-11-19 18:17:34 +06 ERROR: null value in column "uuid" of relation "hosts" violates not-null constraint 2025-11-19 18:17:34 +06 DETAIL: Failing row contains (107, null). 2025-11-19 18:17:34 +06 STATEMENT: INSERT INTO "hosts" ("uuid") VALUES ('76eddb3b-b02b-484b-be46-8062c3a55737'), ('2d49f2a8-27eb-4496-9357-6da16bdaf5c8'), ('9d948537-156a-4451-a76e-de10d7f0402b'), ('49cdf206-52c5-44cb-8ec4-09a621717660'), ('5b9a1c2e-d1c5-4ebe-a910-1dfa81c0d03d'), .. ..
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.