Katello 3.16 creating new product pending

Problem:
state running result pending over 40 minutes
Expected outcome:
finished or successful
Foreman and Proxy versions:
foreman-proxy-2.1.4-1.el7.noarch
Foreman and Proxy plugin versions:

Distribution and version:
Red Hat Enterprise Linux Server release 7.9 (Maipo)
Other relevant data:
production.log
2020-11-05T16:24:20 [I|app|6cc4dc6b] Started POST “/katello/api/v2/repositories?organization_id=3” for 127.0.0.1 at 2020-11-05 16:24:20 +0100
2020-11-05T16:24:20 [I|app|6cc4dc6b] Processing by Katello::Api::V2::RepositoriesController#create as HTML
2020-11-05T16:24:20 [I|app|6cc4dc6b] Parameters: {“product_id”=>“162”, “unprotected”=>true, “checksum_type”=>nil, “mirror_on_sync”=>true, “verify_ssl_on_sync”=>true, “do
wnload_policy”=>“immediate”, “arch”=>“noarch”, “ostree_upstream_sync_policy”=>“latest”, “http_proxy_policy”=>“global_default_http_proxy”, “name”=>“gitlab-ce”, “label”=>“gi
tlab-ce”, “content_type”=>“yum”, “url”=>“https://packages.gitlab.com/gitlab/gitlab-ce/el/7/x86_64”, “organization_id”=>“3”, “api_version”=>“v2”, “repository”=>{“name”=>“gi
tlab-ce”, “arch”=>“noarch”, “label”=>“gitlab-ce”, “url”=>“https://packages.gitlab.com/gitlab/gitlab-ce/el/7/x86_64”, “unprotected”=>true, “content_type”=>“yum”, “product_i
d”=>“162”, “checksum_type”=>nil, “mirror_on_sync”=>true, “download_policy”=>“immediate”, “verify_ssl_on_sync”=>true, “ostree_upstream_sync_policy”=>“latest”, “http_proxy_p
olicy”=>“global_default_http_proxy”}}
2020-11-05T16:24:20 [I|bac|6cc4dc6b] Task {label: Actions::Katello::Repository::CreateRoot, id: ae312ef9-c6f8-48e5-969d-81f8f01a04af, execution_plan_id: 02a02b37-7029-47f2
-b8cf-d94fe7d63587} state changed: planning
2020-11-05T16:24:20 [E|bac|] Validation failed: Name has already been taken for this product., Label has already been taken for this product. (ActiveRecord::RecordInvalid)
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/validations.rb:80:in raise_validation_error' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/validations.rb:53:in save!’
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:318:in block in save!' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:375:in block in with_transaction_returning_status’
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in transaction' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:212:in transaction’
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:366:in with_transaction_returning_status' /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:318:in save!’
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/suppressor.rb:48:in save!' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.1.2/app/lib/actions/katello/repository/create_root.rb:6:in plan’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/action.rb:514:in block (3 levels) in execute_plan' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:27:in pass’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware.rb:19:in pass' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware.rb:36:in plan’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:23:in call' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:27:in pass’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware.rb:19:in pass' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware.rb:36:in plan’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:23:in call' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:27:in pass’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware.rb:19:in pass' /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_request_id.rb:10:in block in plan’
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_request_id.rb:31:in with_current_request_id' /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-2.0.2/app/lib/actions/middleware/keep_current_request_id.rb:9:in plan’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:23:in call' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:27:in pass’
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware.rb:19:in `pass’

this product was never been registered before

Check monitor > tasks for any product create tasks. Its possible there is one stuck in a ‘paused’ state, indicating an error occurred. You may need to look for a traceback within that task, or try hitting the ‘resume’ button.

Hi Justin
Thanks for the hint, after resume i got error in postgresql:
11658ab3-a09e-4c02-a805-7dc174af31b4 | Actions::Katello::Product::Create | 2020-11-05 15:21:42.857 | running | error

Hi Justin, i coulnd’t remove the product so i saw this command, someone from your team wrote it here in Forum, should be the save way to remove such tasks :
foreman-rake foreman_tasks:cleanup TASK_SEARCH=“id = 11658ab3-a09e-4c02-a805-7dc174af31b4” STATES=all
It also removed some orphan tasks and after that i could’n’t register any client to katello i get following message on client in /var/log/rhsm/rhsm.log:
[ERROR] subscription-manager:14525:MainThread @connection.py:643 - Response: 502
2020-11-06 20:27:52,613 [ERROR] subscription-manager:14525:MainThread @connection.py:644 - JSON parsing error: No JSON object could be decoded
2020-11-06 20:27:52,614 [ERROR] subscription-manager:14525:MainThread @managercli.py:217 - Error during registration: Server error attempting a POST to /rhsm/consumers?owner=Operations&activation_keys=Rhel7 returned status 502

Any Idea what it could be?
Thanks
Aleksandar

Now i can see the client is registered in katello but not subscribed, i can see it also in /var/log/foreman/production.log on katello server
create event on uuid e5f296f9-ac4a-483a-9aeb-857a13027c8b.
Somehow it does not get certificates from katello-ca-consumer-latest.noarch.rpm after installting it.
when i do this on client “subscription-manager attach” i get the error:
This system is not yet registered. Try ‘subscription-manager register --help’ for more information.