Pulp3 migration failed with error "ForemanTasks::TaskError: Task 7024f8c1-a9a1-4c57-814d-8455d8ac3dc8: Katello::Errors::Pulp3Error: null value in column "stream" violates not-null constraint"

Problem:
Pulp3 migration failed.

Expected outcome:
Pulp3 migration successful completion

Foreman and Proxy versions:
Foreman 2.3.2 and Proxy 2.3.2

Foreman and Proxy plugin versions:
Foreman 2.3.2, Katello 3.18.1, Foreman-tasks 3.0.3, Foreman_docker 5.0.0 and Foreman_remote_execution 4.2.2

Distribution and version:
RHEL 7.9 (Maipo0

Other relevant data:

Running Switch support for certain content from Pulp 2 to Pulp 3

Switch support for certain content from Pulp 2 to Pulp 3:
Performing final content migration before switching content [FAIL]
Failed executing foreman-rake katello:pulp3_migration, exit status 1:
enabled
Starting task.
Migration failed, You will want to investigate: https://dc07asml01.cityofchicago.org/foreman_tasks/tasks/7024f8c1-a9a1-4c57-814d-8455d8ac3dc8
rake aborted!
ForemanTasks::TaskError: Task 7024f8c1-a9a1-4c57-814d-8455d8ac3dc8: Katello::Errors::Pulp3Error: null value in column “stream” violates not-null constraint
DETAIL: Failing row contains (2f26ad01-6270-482d-b67a-bc5ff5ed7057, 2021-05-25 16:41:37.041005+00, 2021-05-25 16:41:37.041013+00, eclipse, null, {“rhel8”: [“java”]}, 45e5095eb5581b9fdbdd8de1997feead041ad533756326a184b099144c2828b1, d9ebcd9a-ad63-4bac-a547-67be2fd33555, 8702b722-ba80-4b04-b786-7bddeda422a6).
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1/lib/katello/tasks/pulp3_migration.rake:31:in block (2 levels) in <top (required)>' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in <top (required)>’
Tasks: TOP => katello:pulp3_migration
(See full trace by running task with --trace)
2021-05-25 11:41:40 -0500: Pre-migrating Pulp 2 ERRATUM content (general info) 72788/75679

Scenario [Switch support for certain content from Pulp 2 to Pulp 3] failed.

The following steps ended up in failing state:

[content-switchover]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist=“content-switchover”

This looks a lot like Issue #7846: null value in column "stream" violates not-null constraint during migration on Katello - Migration Plugin - Pulp which should already be fixed. What is the output of:

rpm -q python3-pulp-2to3-migration

Hello Justin,

-sh-4.2$ rpm -q python3-pulp-2to3-migration
python3-pulp-2to3-migration-0.6.0-2.el7.noarch

ah yes, that is quite old. I would recommend doing a yum update and re-running the installer to pull down the latest python3-pulp-2to3-migration-0.11.1-1.el7

1 Like

Working on it, will update you if there any errors.

Thank you for the help.

Hi Justin,

I ran update and the installer, which updated the python3-pulp-2to3-migration package as below

[root@dc07asml01 AdminStorage]# rpm -qa|grep python3-pulp-2to3-migration
python3-pulp-2to3-migration-0.11.1-1.el7.noarch

But the migration failed and errors are below…

[root@dc07asml01 AdminStorage]# foreman-maintain content migration-stats
Running Retrieve Pulp 2 to Pulp 3 migration statistics

Retrieve Pulp 2 to Pulp 3 migration statistics:
============Migration Summary================
Migrated/Total RPMs: 216510/216742
Migrated/Total errata: 179097/179187
Migrated/Total repositories: 91/91

Estimated migration time based on yum content: 1 hours, 0 minutes

Note: ensure there is sufficient storage space for /var/lib/pulp/published to triple in size before starting the migration process.
Check the size of /var/lib/pulp/published with ‘du -sh /var/lib/pulp/published/’
[OK]

[root@dc07asml01 AdminStorage]# foreman-maintain content prepare
Running Prepare content for Pulp 3

Prepare content for Pulp 3:
Starting task.
2021-05-26 10:18:56 -0500: Importing migrated content type erratum: 76000/75685Migration failed, You will want to investigate: https://dc07asml01.cityofchicago.org/foreman_tasks/tasks/1a26a0da-e074-4386-9d19-26fee4e341e7
rake aborted!
ForemanTasks::TaskError: Task 1a26a0da-e074-4386-9d19-26fee4e341e7: ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column katello_debs.migrated_pulp3_href does not exist
LINE 1: SELECT COUNT(*) FROM “katello_debs” WHERE “katello_debs”."mi…
^
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.2.1/lib/katello/tasks/pulp3_migration.rake:33:in block (2 levels) in <top (required)>' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in <top (required)>’
Tasks: TOP => katello:pulp3_migration
(See full trace by running task with --trace)
[FAIL]
Failed executing foreman-rake katello:pulp3_migration, exit status 1

Scenario [Prepare content for Pulp 3] failed.

The following steps ended up in failing state:

[content-prepare]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist=“content-prepare”

Please help,
Thanks in advance

Hi Justin,

The migration completed successfully, I had to run foreman-installer --katello-use-pulp-2-for-deb=false --katello-enable-deb=false.

Best regards,
Balaji Sankaran.

1 Like