Pulp Workers Constantly Failing

Problem: Hello, posted this on the foreman discourse but no answer yet. Any advice would be greatly appreciated!

Pulp workers are constantly failing and restarting meaning syncs of my repos are failing. I am pretty new to foreman so not sure what is going on. From /var/log/messages the main lines I think it’s complaining about are:

Oct 19 09:02:26 foreman pulpcore-worker-8: Traceback (most recent call last):
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/backends/utils.py”, line 84, in _execute
Oct 19 09:02:26 foreman pulpcore-worker-8: return self.cursor.execute(sql, params)
Oct 19 09:02:26 foreman pulpcore-worker-8: psycopg2.errors.UndefinedTable: relation “core_taskschedule” does not exist
Oct 19 09:02:26 foreman pulpcore-worker-8: LINE 1: …sk_name", “core_taskschedule”.“last_task_id” FROM "core_task…
Oct 19 09:02:26 foreman pulpcore-worker-8: ^

Expected outcome: Repo’s sync successfully.

Pulpcore version: tfm-pulpcore-python3-pulp-python-3.7.1-1 (I’m not exactly sure how to tell)

Pulp plugins installed and their versions: Lots… seems the servers has lots of pulp rpms installed.

Operating system - distribution and version: Centos 7.9

Other relevant data:

Hopefully the above has all the data needed. I’m not sure what is going on here so any advice would be appreciated. Just in case here is the full log:

Oct 19 09:02:26 foreman pulpcore-worker-8: Traceback (most recent call last):
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/backends/utils.py”, line 84, in _execute
Oct 19 09:02:26 foreman pulpcore-worker-8: return self.cursor.execute(sql, params)
Oct 19 09:02:26 foreman pulpcore-worker-8: psycopg2.errors.UndefinedTable: relation “core_taskschedule” does not exist
Oct 19 09:02:26 foreman pulpcore-worker-8: LINE 1: …sk_name", “core_taskschedule”.“last_task_id” FROM “core_task…
Oct 19 09:02:26 foreman pulpcore-worker-8: ^
Oct 19 09:02:26 foreman pulpcore-worker-8: The above exception was the direct cause of the following exception:
Oct 19 09:02:26 foreman pulpcore-worker-8: Traceback (most recent call last):
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/bin/pulpcore-worker”, line 11, in
Oct 19 09:02:26 foreman pulpcore-worker-8: load_entry_point(‘pulpcore==3.18.10’, ‘console_scripts’, ‘pulpcore-worker’)()
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/click/core.py”, line 1128, in call
Oct 19 09:02:26 foreman pulpcore-worker-8: return self.main(*args, **kwargs)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/click/core.py”, line 1053, in main
Oct 19 09:02:26 foreman pulpcore-worker-8: rv = self.invoke(ctx)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/click/core.py”, line 1395, in invoke
Oct 19 09:02:26 foreman pulpcore-worker-8: return ctx.invoke(self.callback, **ctx.params)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/click/core.py”, line 754, in invoke
Oct 19 09:02:26 foreman pulpcore-worker-8: return __callback(*args, **kwargs)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/pulpcore/tasking/entrypoint.py”, line 28, in worker
Oct 19 09:02:26 foreman pulpcore-worker-8: NewPulpWorker().run_forever()
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/pulpcore/tasking/pulpcore_worker.py”, line 368, in run_forever
Oct 19 09:02:26 foreman pulpcore-worker-8: self.sleep()
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/pulpcore/tasking/pulpcore_worker.py”, line 280, in sleep
Oct 19 09:02:26 foreman pulpcore-worker-8: self.beat()
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/pulpcore/tasking/pulpcore_worker.py”, line 153, in beat
Oct 19 09:02:26 foreman pulpcore-worker-8: dispatch_scheduled_tasks()
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/pulpcore/tasking/tasks.py”, line 104, in dispatch_scheduled_tasks
Oct 19 09:02:26 foreman pulpcore-worker-8: for task_schedule in TaskSchedule.objects.filter(next_dispatch__lte=now).filter(
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/models/query.py”, line 280, in iter
Oct 19 09:02:26 foreman pulpcore-worker-8: self._fetch_all()
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/models/query.py”, line 1324, in _fetch_all
Oct 19 09:02:26 foreman pulpcore-worker-8: self._result_cache = list(self._iterable_class(self))
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/models/query.py”, line 51, in iter
Oct 19 09:02:26 foreman pulpcore-worker-8: results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/models/sql/compiler.py”, line 1175, in execute_sql
Oct 19 09:02:26 foreman pulpcore-worker-8: cursor.execute(sql, params)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/backends/utils.py”, line 66, in execute
Oct 19 09:02:26 foreman pulpcore-worker-8: return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/backends/utils.py”, line 75, in _execute_with_wrappers
Oct 19 09:02:26 foreman pulpcore-worker-8: return executor(sql, params, many, context)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/backends/utils.py”, line 84, in _execute
Oct 19 09:02:26 foreman pulpcore-worker-8: return self.cursor.execute(sql, params)
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/utils.py”, line 90, in exit
Oct 19 09:02:26 foreman pulpcore-worker-8: raise dj_exc_value.with_traceback(traceback) from exc_value
Oct 19 09:02:26 foreman pulpcore-worker-8: File “/opt/theforeman/tfm-pulpcore/root/usr/lib/python3.8/site-packages/django/db/backends/utils.py”, line 84, in _execute
Oct 19 09:02:26 foreman pulpcore-worker-8: return self.cursor.execute(sql, params)
Oct 19 09:02:26 foreman pulpcore-worker-8: django.db.utils.ProgrammingError: relation “core_taskschedule” does not exist
Oct 19 09:02:26 foreman pulpcore-worker-8: LINE 1: …sk_name”, “core_taskschedule”.“last_task_id” FROM "core_task…
Oct 19 09:02:26 foreman pulpcore-worker-8: ^
Oct 19 09:02:27 foreman systemd: pulpcore-worker@8.service: main process exited, code=exited, status=1/FAILURE
Oct 19 09:02:27 foreman systemd: Unit pulpcore-worker@8.service entered failed state.
Oct 19 09:02:27 foreman systemd: pulpcore-worker@8.service failed.

This sounds to me like the migrations didn’t run. Or didn’t finish properly.
Is this a new system or updated from somewhere?
What plugins do you have installed? (Ideally with versions before and after the aforementioned upgrade…)

Hey,

So it’s an existing server that I have just been given access to. Semes to have been updated around August, though I am unsure at the moment what the previous versions were. Everything seems to be coming from foreman & pulp yum repos.

I will post a list of rpms installed, sorry if thats what you arent looking for. Would there be anything you would recommend doing after an upgrade?

tfm-pulpcore-python3-pygtrie-2.4.2-3.el7.noarch
tfm-pulpcore-python3-prometheus-client-0.8.0-3.el7.noarch
tfm-pulpcore-python3-drf-nested-routers-0.93.4-3.el7.noarch
tfm-rubygem-pulp_ansible_client-0.13.1-1.el7.noarch
tfm-rubygem-pulp_python_client-3.6.0-1.el7.noarch
tfm-pulpcore-python3-cryptography-3.1.1-1.el7.x86_64
tfm-pulpcore-python3-gitpython-3.1.26-3.el7.noarch
tfm-pulpcore-python3-libcomps-0.1.18-4.el7.x86_64
tfm-pulpcore-python3-multidict-6.0.2-2.el7.x86_64
tfm-pulpcore-python3-bindep-2.10.2-4.el7.noarch
tfm-pulpcore-python3-aiohttp-xmlrpc-1.5.0-2.el7.noarch
tfm-rubygem-pulpcore_client-3.18.5-1.el7.noarch
tfm-pulpcore-python3-pulp-file-1.10.2-2.el7.noarch
tfm-pulpcore-python3-beautifulsoup4-4.10.0-2.el7.noarch
tfm-pulpcore-python3-brotli-1.0.9-2.el7.x86_64
tfm-pulpcore-python3-semantic-version-2.10.0-1.el7.noarch
tfm-pulpcore-python3-pyOpenSSL-19.1.0-3.el7.noarch
tfm-pulpcore-python3-zipp-3.4.0-4.el7.noarch
tfm-pulpcore-python3-rhsm-1.19.2-3.el7.x86_64
tfm-pulpcore-runtime-1.0-4.el7.x86_64
tfm-pulpcore-python3-urllib3-1.26.8-2.el7.noarch
tfm-pulpcore-python3-solv-0.7.22-4.el7.x86_64
tfm-pulpcore-python3-parsley-1.3-2.el7.noarch
tfm-pulpcore-python3-pycparser-2.21-2.el7.noarch
tfm-pulpcore-python3-backoff-1.11.1-2.el7.noarch
tfm-pulpcore-python3-django-lifecycle-0.9.6-3.el7.noarch
tfm-pulpcore-python3-async-lru-1.0.2-3.el7.noarch
tfm-rubygem-pulp_file_client-1.10.0-1.el7.noarch
tfm-pulpcore-python3-click-shell-2.1-3.el7.noarch
tfm-pulpcore-python3-gnupg-0.4.8-2.el7.noarch
tfm-pulpcore-python3-et-xmlfile-1.1.0-2.el7.noarch
tfm-pulpcore-python3-pycairo-1.20.1-3.el7.x86_64
tfm-pulpcore-python3-flake8-3.9.2-5.el7.noarch
tfm-pulpcore-python3-pulp-certguard-1.5.2-3.el7.noarch
pulpcore-selinux-1.3.2-1.el7.x86_64
tfm-pulpcore-python3-six-1.16.0-2.el7.noarch
tfm-pulpcore-python3-attrs-21.4.0-2.el7.noarch
tfm-pulpcore-python3-pytz-2021.3-2.el7.noarch
tfm-pulpcore-python3-aioredis-2.0.1-2.el7.noarch
tfm-pulpcore-python3-productmd-1.33-3.el7.noarch
tfm-pulpcore-python3-humanfriendly-10.0-4.el7.noarch
tfm-pulpcore-python3-schema-0.7.5-2.el7.noarch
tfm-pulpcore-python3-pygments-2.11.2-2.el7.noarch
tfm-pulpcore-python3-aiodns-3.0.0-3.el7.noarch
tfm-pulpcore-python3-djangorestframework-3.13.1-2.el7.noarch
tfm-pulpcore-python3-django-currentuser-0.5.3-5.el7.noarch
tfm-pulpcore-python3-smmap-5.0.0-2.el7.noarch
tfm-pulpcore-python3-bleach-3.3.1-2.el7.noarch
tfm-pulpcore-python3-xlwt-1.3.0-3.el7.noarch
tfm-pulpcore-python3-aiohttp-3.8.1-2.el7.x86_64
tfm-pulpcore-python3-pyjwkest-1.4.2-6.el7.noarch
tfm-pulpcore-python3-django-import-export-2.7.1-6.el7.noarch
tfm-pulpcore-python3-pulp-python-3.7.1-1.el7.noarch
tfm-pulpcore-python3-aiosignal-1.2.0-2.el7.noarch
tfm-pulpcore-python3-cchardet-2.1.7-4.el7.x86_64
tfm-pulpcore-python3-django-3.2.14-2.el7.noarch
tfm-pulpcore-python3-idna-3.3-2.el7.noarch
tfm-pulpcore-python3-jinja2-3.0.3-1.el7.noarch
tfm-pulpcore-python3-markdown-3.3.6-3.el7.noarch
tfm-pulpcore-python3-psycopg2-2.9.3-2.el7.x86_64
tfm-pulpcore-python3-urlman-1.4.0-3.el7.noarch
tfm-pulpcore-python3-certifi-2020.6.20-3.el7.noarch
tfm-rubygem-smart_proxy_pulp-3.2.0-3.fm3_3.el7.noarch
tfm-pulpcore-python3-chardet-4.0.0-2.el7.noarch
tfm-pulpcore-python3-django-prometheus-2.1.0-3.el7.noarch
tfm-pulpcore-python3-pkginfo-1.8.2-3.el7.noarch
tfm-pulpcore-python3-django-guardian-2.4.0-5.el7.noarch
tfm-rubygem-pulp_certguard_client-1.5.0-1.el7.noarch
tfm-pulpcore-python3-pyflakes-2.3.1-5.el7.noarch
tfm-pulpcore-python3-colorama-0.4.4-3.el7.noarch
tfm-pulpcore-python3-yarl-1.7.2-2.el7.x86_64
tfm-pulpcore-python3-ansible-builder-1.0.1-4.el7.noarch
tfm-pulpcore-python3-bandersnatch-5.1.1-3.el7.noarch
tfm-pulpcore-python3-idna-ssl-1.1.0-5.el7.noarch
tfm-pulpcore-python3-galaxy-importer-0.4.5-1.el7.noarch
tfm-pulpcore-python3-async-timeout-4.0.2-2.el7.noarch
tfm-pulpcore-python3-pulp-rpm-3.18.7-1.el7.noarch
tfm-pulpcore-python3-packaging-21.3-1.el7.noarch
tfm-pulpcore-python3-aiohttp-socks-0.7.1-3.el7.noarch
tfm-pulpcore-python3-iniparse-0.4-35.el7.noarch
tfm-pulpcore-python3-odfpy-1.4.1-6.el7.noarch
tfm-pulpcore-python3-pyjwt-1.7.1-8.el7.noarch
tfm-pulpcore-python3-asyncio-throttle-1.0.2-3.el7.noarch
tfm-pulpcore-python3-markuppy-1.14-3.el7.noarch
tfm-pulpcore-python3-cffi-1.15.0-2.el7.x86_64
tfm-pulpcore-python3-sqlparse-0.4.2-3.el7.noarch
tfm-rubygem-pulp_deb_client-2.18.0-1.el7.noarch
tfm-pulpcore-python3-soupsieve-2.3.1-3.el7.noarch
tfm-pulpcore-python3-drf-spectacular-0.21.2-2.el7.noarch
tfm-pulpcore-python3-distro-1.6.0-3.el7.noarch
tfm-pulpcore-python3-charset-normalizer-2.0.11-4.el7.noarch
tfm-pulpcore-python3-openpyxl-3.0.9-2.el7.noarch
tfm-pulpcore-python3-pygobject-3.40.1-3.el7.x86_64
tfm-pulpcore-python3-markupsafe-2.0.1-3.el7.x86_64
tfm-pulpcore-python3-importlib-resources-5.4.0-4.el7.noarch
tfm-pulpcore-python3-createrepo_c-0.20.1-1.el7.x86_64
tfm-pulpcore-python3-pulp-container-2.10.9-1.el7.noarch
tfm-pulpcore-python3-url-normalize-1.4.3-4.el7.noarch
tfm-pulpcore-python3-bleach-allowlist-1.0.3-3.el7.noarch
tfm-pulpcore-python3-inflection-0.5.1-3.el7.noarch
tfm-pulpcore-python3-toml-0.10.2-3.el7.noarch
tfm-pulpcore-python3-setuptools-1.0-4.el7.x86_64
tfm-pulpcore-python3-filelock-3.0.12-3.el7.noarch
tfm-pulpcore-python3-drf-access-policy-1.1.0-3.el7.noarch
tfm-pulpcore-python3-requirements-parser-0.2.0-3.el7.noarch
tfm-rubygem-pulp_ostree_client-2.0.0-0.1.a1.el7.noarch
tfm-pulpcore-python3-gitdb-4.0.9-2.el7.noarch
tfm-pulpcore-python3-ecdsa-0.14.1-2.el7.noarch
tfm-pulpcore-python3-pbr-5.8.0-4.el7.noarch
tfm-pulpcore-python3-frozenlist-1.3.0-2.el7.x86_64
tfm-pulpcore-python3-lxml-4.7.1-2.el7.x86_64
tfm-pulpcore-python3-pulpcore-3.18.10-1.el7.noarch
tfm-pulpcore-python3-debian-0.1.44-3.el7.noarch
tfm-pulpcore-python3-typing-extensions-3.10.0.2-2.el7.noarch
tfm-pulpcore-python3-importlib-metadata-4.10.1-2.el7.noarch
tfm-pulpcore-python3-redis-3.5.3-3.el7.noarch
tfm-pulpcore-python3-pycryptodomex-3.14.1-2.el7.x86_64
tfm-pulpcore-python3-uritemplate-4.1.1-2.el7.noarch
tfm-pulpcore-python3-django-guid-3.2.2-1.el7.noarch
tfm-pulpcore-python3-dynaconf-3.1.7-4.el7.noarch
tfm-rubygem-pulp_rpm_client-3.17.4-1.el7.noarch
tfm-pulpcore-python3-pyrsistent-0.18.1-2.el7.x86_64
tfm-pulpcore-python3-click-8.0.3-2.el7.noarch
tfm-pulpcore-python3-future-0.18.2-5.el7.noarch
tfm-pulpcore-python3-aiofiles-0.8.0-2.el7.noarch
tfm-pulpcore-python3-mccabe-0.6.1-3.el7.noarch
tfm-pulpcore-python3-pulp-deb-2.18.0-3.el7.noarch
tfm-pulpcore-python3-django-readonly-field-1.1.1-3.el7.noarch
tfm-pulpcore-python3-pulp-ansible-0.13.2-2.el7.noarch
tfm-pulpcore-python3-pyyaml-5.4.1-4.el7.x86_64
tfm-pulpcore-python3-pyparsing-2.4.7-3.el7.noarch
tfm-pulpcore-python3-socks-2.0.3-2.el7.noarch
tfm-pulpcore-python3-dateutil-2.8.2-2.el7.noarch
tfm-pulpcore-python3-defusedxml-0.7.1-3.el7.noarch
tfm-pulpcore-python3-xlrd-2.0.1-5.el7.noarch
tfm-pulpcore-python3-contextlib2-21.6.0-3.el7.noarch
tfm-pulpcore-python3-gunicorn-20.1.0-5.el7.noarch
tfm-pulpcore-python3-pycares-4.1.2-2.el7.x86_64
tfm-pulpcore-python3-django-filter-21.1-3.el7.noarch
tfm-rubygem-pulp_container_client-2.10.3-1.el7.noarch
tfm-pulpcore-python3-diff-match-patch-20200713-3.el7.noarch
tfm-pulpcore-python3-webencodings-0.5.1-3.el7.noarch
tfm-pulpcore-python3-djangorestframework-queryfields-1.0.0-5.el7.noarch
tfm-pulpcore-python3-requests-2.27.1-2.el7.noarch
tfm-pulpcore-python3-tablib-3.2.0-3.el7.noarch
tfm-pulpcore-python3-whitenoise-6.0.0-1.el7.noarch
tfm-pulpcore-python3-jsonschema-4.6.0-4.el7.noarch
tfm-pulpcore-python3-pulp-cli-0.14.0-4.el7.noarch
tfm-pulpcore-python3-asgiref-3.5.0-2.el7.noarch
tfm-pulpcore-python3-pycodestyle-2.7.0-5.el7.noarch
tfm-pulpcore-python3-pypi-simple-0.9.0-1.el7.noarch
tfm-pulpcore-python3-naya-1.1.1-3.el7.noarch