Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1942073 - Satellite 6.7.5 to 6.8.5 upgrade failed with error "could not change directory to "/root"".
Summary: Satellite 6.7.5 to 6.8.5 upgrade failed with error "could not change director...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.8.5
Assignee: satellite6-bugs
QA Contact: Devendra Singh
URL:
Whiteboard:
Depends On:
Blocks: 1940473
TreeView+ depends on / blocked
 
Reported: 2021-03-23 15:28 UTC by Jameer Pathan
Modified: 2021-04-01 14:44 UTC (History)
6 users (show)

Fixed In Version: foreman-installer-2.1.2.13-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-01 14:44:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:1057 0 None None None 2021-04-01 14:44:43 UTC

Description Jameer Pathan 2021-03-23 15:28:52 UTC
Description of problem:
Satellite 6.7 to 6.8.5 failed with error "could not change directory to "/root"".

Version-Release number of selected component (if applicable):
- Satellite 6.8.5 snap 2
- rubygem-foreman_maintain-0.6.16-1.el7sat.noarch


How reproducible:
- Always

Steps to Reproduce:
1. Install Satellite 6.7.5
2. Try upgrading it to Satellite 6.8.5 snap 2

Actual results:
- Satellite upgrade failed with `could not change directory to "/root"` error.
--------------------------------------------------------------------------------
Update package(s) :                                                   [OK]
--------------------------------------------------------------------------------
Procedures::Installer::Upgrade:                                       [FAIL]
Failed executing LANG=en_US.utf-8 satellite-installer  --disable-system-checks, exit status 1:
 could not change directory to "/root"
--------------------------------------------------------------------------------
Scenario [Migration scripts to Satellite 6.8] failed.

The following steps ended up in failing state:

  [installer-upgrade]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="installer-upgrade"

Expected results:
- Satellite upgrade completes successfully.

Additional info:

Comment 5 Evgeni Golov 2021-03-24 10:34:00 UTC
The relevant log entry doesn't make any sense to me:

[DEBUG 2021-03-24T00:49:32 main] Executing: foreman-maintain service start --only=postgresql
[DEBUG 2021-03-24T00:49:43 main] Running Start Services
[DEBUG 2021-03-24T00:49:43 main] ================================================================================
[DEBUG 2021-03-24T00:49:43 main] Check if command is run as root user:                                 ESC[32mESC[1m[OK]ESC[0m
[DEBUG 2021-03-24T00:49:43 main] --------------------------------------------------------------------------------
[DEBUG 2021-03-24T00:49:43 main] Start applicable services: 
[DEBUG 2021-03-24T00:49:43 main] 
[DEBUG 2021-03-24T00:49:43 main] Starting the following service(s):
[DEBUG 2021-03-24T00:49:43 main] postgresql
[DEBUG 2021-03-24T00:49:43 main] ^M                                                                                ^M| ^M                                                                                ^M/ ^M                                                                                ^M/ starting postgresql^M                                                                                ^M/ All services started                                                ESC[32mESC[1m[OK]ESC[0m
[DEBUG 2021-03-24T00:49:43 main] --------------------------------------------------------------------------------
[DEBUG 2021-03-24T00:49:43 main] 
[DEBUG 2021-03-24T00:49:43 main] foreman-maintain service start --only=postgresql finished successfully!
[DEBUG 2021-03-24T00:49:44 main] Executing: foreman-maintain service stop
[DEBUG 2021-03-24T00:49:55 main] Running Stop Services
[DEBUG 2021-03-24T00:49:55 main] ================================================================================
[DEBUG 2021-03-24T00:49:55 main] Check if command is run as root user:                                 ESC[32mESC[1m[OK]ESC[0m
[DEBUG 2021-03-24T00:49:55 main] --------------------------------------------------------------------------------
[DEBUG 2021-03-24T00:49:55 main] Stop applicable services: 
[DEBUG 2021-03-24T00:49:55 main] 
[DEBUG 2021-03-24T00:49:55 main] Stopping the following service(s):
[DEBUG 2021-03-24T00:49:55 main] rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflow-sidekiq@orchestrator, elasticsearch, httpd, puppetserver, dynflow-sidekiq@worker, foreman-proxy
[DEBUG 2021-03-24T00:49:55 main] ^M                                                                                ^M| ^M                                                                                ^M/ ^M                                                                                ^M/ stopping foreman-proxy^M                                                                                ^M/ stopping dynflow-sidekiq@worker^M                                                                                ^M/ stopping puppetserver^M                                                                                ^M/ stopping httpd^M                                                                                ^M/ stopping elasticsearch^M                                                                                ^M/ stopping dynflow-sidekiq@orchestrator^M                                                                                ^M/ stopping tomcat^M                                                                                ^M/ stopping smart_proxy_dynflow_core^M                                                                                ^M/ stopping pulp_workers^M                                                                                ^M/ stopping pulp_streamer^M                                                                                
^M/ stopping pulp_resource_manager^M                                                                                ^M/ stopping pulp_celerybeat^M                                                                                ^M/ stopping squid^M                                                                                ^M/ stopping qpidd^M                                                                                ^M/ stopping qdrouterd^M                                                                                ^M/ stopping postgresql^M                                                                                ^M/ stopping rh-mongodb34-mongod^M                                                                                ^M/ All services stopped                                                ESC[32mESC[1m[OK]ESC[0m
[DEBUG 2021-03-24T00:49:55 main] --------------------------------------------------------------------------------
[DEBUG 2021-03-24T00:49:55 main] 
[DEBUG 2021-03-24T00:49:55 main] foreman-maintain service stop finished successfully!
[DEBUG 2021-03-24T00:49:55 main] Exit with status code: 1 (signal was 1)
[DEBUG 2021-03-24T00:49:55 main] Cleaning /tmp/kafo_installation20210324-12467-l0g2ac
[DEBUG 2021-03-24T00:49:55 main] Cleaning /tmp/default_values.yaml
[ INFO 2021-03-24T00:49:55 main] Installer finished in 40.259736021 seconds

Comment 6 Evgeni Golov 2021-03-24 10:45:27 UTC
Ah, the line before that is
[DEBUG 2021-03-24T00:49:32 main] Hook /usr/share/foreman-installer/hooks/pre/25-remove_apache_from_foreman_group.rb returned true

So it's done with 25-remove_apache_from_foreman_group.rb and the next hook is 30-el7_upgrade_postgresql.rb, and the start and stop above matches the following:
  start_services(['postgresql'])
  (_name, _owner, _enconding, collate, ctype, _privileges) = `runuser postgres -c 'psql -lt | grep -E "^\s+postgres"'`.chomp.split('|').map(&:strip)
  stop_services

But stop services would only exit 1, if services stop was not successful, but the line above says it was?!

Ah, sneaky... it's not the f-maintain that failed, it's the RPM that was added in here:
https://gitlab.sat.engineering.redhat.com/satellite6/foreman-installer/-/commit/5d1c0af2ff48454c647aaab72fd3a6b6ad66b8a3

Comment 7 Jameer Pathan 2021-03-30 08:09:28 UTC
Satellite 6.7.5 to Satellite 6.8.5 snap 3 upgrade completed successfully for me.

Comment 8 Devendra Singh 2021-03-30 11:06:03 UTC
Verified on 6.8.5 Snap 3

Satellite upgrade completed successfully from 6.7.5 to 6.8.5 Snap3.

Comment 9 Patrick Creech 2021-04-01 14:44:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.8.5 Async Bug Fix Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1057


Note You need to log in before you can comment on or make changes to this bug.