Problem register debian based OS hosts in Foreman 3.17

Problem: Problem with register debian based OS

Expected outcome:

Foreman and Proxy versions: 3.17.0

Foreman and Proxy plugin versions: 3.17.0

Distribution and version: AlmaLinux9

Other relevant data:

Hello! We have troubte with register Debian-based OS hosts after upgrading from 3.15→3.17→3.17

I I made a registration script in the web GUI.
Scripts output:
``
set -o pipefail && curl --silent --show-error ‘https:/foreman.example.com/register?activation_keys=nBCD&download_utility=curl&force=true&hostgroup_id=1&ignore_subman_errors=true&location_id=2&organization_id=3&update_packages=false’ --header 'Authorization: Bearer ****| bash -x
``
script fail at:
```
UUID=5278d7b6-3260-4486-8e5e-872f7fd49530

  • curl --silent --show-error https://foreman.example.com/register --cacert /etc/rhsm/ca/katello-server-ca.pem --fail --request POST --output /root/registration_host_init.sh --header ‘Authorization: Bearer ***** --data ‘host[build]=false’ --data ‘host[organization_id]=3’ --data ‘host[location_id]=2’ --data ‘host[hostgroup_id]=1’ --data update_packages=false
    curl: (22) The requested URL returned error: 422
```

on foreman:
hammer host info --name hostname.example.com --fields ‘Subscription information/uuid’

Subscription Information:
Uuid: 5278d7b6-3260-4486-8e5e-872f7fd49530

On host:
curl --silent --show-error https://s-msk-p-foreman-alma-c.raiffeisen.ru/register --cacert /etc/rhsm/ca/katello-server-ca.pem --fail --request POST --header 'Authorization: Bearer **** –data uuid=5278d7b6-3260-4486-8e5e-872f7fd49530 --data ‘host[build]=false’ --data ‘host[organization_id]=3’ --data ‘host[location_id]=2’ --data ‘host[hostgroup_id]=1’ --data update_packages=false
curl: (22) The requested URL returned error: 422

1 Like

Hello @lokhankin ,

Your Foreman production logs should have more information about that 422 error, would you mind pasting them here?

Hello @iballou !
Registration script run:
subscription-manager register --org=RBRU-Astralinux --activationkey=nBCD
The system has been registered with ID: 682e90ef-551a-47cc-a40f-0793a55703f1
The registered system name is: s-msk-t-ug-ruamod2-astra18-2

  • register_katello_host
    ++ subscription-manager identity
    ++ grep --max-count 1 --only-matching ‘([[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12})’

  • UUID=682e90ef-551a-47cc-a40f-0793a55703f1

    Then starts curl:
    curl --silent --show-error https://foreman.example.com/register --cacert /etc/rhsm/ca/katello-server-ca.pem --fail --request POST --output /root/registration_host_init.sh --header 'Authorization: Bearer ***’ –data uuid=682e90ef-551a-47cc-a40f-0793a55703f1 --data ‘host[build]=false’ --data ‘host[organization_id]=3’ --data ‘host[location_id]=2’ --data ‘host[hostgroup_id]=1’ --data update_packages=false

    And if fail with error: The requested URL returned error: 422
    That is, a request to the API via CURL does not find a host with Subscription information/uuid=682e90ef-551a-47cc-a40f-0793a55703f1 in Foreman

    But, on foreman:
    hammer host info --name hostname --fields ‘Subscription information/uuid’

    Subscription Information:
    Uuid: 682e90ef-551a-47cc-a40f-0793a55703f1

Logs production.lofg on foreman:

2026-01-22T20:07:58 [I|app|cc3979eb] Parameters: {“uuid”=>“682e90ef-551a-47cc-a40f-0793a55703f1”, “host”=>{“build”=>“false”, “organization_id”=>“3”, “location_id”=>“2”, “hostgroup_id”=>“1”}, “update_packages”=>“false”}
2026-01-22T20:07:58 [I|app|cc3979eb] Authorized user user(User)
2026-01-22T20:07:58 [I|aud|cc3979eb] Host::Base (131) update event on hostgroup_id , 1
2026-01-22T20:07:58 [I|aud|cc3979eb] Host::Base (131) update event on owner_id 1, 5
2026-01-22T20:07:58 [I|aud|cc3979eb] Parameter (255) create event on name host_update_packages
2026-01-22T20:07:58 [I|aud|cc3979eb] Parameter (255) create event on value false
2026-01-22T20:07:58 [I|aud|cc3979eb] Parameter (255) create event on reference_id 131
2026-01-22T20:07:58 [I|aud|cc3979eb] Parameter (255) create event on hidden_value false
2026-01-22T20:07:58 [I|aud|cc3979eb] Parameter (255) create event on key_type boolean
2026-01-22T20:07:58 [I|app|cc3979eb] Rendered text template (Duration: 0.0ms | Allocations: 1)
2026-01-22T20:07:58 [I|app|cc3979eb] Completed 422 Unprocessable Entity in 65ms (Views: 0.4ms | ActiveRecord: 13.3ms | Allocations: 33569)

1 Like

@jeremylenz it looks like something strange is going on here with the host’s UUID during registration. There isn’t a lot of information, so I’m not pinpointing where the troubles might be. Do you have an idea?

There wasn’t a stack trace in the production logs around the 422 error? I wonder if enabling debug logging might help.

There has to be a stack trace in production.log explaining that 422. We really don’t have enough information..

1 Like