Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1937024

Summary: Installing satellite from certain directories will fail on Failed to call refresh: 'pulpcore-manager collectstatic --noinput' returned 1 instead of one of [0]
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: high Docs Contact:
Priority: high    
Version: 6.9.0CC: ahumbe, egolov, ekohlvan, gpadholi, iballou, ltran, saydas, smallamp, ttereshc
Target Milestone: 6.9.1Keywords: PrioBumpGSS, Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pulpcore-3.7.4,foreman-installer-2.3.1.11-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-26 17:36:58 UTC 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 Justin Sherrill 2021-03-09 17:20:33 UTC
Description of problem:

Try to install satellite from the /root/ or /root/somedir  directory.  the important part is that the pulpcore user should not be able to read it.  (its unclear if just /root will reproduce the problem or if it has to be /root/somedir)

you will get:

Failed to call refresh: 'pulpcore-manager collectstatic --noinput' returned 1 instead of one of [0]


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


Steps to Reproduce:
1.  as root:  mkdir /root/somedir
2.  cd /root/somedir
3.  run the installer for the first time: satellite-installer

Actual results:

 Failed to call refresh: 'pulpcore-manager collectstatic --noinput' returned 1 instead of one of [0]

upon deeper investigation we see:

Exec[pulpcore-manager collectstatic --noinput]/returns: Traceback (most recent call last):
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/bin/pulpcore-manager", line 11, in <module>
Exec[pulpcore-manager collectstatic --noinput]/returns:     load_entry_point('pulpcore==3.7.3', 'console_scripts', 'pulpcore-manager')()
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/pulpcore/app/manage.py", line 11, in manage
Exec[pulpcore-manager collectstatic --noinput]/returns:     execute_from_command_line(sys.argv)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
Exec[pulpcore-manager collectstatic --noinput]/returns:     utility.execute()
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 325, in execute
Exec[pulpcore-manager collectstatic --noinput]/returns:     settings.INSTALLED_APPS
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/django/conf/__init__.py", line 79, in __getattr__
Exec[pulpcore-manager collectstatic --noinput]/returns:     self._setup(name)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/django/conf/__init__.py", line 66, in _setup
Exec[pulpcore-manager collectstatic --noinput]/returns:     self._wrapped = Settings(settings_module)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/django/conf/__init__.py", line 157, in __init__
Exec[pulpcore-manager collectstatic --noinput]/returns:     mod = importlib.import_module(self.SETTINGS_MODULE)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
Exec[pulpcore-manager collectstatic --noinput]/returns:     return _bootstrap._gcd_import(name[level:], package, level)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/pulpcore/app/settings.py", line 248, in <module>
Exec[pulpcore-manager collectstatic --noinput]/returns:     ENVVAR_FOR_DYNACONF="PULP_SETTINGS",
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/dynaconf/contrib/django_dynaconf_v2.py", line 76, in load
Exec[pulpcore-manager collectstatic --noinput]/returns:     lazy_settings.populate_obj(django_settings_module)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/dynaconf/base.py", line 141, in __getattr__
Exec[pulpcore-manager collectstatic --noinput]/returns:     self._setup()
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/dynaconf/base.py", line 186, in _setup
Exec[pulpcore-manager collectstatic --noinput]/returns:     default_settings.reload(self._kwargs.get("load_dotenv"))
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/dynaconf/default_settings.py", line 67, in reload
Exec[pulpcore-manager collectstatic --noinput]/returns:     start_dotenv(*args, **kwargs)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/dynaconf/default_settings.py", line 53, in start_dotenv
Exec[pulpcore-manager collectstatic --noinput]/returns:     or _find_file(".env", project_root=root_path)
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/dynaconf/utils/files.py", line 60, in find_file
Exec[pulpcore-manager collectstatic --noinput]/returns:     search_tree.extend(_walk_to_root(work_dir))
Exec[pulpcore-manager collectstatic --noinput]/returns:   File "/usr/lib/python3.6/site-packages/dynaconf/utils/files.py", line 13, in _walk_to_root
Exec[pulpcore-manager collectstatic --noinput]/returns:     raise IOError("Starting path not found")
Exec[pulpcore-manager collectstatic --noinput]/returns: OSError: Starting path not found
Exec[pulpcore-manager collectstatic --noinput]: Failed to call refresh: 'pulpcore-manager collectstatic --noinput' returned 1 instead of one of [0]
Exec[pulpcore-manager collectstatic --noinput]: 'pulpcore-manager collectstatic --noinput' returned 1 instead of one of [0]
Exec[pulpcore-manager collectstatic --noinput]: Evaluated in 0.65 seconds

Comment 1 Justin Sherrill 2021-03-09 17:22:08 UTC
This is fixed by https://github.com/pulp/pulpcore/pull/1166

we'll need it to be backported to 3.7 and 3.9

Comment 2 Justin Sherrill 2021-03-09 18:59:43 UTC
backport request to 3.7:  https://pulp.plan.io/issues/8373

Comment 3 Justin Sherrill 2021-03-26 18:37:27 UTC
the pulp issue is closed, this should be in POST

Comment 6 Evgeni Golov 2021-04-07 10:19:20 UTC
Brad, I am going to assume you meant 6.9.z+, not 6.7.z+ here ;)

Comment 7 Lai 2021-04-09 18:57:33 UTC
I'm still seeing this error after installing in /root/somedir/

Failed to call refresh: 'pulpcore-manager collectstatic --noinput' returned 1 instead of one of [0]


Here's the error log:
021-04-08 16:36:03 [ERROR ] [configure] 'pulpcore-manager migrate --noinput' returned 1 instead of one of [0]
2021-04-08 16:36:03 [ERROR ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: change from 'notrun' to ['0'] failed: 'pulpcore-manager migrate --noinput' returned 1 instead of one of [0]
2021-04-08 16:36:04 [ERROR ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]: Failed to call refresh: 'pulpcore-manager migrate --noinput' returned 1 instead of one of [0]
2021-04-08 16:36:04 [ERROR ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]: 'pulpcore-manager migrate --noinput' returned 1 instead of one of [0]
2021-04-08 16:36:04 [NOTICE] [configure] 2300 out of 2341 done.
2021-04-08 16:36:08 [NOTICE] [configure] System configuration has finished.
 
  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.
 
  The full log is at /var/log/foreman-installer/satellite.log

Failed for 6.9.1_01

Comment 8 Tanya Tereshchenko 2021-04-12 17:03:44 UTC
Lai, can you check if /usr/lib/python3.6/site-packages/pulpcore/app/settings.py has this one line https://github.com/pulp/pulpcore/commit/9d7a7e71fef645f8b37c9f68e6f3137871e687ed#diff-4e1146f075426039ac8e1350e88fe5736a3e50872a42d101bfc8bc1b7f483574R249 ?

Comment 14 Ian Ballou 2021-04-13 16:39:03 UTC
Created redmine issue https://projects.theforeman.org/issues/32309 from this bug

Comment 19 Lai 2021-04-16 14:46:18 UTC
Steps to test:

1.  as root:  mkdir /root/somedir
2.  cd /root/somedir
3.  run the installer for the first time: satellite-installer

Expected results:
Should install successfully without issues with "satellite-installer --scenario satellite" command

[root@dhcp-2-77 somedir]# satellite-installer --scenario satellite
2021-04-16 10:14:00 [NOTICE] [root] Loading default values from puppet modules...
2021-04-16 10:14:04 [NOTICE] [root] ... finished
2021-04-16 10:14:07 [NOTICE] [root] Running validation checks
2021-04-16 10:17:03 [NOTICE] [configure] Starting system configuration.
  The total number of configuration tasks may increase during the run.
  Observe logs or specify --verbose-log-level to see individual configuration tasks.
2021-04-16 10:17:17 [NOTICE] [configure] 100 out of 2310 done.
2021-04-16 10:17:17 [NOTICE] [configure] 200 out of 2310 done.
2021-04-16 10:17:32 [NOTICE] [configure] 300 out of 2310 done.
2021-04-16 10:18:01 [NOTICE] [configure] 400 out of 2310 done.
2021-04-16 10:18:31 [NOTICE] [configure] 500 out of 2310 done.
2021-04-16 10:19:25 [NOTICE] [configure] 600 out of 2310 done.
2021-04-16 10:19:38 [NOTICE] [configure] 700 out of 2312 done.
2021-04-16 10:19:38 [NOTICE] [configure] 800 out of 2312 done.
2021-04-16 10:19:38 [NOTICE] [configure] 900 out of 2314 done.
2021-04-16 10:19:44 [NOTICE] [configure] 1000 out of 2315 done.
2021-04-16 10:19:46 [NOTICE] [configure] 1100 out of 2333 done.
2021-04-16 10:20:32 [NOTICE] [configure] 1200 out of 2335 done.
2021-04-16 10:21:04 [NOTICE] [configure] 1300 out of 2336 done.
2021-04-16 10:21:04 [NOTICE] [configure] 1400 out of 2339 done.
2021-04-16 10:21:21 [NOTICE] [configure] 1500 out of 2339 done.
2021-04-16 10:21:23 [NOTICE] [configure] 1600 out of 2341 done.
2021-04-16 10:21:42 [NOTICE] [configure] 1700 out of 2341 done.
2021-04-16 10:30:51 [NOTICE] [configure] 1800 out of 2341 done.
2021-04-16 10:30:52 [NOTICE] [configure] 1900 out of 2341 done.
2021-04-16 10:33:24 [NOTICE] [configure] 2000 out of 2341 done.
2021-04-16 10:33:24 [NOTICE] [configure] 2100 out of 2341 done.
2021-04-16 10:34:10 [NOTICE] [configure] 2200 out of 2341 done.
2021-04-16 10:34:51 [NOTICE] [configure] 2300 out of 2341 done.
2021-04-16 10:35:09 [NOTICE] [configure] System configuration has finished.
  Success!


Actual results:
Installs successfully without issues with "satellite-installer --scenario satellite"

[root@dhcp-2-77 somedir]# satellite-installer --scenario satellite
2021-04-16 10:14:00 [NOTICE] [root] Loading default values from puppet modules...
2021-04-16 10:14:04 [NOTICE] [root] ... finished
2021-04-16 10:14:07 [NOTICE] [root] Running validation checks
2021-04-16 10:17:03 [NOTICE] [configure] Starting system configuration.
  The total number of configuration tasks may increase during the run.
  Observe logs or specify --verbose-log-level to see individual configuration tasks.
2021-04-16 10:17:17 [NOTICE] [configure] 100 out of 2310 done.
2021-04-16 10:17:17 [NOTICE] [configure] 200 out of 2310 done.
2021-04-16 10:17:32 [NOTICE] [configure] 300 out of 2310 done.
2021-04-16 10:18:01 [NOTICE] [configure] 400 out of 2310 done.
2021-04-16 10:18:31 [NOTICE] [configure] 500 out of 2310 done.
2021-04-16 10:19:25 [NOTICE] [configure] 600 out of 2310 done.
2021-04-16 10:19:38 [NOTICE] [configure] 700 out of 2312 done.
2021-04-16 10:19:38 [NOTICE] [configure] 800 out of 2312 done.
2021-04-16 10:19:38 [NOTICE] [configure] 900 out of 2314 done.
2021-04-16 10:19:44 [NOTICE] [configure] 1000 out of 2315 done.
2021-04-16 10:19:46 [NOTICE] [configure] 1100 out of 2333 done.
2021-04-16 10:20:32 [NOTICE] [configure] 1200 out of 2335 done.
2021-04-16 10:21:04 [NOTICE] [configure] 1300 out of 2336 done.
2021-04-16 10:21:04 [NOTICE] [configure] 1400 out of 2339 done.
2021-04-16 10:21:21 [NOTICE] [configure] 1500 out of 2339 done.
2021-04-16 10:21:23 [NOTICE] [configure] 1600 out of 2341 done.
2021-04-16 10:21:42 [NOTICE] [configure] 1700 out of 2341 done.
2021-04-16 10:30:51 [NOTICE] [configure] 1800 out of 2341 done.
2021-04-16 10:30:52 [NOTICE] [configure] 1900 out of 2341 done.
2021-04-16 10:33:24 [NOTICE] [configure] 2000 out of 2341 done.
2021-04-16 10:33:24 [NOTICE] [configure] 2100 out of 2341 done.
2021-04-16 10:34:10 [NOTICE] [configure] 2200 out of 2341 done.
2021-04-16 10:34:51 [NOTICE] [configure] 2300 out of 2341 done.
2021-04-16 10:35:09 [NOTICE] [configure] System configuration has finished.
  Success!

Verified on 6.9.1_02 with python3-pulpcore-3.7.5-1.el7pc.noarch

Comment 24 errata-xmlrpc 2021-04-26 17:36:58 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.9.1 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:1371