Pulp3 installation error: 'get_domain_pk' from 'pulpcore.plugin.util'

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 …



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”: [
“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 **********************************************************************************************************************************************************************************

The Pulp project has decided to deprecate Ansible installer in favour of containerized installations, see the motivations here.

The error you are experiencing might be related to this change.

1 Like

Thanks for the reply… Typically the repo is held on-premise. I have following qns…

  1. does it mean that I have create an on-prem kubernetes cluster now and deploy pulp3 via the pulp operator?
  2. If that’s the case, where does it hold the massive binary repository, via some volume mount to the pulp instance mounted via the operator?
  3. All the demo and videos in google search is coming with pulp operator in redhat openshift deployment, can I deploy it in a kubernetes cluster managed by the rancher cluster in the same way for redhat openshift?


There are still multiple ways to deploy. If you know what you are doing, you can install from pypi. But there’s really not much expertise around for that method, so you are basically on your own. Then there is the “single-container” flavor of images. They should run on any oci compliant container runtime environment. There’s a podman-compose file around, you can use as a starting point for a single machine micro-service installation (or to understand how the microservices colaborate). And than, of course, the operator you mentioned. I believe, in the end, it depends on the size of your installation, what the best method is. There may be more methods of installation around, but we just cannot take accountability for all of them.
As for the storage, you can configure object storage. See