Pulp3 migration failed with errors "PulpcoreClient::ApiError: Error message: the server returns an error HTTP status code: 403"

Hello there,
The details are as follows…

Problem:
Pulp3 migration failed with errors “PulpcoreClient::ApiError: Error message: the server returns an error
HTTP status code: 403”
Expected outcome:
Migration Successful
Foreman and Proxy versions:
Foreman 2.3.5 and Proxy 2.3.5
Foreman and Proxy plugin versions:
Foreman 2.3.5 and Katello 3.18.2
Distribution and version:
RHEL7.9 (Maipo)

Other relevant data:

Running Prepare content for Pulp 3

Prepare content for Pulp 3:
Starting task.
2021-06-10 15:01:45 -0500: Content migration starting. Migration failed, You will want to investigate: https://dc07asml02.fourstar.local/foreman_tasks/tasks/0c1e3191-1c2d-4457-b64f-3358d1e53c8e
rake aborted!
ForemanTasks::TaskError: Task 0c1e3191-1c2d-4457-b64f-3358d1e53c8e: PulpcoreClient::ApiError: Error message: the server returns an error
HTTP status code: 403
Response headers: {“date”=>“Thu, 10 Jun 2021 20:01:46 GMT”, “server”=>“gunicorn/20.0.4”, “content-type”=>“application/json”, “vary”=>“Accept,Cookie”, “allow”=>“GET, PATCH, DELETE, HEAD, OPTIONS”, “x-frame-options”=>“SAMEORIGIN”, “content-length”=>“63”, “via”=>“1.1 dc07asml02.fourstar.local”, “connection”=>“close”}
Response body: {“detail”:“You do not have permission to perform this action.”}
/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.3/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”

Thanks in advance
-Balaji Sankaran

hello,

I applied the following…

PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager shell

from django.contrib.auth import get_user_model
user_model = get_user_model()
user = user_model.objects.get(username=‘admin’)
user.is_superuser = True
user.save()

#################################################################################
But I am getting different errors as below…

Running Prepare content for Pulp 3

Prepare content for Pulp 3:
Starting task.
2021-06-10 18:10:14 -0500: Initial Migration steps complete.Migration failed, You will want to investigate: https://dc07asml02.fourstar.local/foreman_tasks/tasks/b349a019-13d0-4a2d-b52d-d21eaebeca28
rake aborted!
ForemanTasks::TaskError: Task b349a019-13d0-4a2d-b52d-d21eaebeca28: Katello::Errors::Pulp3Error: cursor “_django_curs_139951481308992_6” does not exist
/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.3/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,

Best regards,
Balaji Sankaran

Hello,

Could anyone please help me?

Thanks in advance!

Best regards,
Balaji Sankaran

A good starting point would be to check the task output as mentioned in the error message. It should contain the full traceback…

1 Like

Hello gvde,

That task is no more in the tasks, I guess it completed over the weekend. I ran the “foreman-maintain content prepare” it resulted with the errors below, I had to run “foreman-installer --katello-use-pulp-2-for-deb=false --katello-enable-deb=false” and after that ran “foreman-maintain content prepare” – completed successfully and “foreman-maintain content switchover” – completed successfully, overall migration completed successfully. I am working on upgrading the Katello to 4.0, do I need to run “foreman-installer --katello-enable-deb=true” after the Katello 4.0 upgrade?. Thank you!

foreman-maintain content prepare

Running Prepare content for Pulp 3

Prepare content for Pulp 3:
Starting task.
2021-06-14 15:57:26 -0500: Importing migrated content type package_group: 90/282Migration failed, You will want to investigate: https://dc07asml02.fourstar.local/foreman_tasks/tasks/bd5ddf21-f37d-488c-9567-ba38c801da3e
rake aborted!
ForemanTasks::TaskError: Task bd5ddf21-f37d-488c-9567-ba38c801da3e: 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.3/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”

@iballou Hey do you have any pointers for this guy?

Are you sure? Unless you have set up a cron job to clear out the old tasks within a day, you should still have that task in the list.

So you don’t have any problems anymore? You have made the switchover successfully? So now you can upgrade to katello 4.0…

Only if you have deb content. If you only have rpms, then you don’t need it. But it doesn’t hurt to turn it on, even if you don’t have any deb content (yet).

1 Like

Hello gvde,

No problems anymore, I was able to successfully switchover and was successfully able upgrade to Katello 4.0.

When I searched using the task ID, it was not showing up, may be there was a typo in the task ID, but later after the Katello 4.0 upgrade, when I searched for it, the task is there stopped with
“Errors: cursor “_django_curs_139951481308992_6” does not exist”.

Thank you!

Best regards,
Balaji Sankaran

1 Like

Sorry, I don’t have any.
I opened a support topic and he started responding with solutions.

Best regards,
Balaji Sankaran