Project

Profile

Help

Issue #8382

null value in column "pulp2_resource_repo_id" violates not-null constraint

Added by ttereshc 7 months ago. Updated 7 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 92
Quarter:
Q1-2021

Description

    self._result = self._execute()
    File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
    File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/tasks/migrate.py", line 48, in migrate_from_pulp2
    missing_resources = plan.get_missing_resources()
    File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/models/base.py", line 165, in get_missing_resources
    if self.plan_view.missing_repositories:
    File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/models/base.py", line 108, in plan_view
    self._real_plan = _InternalMigrationPlan(self)
    File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/models/base.py", line 181, in __init__
    self._plugin_plans.append(PluginMigrationPlan(plugin_data))
    File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/models/base.py", line 256, in __init__
    self._parse_plugin_plan(plugin_migration_plan)
    File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/models/base.py", line 340, in _parse_plugin_plan
    RepoSetup.set_importer(pulp2_repository_id, self.type, importer_repo_id)
    File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/models/base.py", line 438, in set_importer
    defaults={'status': cls.NEW}
    File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 541, in get_or_create
    return self._create_object_from_params(kwargs, params)
    File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 583, in _create_object_from_params
    raise e
    File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 575, in _create_object_from_params
    obj = self.create(**params)
    File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 422, in create
    obj.save(force_insert=True, using=self.db)
    File "/usr/lib/python3.6/site-packages/django_lifecycle/mixins.py", line 129, in save
    save(*args, **kwargs)
    File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 744, in save
    force_update=force_update, update_fields=update_fields)
    File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 782, in save_base
    force_update, using, update_fields,
    File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 873, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
    File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 911, in _do_insert
    using=using, raw=raw)
    File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 1186, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
    File "/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1377, in execute_sql
    cursor.execute(sql, params)
    File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
    File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
    File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
    File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
    django.db.utils.IntegrityError: null value in column "pulp2_resource_repo_id" violates not-null constraint
    DETAIL:  Failing row contains (fbf00c2e-39be-4ae5-845d-2467fc9eb4b6, 2021-03-10 22:48:24.91763+00, 2021-03-10 22:48:24.917653+00, other_component_repo, rpm, null, 0, 2).

This is happens when importer is not specified for a repo in the migration plan. It's a regression introduced in 0.9.0.


Related issues

Related to Migration Plugin - Backport #8389: Backport 8382 to 0.9.0CLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision a2176107 View on GitHub
Added by ttereshc 7 months ago

Fix migration for the case when no importer is specified.

closes #8382 https://pulp.plan.io/issues/8382

Revision a2176107 View on GitHub
Added by ttereshc 7 months ago

Fix migration for the case when no importer is specified.

closes #8382 https://pulp.plan.io/issues/8382

Revision a2176107 View on GitHub
Added by ttereshc 7 months ago

Fix migration for the case when no importer is specified.

closes #8382 https://pulp.plan.io/issues/8382

History

#1 Updated by ttereshc 7 months ago

  • Description updated (diff)

#2 Updated by ttereshc 7 months ago

  • Tags Katello added

#3 Updated by ttereshc 7 months ago

  • Status changed from ASSIGNED to MODIFIED

#4 Updated by ttereshc 7 months ago

#5 Updated by ttereshc 7 months ago

  • Sprint/Milestone set to 0.10.0

#6 Updated by pulpbot 7 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF