Problem:
Pulp3 installation error: ImportError: cannot import name ‘get_domain_pk’ from ‘pulpcore.plugin.util’
Expected outcome:
Following command should install pulp3 install in a single server successfully
ansible-playbook playbooks/example-use/playbook.yml -u root --ask-become-pass -i pulp01
Pulpcore version:
whatever comes with the following steps …
pwd
/root
ansible-galaxy collection install pulp.pulp_installer -p .
cd pulp/pulp_installer/
ansible-galaxy install -r requirements.yml
ansible-playbook playbooks/example-use/playbook.yml -u root --ask-become-pass -i pulp01, -vvv
Pulp plugins installed and their versions:
Operating system - distribution and version:
Rhel 9, Kernel version: uname -r: 5.14.0-427.13.1.el9_4.x86_64
Other relevant data:
Playbook section where getting errors:
…
… …
…
Running a single node install into a Rhel 9 host: pulp01
hostname: pulp01
Playbook command ran:
ansible-playbook playbooks/example-use/playbook.yml -u root --ask-become-pass -i pulp01
… Output trimmed …
Result: The playbook is failing here
…
TASK [pulp.pulp_installer.pulp_database_config : Run database migrations]
fatal: [pulp01]: FAILED! => {
“changed”: true,
“cmd”: [
“/usr/local/lib/pulp/bin/pulpcore-manager”,
“migrate”,
“–no-input”
],
“delta”: “0:00:00.811833”,
“end”: “2024-05-24 13:43:14.442623”,
“invocation”: {
“module_args”: {
“_raw_params”: “/usr/local/lib/pulp/bin/pulpcore-manager migrate --no-input”,
“_uses_shell”: false,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2024-05-24 13:43:13.630790”,
“stderr”: “Traceback (most recent call last):\n File “/usr/local/lib/pulp/bin/pulpcore-manager”, line 8, in \n sys.exit(manage())\n File “/usr/local/lib/pulp/lib64/python3.9/site-packages/pulpcore/app/manage.py”, line 11, in manage\n execute_from_command_line(sys.argv)\n File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line\n utility.execute()\n File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/core/management/init.py”, line 395, in execute\n django.setup()\n File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/init.py”, line 24, in setup\n apps.populate(settings.INSTALLED_APPS)\n File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/apps/registry.py”, line 114, in populate\n app_config.import_models()\n File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/apps/config.py”, line 301, in import_models\n self.models_module = import_module(models_module_name)\n File “/usr/lib64/python3.9/importlib/init.py”, line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File “”, line 1030, in _gcd_import\n File “”, line 1007, in _find_and_load\n File “”, line 986, in _find_and_load_unlocked\n File “”, line 680, in _load_unlocked\n File “”, line 850, in exec_module\n File “”, line 228, in _call_with_frames_removed\n File “/usr/local/lib/pulp/lib64/python3.9/site-packages/pulp_file/app/models.py”, line 16, in \n from pulpcore.plugin.util import get_domain_pk\nImportError: cannot import name ‘get_domain_pk’ from ‘pulpcore.plugin.util’ (/usr/local/lib/pulp/lib64/python3.9/site-packages/pulpcore/plugin/util.py)”,
“stderr_lines”: [
“Traceback (most recent call last):”,
" File “/usr/local/lib/pulp/bin/pulpcore-manager”, line 8, in “,
" sys.exit(manage())”,
" File “/usr/local/lib/pulp/lib64/python3.9/site-packages/pulpcore/app/manage.py”, line 11, in manage",
" execute_from_command_line(sys.argv)",
" File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line",
" utility.execute()",
" File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/core/management/init.py”, line 395, in execute",
" django.setup()",
" File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/init.py”, line 24, in setup",
" apps.populate(settings.INSTALLED_APPS)",
" File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/apps/registry.py”, line 114, in populate",
" app_config.import_models()",
" File “/usr/local/lib/pulp/lib64/python3.9/site-packages/django/apps/config.py”, line 301, in import_models",
" self.models_module = import_module(models_module_name)",
" File “/usr/lib64/python3.9/importlib/init.py”, line 127, in import_module",
" return _bootstrap._gcd_import(name[level:], package, level)",
" File “”, line 1030, in _gcd_import",
" File “”, line 1007, in _find_and_load",
" File “”, line 986, in _find_and_load_unlocked",
" File “”, line 680, in _load_unlocked",
" File “”, line 850, in exec_module",
" File “”, line 228, in _call_with_frames_removed",
" File “/usr/local/lib/pulp/lib64/python3.9/site-packages/pulp_file/app/models.py”, line 16, in “,
" from pulpcore.plugin.util import get_domain_pk”,
“ImportError: cannot import name ‘get_domain_pk’ from ‘pulpcore.plugin.util’ (/usr/local/lib/pulp/lib64/python3.9/site-packages/pulpcore/plugin/util.py)”
],
“stdout”: “”,
“stdout_lines”: []
}
NO MORE HOSTS LEFT **********************************************************************************************************************************************************************************