Foreman proxy sync failing

Hi all,

I have just added some new content and therefore ran a sync afterwards

Found an error when trying to sync 1 of the proxies. the other 3 work fine, please could someone help

This happens both optimized and full sync

Problem: sync keeps failing on 1 proxy

Expected outcome: works

Foreman and Proxy versions: 3.17, katello 4.19

Last sync failed: ERF12-0457 [ProxyAPI::ProxyException]: Unable to update hosts ([RestClient::InternalServerError]: 500 Internal Server Error) for proxy https://dr-foreman-proxy.com:9090/container_gateway/update_hosts

Error processing request ‘42a6df96-dc1e-4979-b89b-03597e6449d9: Sequel::NotNullConstraintViolation: PG::NotNullViolation: ERROR: null value in column “uuid” of relation “hosts” violates not-null constraint DETAIL: Failing row contains (396, null). /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:171:in `exec’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:171:in `block in execute_query’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/logging.rb:38:in `log_connection_yield’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:171:in `execute_query’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:159:in `block in execute’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:136:in `check_disconnect_errors’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:159:in `execute’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:533:in `_execute’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:348:in `block (2 levels) in execute’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:556:in `check_database_errors’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:348:in `block in execute’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/connection_pool/threaded.rb:88:in `hold’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/connecting.rb:283:in `synchronize’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/postgres.rb:348:in `execute’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/query.rb:50:in `execute_dui’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/dataset/actions.rb:1208:in `execute_dui’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/dataset/actions.rb:1080:in `block (2 levels) in _import’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/dataset/actions.rb:1080:in `each’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/dataset/actions.rb:1080:in `block in _import’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/transactions.rb:199:in `block in transaction’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/connection_pool/threaded.rb:88:in `hold’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/connecting.rb:283:in `synchronize’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/transactions.rb:197:in `transaction’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/dataset/actions.rb:1128:in `_import_transaction’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/dataset/actions.rb:1080:in `_import’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/adapters/shared/postgres.rb:2568:in `_import’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/dataset/actions.rb:386:in `import’ /usr/share/gems/gems/smart_proxy_container_gateway-3.4.1/lib/smart_proxy_container_gateway/container_gateway_api.rb:265:in `block (2 levels) in class:Api’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/transactions.rb:264:in `_transaction’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/transactions.rb:239:in `block in transaction’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/connection_pool/threaded.rb:92:in `hold’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/connecting.rb:283:in `synchronize’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/transactions.rb:197:in `transaction’ /usr/share/gems/gems/sequel-5.98.0/lib/sequel/database/transactions.rb:187:in `transaction’ /usr/share/gems/gems/smart_proxy_container_gateway-3.4.1/lib/smart_proxy_container_gateway/container_gateway_api.rb:262:in `block in class:Api’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1697:in `call’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1697:in `block in compile!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (3 levels) in route!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1049:in `route_eval’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (2 levels) in route!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1078:in `block in process_route’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `catch’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `process_route’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1028:in `block in route!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `each’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `route!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1147:in `block in dispatch!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `block in invoke’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `catch’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `invoke’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1142:in `dispatch!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:956:in `block in call!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `block in invoke’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `catch’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `invoke’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:956:in `call!’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:945:in `call’ /usr/share/foreman-proxy/lib/proxy/hsts_middleware.rb:12:in `call’ /usr/share/foreman-proxy/lib/proxy/log.rb:102:in `call’ /usr/share/foreman-proxy/lib/proxy/request_id_middleware.rb:11:in `call’ /usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/xss_header.rb:18:in `call’ /usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/path_traversal.rb:16:in `call’ /usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/json_csrf.rb:26:in `call’ /usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/base.rb:50:in `call’ /usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/base.rb:50:in `call’ /usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/frame_options.rb:31:in `call’ /usr/share/gems/gems/rack-2.2.21/lib/rack/null_logger.rb:11:in `call’ /usr/share/gems/gems/rack-2.2.21/lib/rack/head.rb:12:in `call’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/show_exceptions.rb:22:in `call’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:218:in `call’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:2004:in `call’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1564:in `block in call’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1780:in `synchronize’ /usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1564:in `call’ /usr/share/gems/gems/rack-2.2.21/lib/rack/urlmap.rb:74:in `block in call’ /usr/share/gems/gems/rack-2.2.21/lib/rack/urlmap.rb:58:in `each’ /usr/share/gems/gems/rack-2.2.21/lib/rack/urlmap.rb:58:in `call’ /usr/share/gems/gems/rack-2.2.21/lib/rack/builder.rb:244:in `call’ /usr/share/gems/gems/rack-2.2.21/lib/rack/handler/webrick.rb:95:in `service’ /usr/share/gems/gems/webrick-1.9.1/lib/webrick/httpserver.rb:140:in `service’ /usr/share/gems/gems/webrick-1.9.1/lib/webrick/httpserver.rb:96:in `run’ /usr/share/gems/gems/webrick-1.9.1/lib/webrick/server.rb:310:in `block in start_thread’ /usr/share/gems/gems/logging-2.4.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context’

just found Foreman smart-proxies sync problem ERF12-0457 - Support - TheForeman

Seems there is a null field bug unfortunately. I am running 4.17 which was latest stable. Never had this issue before, so please could a dev explain how this bug came in? Was it a “feature” introduced in this version for any hosts not registered properly in Foreman? Can’t see anything in the release notes about it