Bug 2100801

Summary: Upgrade to 6.11 fails if there is a setting "Append domain names to the host = No"
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: SettingsAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.11.0CC: ahumbe, apatel, ehelms, lstejska, mhulan, mjivraja, shwsingh
Target Milestone: UnspecifiedKeywords: Triaged, Upgrades
Target Release: UnusedFlags: shwsingh: needinfo? (lpramuk)
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Pramuk 2022-06-24 10:33:24 UTC
Description of problem:
Upgrade to 6.11 fails if there is a setting "Append domain names to the host = No"
While upgrade along 6.10.z stream is OK with this setting.

Version-Release number of selected component (if applicable):
6.11.0

How reproducible:
deterministic

Steps to Reproduce:
1. Have a customer DB backup which uses "Append domain names to the host = No"
2. Upgrade to 6.11

Running Migration scripts to Satellite 6.11
================================================================================
Setup repositories:                                                   [ALREADY RUN]
The step was skipped as it was already run and it is marked as run_once. Use --force to enforce the execution.
--------------------------------------------------------------------------------
Unlock packages:                                                      [OK]
--------------------------------------------------------------------------------
Update package(s) :                                                   [OK]
--------------------------------------------------------------------------------
Run installer with Candlepin SSL CA when using external database with SSL: 
/ Executing installer                                                 [FAIL]    
Failed executing LANG=en_US.utf-8 satellite-installer  --disable-system-checks, exit status 6:
 2022-06-22 06:26:34 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-06-22 06:26:42 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-06-22 06:26:42 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-06-22 06:26:50 [WARN  ] [pre] Skipping system checks.
2022-06-22 06:26:50 [WARN  ] [pre] Skipping system checks.
2022-06-22 06:26:57 [NOTICE] [configure] Starting system configuration.
2022-06-22 06:27:12 [NOTICE] [configure] 250 configuration steps out of 2190 steps complete.
2022-06-22 06:27:19 [NOTICE] [configure] 500 configuration steps out of 2194 steps complete.
2022-06-22 06:27:21 [NOTICE] [configure] 750 configuration steps out of 2196 steps complete.
2022-06-22 06:27:25 [NOTICE] [configure] 1000 configuration steps out of 2201 steps complete.
2022-06-22 06:27:26 [NOTICE] [configure] 1250 configuration steps out of 2205 steps complete.
2022-06-22 06:29:55 [NOTICE] [configure] 1500 configuration steps out of 2206 steps complete.
2022-06-22 06:29:59 [NOTICE] [configure] 1750 configuration steps out of 3010 steps complete.
2022-06-22 06:30:00 [NOTICE] [configure] 2000 configuration steps out of 3010 steps complete.
2022-06-22 06:30:00 [NOTICE] [configure] 2250 configuration steps out of 3010 steps complete.
2022-06-22 06:30:01 [NOTICE] [configure] 2500 configuration steps out of 3010 steps complete.
2022-06-22 06:30:01 [NOTICE] [configure] 2750 configuration steps out of 3010 steps complete.
2022-06-22 06:30:15 [ERROR ] [configure] Host satellite.example.com does not exist in Foreman at https://satellite.example.com/
2022-06-22 06:30:15 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy_host[foreman-proxy-satellite.example.com]/ensure: change from 'absent' to 'pre
sent' failed: Host satellite.example.com does not exist in Foreman at https://satellite.example.com/
2022-06-22 06:30:16 [NOTICE] [configure] 3000 configuration steps out of 3010 steps complete.
2022-06-22 06:30:23 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.


Actual results:
upgrade fails

Expected results:
upgrade succeeds or document how to get around this issue

Comment 2 Lukas Pramuk 2022-06-24 10:48:43 UTC
comment#0 has output after applying workaround, so the output should be:

2022-06-21 05:13:09 [ERROR ] [configure] Host satellite.example.com does not exist in Foreman at https://satellite.example.com/
2022-06-21 05:13:09 [ERROR ] [configure] /Stage[main]/Foreman::Register/Foreman_instance_host[foreman-satellite.example.com]/ensure: change from 'absent' to 'present' failed: 
Host satellite.example.com does not exist in Foreman at https://satellite.example.com/
2022-06-21 05:14:49 [ERROR ] [configure] Host satellite.example.com does not exist in Foreman at https://satellite.example.com/
2022-06-21 05:14:49 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy_host[foreman-proxy-satellite.example.com]/ensure: change from 'absent' to 'present' failed: Host satellite.example.com does not exist in Foreman at https://satellite.example.com/


there is a following workaround:

/etc/foreman-installer/custom-hiera.yaml:
foreman::register::foreman_host_name: satellite         <- hostname w/o domain part

After applying you still get 2nd issue: 

2022-06-22 06:30:15 [ERROR ] [configure] Host satellite.example.com does not exist in Foreman at https://satellite.example.com/
2022-06-22 06:30:15 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy_host[foreman-proxy-satellite.example.com]/ensure: change from 'absent' to 'present' failed: Host satellite.example.com does not exist in Foreman at https://satellite.example.com/

there is another workaround: 

# satellite-installer --foreman-proxy-registered-name satellite      <- hostname w/o domain part

and you get a last issue:

2022-06-22 06:58:52 [ERROR ] [configure] Error making POST request to Foreman at https://satellite.example.com/api/v2/smart_proxies: URL Only one declaration of a proxy is allowed
2022-06-22 06:58:52 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[satellite]/ensure: change from 'absent' to 'present' failed: Error making POST request to Foreman at https://satellite.example.com/api/v2/smart_proxies: URL Only one declaration of a proxy is allowed

it tries to create new proxy with the url already used, so the last workaround is:

# hammer proxy update --name satellite.example.com --new-name satellite    <- hostname w/o domain part

Comment 4 Marek Hulan 2022-10-14 12:51:12 UTC
The discussion seems to be in favor of dropping the setting entirely, keeping the domain appeneded all the time. For users who don't want to see the domain in the host list, this can be implemented on a view layer, the database would though always store the whole name. Moving to the settings component. I will make sure we'll deprecate this setting in the earliest possible Satellite version.

Comment 6 Brad Buckingham 2023-07-21 21:06:39 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.