Project

General

Profile

Actions

Bug #37631

closed

Host registration with repositories fails because smart-proxy cannot convert arrays to string

Added by Nadja Heitmann 6 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Registration
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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).

  1. /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>'

Actions

Also available in: Atom PDF