[ContentMigration] content prepare fails with Katello::Errors::Pulp3Error: 'NoneType' object has no attribute 'replace'

Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: django.db.utils.IntegrityError: duplicate key value violates unique constraint “core_remote_name_key”
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: DETAIL: Key (name)=(5f15602283d6e4509ee59ecd-31624b81-ab69-49a4-a101-dc06ca079e80) already exists.
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: Traceback (most recent call last):
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: File “/usr/lib/python3.6/site-packages/django/db/models/query.py”, line 554, in update_or_create
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: obj = self.select_for_update().get(**kwargs)
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: File “/usr/lib/python3.6/site-packages/django/db/models/query.py”, line 408, in get
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: self.model._meta.object_name
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: pulp_deb.app.models.remote.AptRemote.DoesNotExist: AptRemote matching query does not exist.
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: During handling of the above exception, another exception occurred:
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: Traceback (most recent call last):
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: File “/usr/lib/python3.6/site-packages/django/db/backends/utils.py”, line 84, in _execute
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: return self.cursor.execute(sql, params)
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint “core_remote_name_key”
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: DETAIL: Key (name)=(5f15602283d6e4509ee59ecd-31624b81-ab69-49a4-a101-dc06ca079e80) already exists.
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: The above exception was the direct cause of the following exception:
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: Traceback (most recent call last):
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: File “/usr/lib/python3.6/site-packages/rq/worker.py”, line 936, in perform_job
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: rv = job.perform()
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: File “/usr/lib/python3.6/site-packages/rq/job.py”, line 684, in perform
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: self._result = self._execute()
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: File “/usr/lib/python3.6/site-packages/rq/job.py”, line 690, in _execute
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: return self.func(*self.args, **self.kwargs)
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: File “/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/tasks/migrate.py”, line 80, in migrate_from_pulp2
Apr 28 16:25:42 foreman.com pulpcore-worker-2[1165]: migrate_importers(plan)