Trying to upgrade to pulpcore=3.29.7

I am trying to upgrade pulpcore[postgres]==3.0.0rc3 to latest pulpcore=3.29.7. But I am hitting an error.

Operating system - distribution and version:
RHEL 7

Here is what my requirements.txt looks like:
aiofiles==23.1.0
aiohttp==3.8.4
async-timeout==4.0.2
attrs==23.1.0
backoff==2.2.1
certifi==2023.7.22
chardet==5.2.0
Click==8.1.3
coreapi==2.3.3
coreschema==0.0.4
Django==4.2.0
django-filter==23.2.0
djangorestframework==3.14.0
djangorestframework-queryfields==1.0.0
drf-nested-routers==0.93.4
drf-yasg==1.21.7
dynaconf==3.1.12
gunicorn==20.1.0
httpie==3.2.2
idna==3.4
idna-ssl==1.1.0
inflection==0.5.1
itypes==1.2.0
Jinja2==3.1.2
MarkupSafe==2.1.3
multidict==6.0.4
psycopg2==2.9.6
psycopg2-binary==2.9.6
pulpcore[postgres]==3.29.7
pulp-certguard==1.6.5
pulp-rpm==3.22.3
Pygments==2.15.1
python-box==7.0.1
python-dotenv==1.0.0
pytz==2023.3
PyYAML==5.4.1
redis==4.5.3
requests==2.31.0
rq==1.15.0
ruamel.yaml==0.15.100
six==1.12.0
sqlparse==0.4.4
setuptools==39.2
toml==0.10.0
typing-extensions==4.7.0
uritemplate==3.0.0
urllib3==1.26.6
whitenoise==6.5.0
yarl==1.9.2
createrepo-c==0.20.1

Error I am getting:
17:47:16 fatal: [10.68.7.246]: FAILED! => {“changed”: true, “cmd”: [“django-admin”, “migrate”, “certguard”, “–noinput”], “delta”: “0:00:06.494525”, “end”: “2023-08-07 12:17:16.199497”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2023-08-07 12:17:09.704972”, “stderr”: “Traceback (most recent call last):\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/apps/config.py”, line 235, in get_model\n return self.models[model_name.lower()]\nKeyError: ‘systemid’\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File “/usr/local/lib/pulp/bin/django-admin”, line 8, in \n sys.exit(execute_from_command_line())\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line\n utility.execute()\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/init.py”, line 436, in execute\n self.fetch_command(subcommand).run_from_argv(self.argv)\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/base.py”, line 412, in run_from_argv\n self.execute(*args, **cmd_options)\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/base.py”, line 458, in execute\n output = self.handle(*args, **options)\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/base.py”, line 106, in wrapper\n res = handle_func(*args, **kwargs)\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/commands/migrate.py”, line 383, in handle\n emit_post_migrate_signal(\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/sql.py”, line 52, in emit_post_migrate_signal\n models.signals.post_migrate.send(\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/dispatch/dispatcher.py”, line 176, in send\n return [\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/dispatch/dispatcher.py”, line 177, in \n (receiver, receiver(signal=self, sender=sender, **named))\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/pulpcore/app/apps.py”, line 309, in _populate_system_id\n SystemID = apps.get_model(“core”, “SystemID”)\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/apps/registry.py”, line 213, in get_model\n return app_config.get_model(model_name, require_ready=require_ready)\n File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/apps/config.py”, line 237, in get_model\n raise LookupError(\nLookupError: App ‘core’ doesn’t have a ‘SystemID’ model.”, “stderr_lines”: [“Traceback (most recent call last):”, " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/apps/config.py”, line 235, in get_model", " return self.models[model_name.lower()]", “KeyError: ‘systemid’”, “”, “During handling of the above exception, another exception occurred:”, “”, “Traceback (most recent call last):”, " File “/usr/local/lib/pulp/bin/django-admin”, line 8, in “, " sys.exit(execute_from_command_line())”, " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line", " utility.execute()", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/init.py”, line 436, in execute", " self.fetch_command(subcommand).run_from_argv(self.argv)", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/base.py”, line 412, in run_from_argv", " self.execute(*args, **cmd_options)", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/base.py”, line 458, in execute", " output = self.handle(*args, **options)", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/base.py”, line 106, in wrapper", " res = handle_func(*args, **kwargs)", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/commands/migrate.py”, line 383, in handle", " emit_post_migrate_signal(", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/core/management/sql.py”, line 52, in emit_post_migrate_signal", " models.signals.post_migrate.send(", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/dispatch/dispatcher.py”, line 176, in send", " return [", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/dispatch/dispatcher.py”, line 177, in “, " (receiver, receiver(signal=self, sender=sender, **named))”, " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/pulpcore/app/apps.py”, line 309, in _populate_system_id", " SystemID = apps.get_model(“core”, “SystemID”)", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/apps/registry.py”, line 213, in get_model", " return app_config.get_model(model_name, require_ready=require_ready)", " File “/usr/local/lib/pulp/lib64/python3.8/site-packages/django/apps/config.py”, line 237, in get_model", " raise LookupError(", “LookupError: App ‘core’ doesn’t have a ‘SystemID’ model.”], “stdout”: “Operations to perform:\n Apply all migrations: certguard\nRunning migrations:\n Applying contenttypes.0001_initial… OK\n Applying contenttypes.0002_remove_content_type_name… OK\n Applying core.0001_initial… OK\n Applying core.0002_increase_artifact_size_field… OK\n Applying core.0003_remove_upload_completed… OK\n Applying core.0004_add_duplicated_reserved_resources… OK\n Applying core.0005_progressreport_code… OK\n Applying core.0006_repository_plugin_managed… OK\n Applying core.0007_delete_progress_proxies… OK\n Applying core.0008_published_metadata_as_content… OK\n Applying core.0009_remove_task_non_fatal_errors… OK\n Applying core.0010_pulp_fields… OK\n Applying core.0011_relative_path… OK\n Applying core.0012_auto_20191104_2000… OK\n Applying core.0013_repository_pulp_type… OK\n Applying core.0014_remove_repository_plugin_managed… OK\n Applying core.0015_auto_20191112_1426… OK\n Applying core.0016_charfield_to_textfield… OK\n Applying core.0017_remove_task_parent… OK\n Applying core.0018_auto_20191127_2350… OK\n Applying core.0019_add_signing_service_model… OK\n Applying core.0020_change_publishedartifact_constraints… OK\n Applying core.0021_add_signing_service_foreign_key… OK\n Applying core.0022_rename_last_version… OK\n Applying core.0023_change_exporter_models… OK\n Applying core.0024_use_local_storage_for_uploads… OK\n Applying core.0025_task_parent_task… OK\n Applying core.0026_task_group… OK\n Applying certguard.0001_initial… OK\n Applying certguard.0002_alter_rhsmcertguard_contentguard_ptr_and_more… OK\nAccessPolicy model does not exist. Skipping initialization.\nRole model does not exist. Skipping initialization.”, “stdout_lines”: [“Operations to perform:”, " Apply all migrations: certguard", “Running migrations:”, " Applying contenttypes.0001_initial… OK", " Applying contenttypes.0002_remove_content_type_name… OK", " Applying core.0001_initial… OK", " Applying core.0002_increase_artifact_size_field… OK", " Applying core.0003_remove_upload_completed… OK", " Applying core.0004_add_duplicated_reserved_resources… OK", " Applying core.0005_progressreport_code… OK", " Applying core.0006_repository_plugin_managed… OK", " Applying core.0007_delete_progress_proxies… OK", " Applying core.0008_published_metadata_as_content… OK", " Applying core.0009_remove_task_non_fatal_errors… OK", " Applying core.0010_pulp_fields… OK", " Applying core.0011_relative_path… OK", " Applying core.0012_auto_20191104_2000… OK", " Applying core.0013_repository_pulp_type… OK", " Applying core.0014_remove_repository_plugin_managed… OK", " Applying core.0015_auto_20191112_1426… OK", " Applying core.0016_charfield_to_textfield… OK", " Applying core.0017_remove_task_parent… OK", " Applying core.0018_auto_20191127_2350… OK", " Applying core.0019_add_signing_service_model… OK", " Applying core.0020_change_publishedartifact_constraints… OK", " Applying core.0021_add_signing_service_foreign_key… OK", " Applying core.0022_rename_last_version… OK", " Applying core.0023_change_exporter_models… OK", " Applying core.0024_use_local_storage_for_uploads… OK", " Applying core.0025_task_parent_task… OK", " Applying core.0026_task_group… OK", " Applying certguard.0001_initial… OK", " Applying certguard.0002_alter_rhsmcertguard_contentguard_ptr_and_more… OK", “AccessPolicy model does not exist. Skipping initialization.”, “Role model does not exist. Skipping initialization.”]}

Sorry but I’m new in Pulp. Can you please help me with that?
I really appreciate your time and help

It looks like your installer is running "django-admin”, “migrate”, “certguard”, “–noinput”. So not all pulpcore migrations are applied. Can you run pulpcore-manager migrate and try again?

Hi there thank you for your response,
I am using two commands actually
For creating migrations for certguard : “django-admin makemigrations certguard --noinput”
For running Migrations for Certguard : “django-admin migrate certguard --noinput”
What are the commands you are suggesting?
Thank You!

You should absolutely not create your own migrations. These are shipped with the plugin.
And the suggestion is to apply all migrations in one go. Hence admin.py migrate.
pulpcore-manager is just a shortcut to run djang-admin in the right setup.

What kind of an installer is this?

Ansible Installer

Is it a self written one?

The one here, we deprecated quite a while ago:

See also:
https://pulpproject.org/installation-introduction/#project-history

Yes, It is a self written one. And the command which you recommended earlier worked for me. But the thing is I can see in my Ansible code “django-admin makemigrations rpm --noinput” is also used for migrating pulp rpm. Can you suggest something where I can read about this or like how to configure ?

1 Like

There’s this, but it’svery developer oriented:

About adjango-admin, this is the same as pulpcore-manager only that the latter prepares the environment for you while with the former you need to provide the DJANGO_SETTINGS_MODULE variable.

About creating migrations, please don’t do it. We create all the necessary migrations and ship them to ensure a consistent history of applied migrations when you upgrade Pulp. If you want to add an additional deployment check, use pulpcore-manager/django-admin makemigrations --no-input --check (whenever you do not provide an app label, the migration commands handle all configured apps).
Whenever that command fails, please file an issue.

Would you be willing to share a link to your installer?

Hi there, I have one more question is it safe to use docker compose deployment option in production ?

Yes it is. Please keep in mind that the compose file we provide is just an example and you will probably want to improve it as your use case requires you to. Please feel free to submit pull requests with any compose file changes you think would benefit the rest of the community.

2 Likes