Bug #37631
closedHost registration with repositories fails because smart-proxy cannot convert arrays to string
Description
If you go to the Host Registration form in foreman and choose a smart-proxy and multiple repositories, the registration fails with an internal server error. This is due to the new format of the repo_data in the API which supports an array of repository and corresponding gpg key pairs (https://github.com/theforeman/foreman/blob/develop/app/controllers/api/v2/registration_controller.rb#L29).
- /var/log/foreman-proxy/proxy.log
2024-06-06T17:13:35 d31a2f91 [I] Started GET /register force=true&hostgroup_id=105&ignore_subman_errors=false&location_id=3&organization_id=1&packages=katello-host-tools-tracer+katello-pull-transport-migrate&repo_data%5B%5D%5Bre
pository%5D=deb+http%3A%2F%2Fstreamed.supp207.mk%2Fpulp%2Fdeb%2F75bba7ec-6d79-4269-841a-15a32b0747d4%2FTest%2FCV_Debian_Bookworm%2Fcustom%2FDebian_Client%2FDebian_Client_12%2F+stable+main&repo_data%5B%5D%5Brepo_gpg_key_url%5D=ht
tp%3A%2F%2Fstreamed.supp207.mk%2Fpub%2Fpulp_deb_signing.key&update_packages=false
2024-06-06T17:13:35 d31a2f91 [W] Error when rendering Global Registration Template: <TypeError>: no implicit conversion of Array into String
/usr/share/foreman-proxy/lib/proxy/request.rb:13:in `escape'
/usr/share/foreman-proxy/lib/proxy/request.rb:13:in `block in query_string'
/usr/share/foreman-proxy/lib/proxy/request.rb:13:in `each'
/usr/share/foreman-proxy/lib/proxy/request.rb:13:in `map'
/usr/share/foreman-proxy/lib/proxy/request.rb:13:in `query_string'
/usr/share/foreman-proxy/lib/proxy/request.rb:18:in `create_get'
/usr/share/foreman-proxy/modules/registration/proxy_request.rb:6:in `global_register'
/usr/share/foreman-proxy/modules/registration/registration_api.rb:5:in `block in <class:Api>'
Updated by The Foreman Bot 6 months ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/smart-proxy/pull/901 added
Updated by Nadja Heitmann 5 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset fa4e8d07c2ee3f3f07b6f6164825a3589426b7c9.
Updated by Ewoud Kohl van Wijngaarden 4 months ago
- Triaged changed from No to Yes