Subscription-manager register fails

Problem:
Cannot register host with subscription-manager register

Expected outcome:
subscription-manager register adds new host in foreman and server is getting correct repositories

Foreman and Proxy versions:
Foreman: 1.17.1

Foreman and Proxy plugin versions:
Katello: 3.6.0

Other relevant data:
When I’m trying to register either a new host or a already running machine it fails. I made the following steps:

  • subscription-manager register --org=“ORG” --activationkey=“ACTKEY” on the host, this fails with the error:

"Required lock is already taken by other running tasks.
Please inspect their state, fix their errors and resume them.

Required lock: update
Conflicts with tasks:
TASKXY"

When I’m looking at that task, it stopped with the result “warning” and printed the following message:

Actions::Candlepin::Consumer::Update

{"uuid"=>"fe7955f2-3d93-4a78-944b-d2dee67af03d",
 "consumer_params"=>
  {"autoheal"=>false,
   "serviceLevel"=>nil,
   "releaseVer"=>nil,
   "environment"=>{"id"=>"24-16"},
   "installedProducts"=>
[{"productName"=>nil,
  "productId"=>nil,
  "arch"=>"x86_64",
  "version"=>"7.4"}]},
 "session_id"=>"2acd566f-ffd1-4978-9765-0e2bda72d202",
 "remote_user"=>"admin",
 "remote_cp_user"=>"admin"}

Katello::Errors::CandlepinError: Unable to serialize objects to JSON.

Additional information: Bug #24641: subscription-manager register fails - Katello - Foreman

Regards,
Martin Angermeier