Copy activation key failure

Problem:
Attempt to copy an activation key failed.

Expected outcome:
Activation key copied

Foreman and Proxy versions:
Foreman 2.3.3

Foreman and Proxy plugin versions:
Katello 3.18.2
Candlepin 3.1.22

Distribution and version:
CentOS 7.9.2009

Other relevant data:
Copied the activation key, changed the name and saved but the save didn’t appear to complete. Further actions on the copy fail due to a candlepin error 404

hammer activation-key info --organization-id 1 --id 14

Katello::Resources::Candlepin::CandlepinResource: 404 Not Found {“displayMessage”:“Runtime Error RESTEASY003210: Could not find resource for full path: https://localhost:23443/candlepin/activation_keys//content_overrides at org.jboss.resteasy.core.registry.SegmentNode.match:153”,“requestUuid”:“a822c250-f9f4-4510-8270-cf341f72a79f”} (GET /candlepin/activation_keys//content_overrides)

Unable to delete the activation key:
hammer activation-key delete --organization-id 1 --id 14
Could not delete the activation key:
Task 4fd03464-6a84-4fb1-99e7-0937ea26af9f: ArgumentError: activation key id has to be specified

Any ideas how to delete or fix this?

More info:

Access to the Activation key via the UI results in:

Katello::Resources::Candlepin::CandlepinResource: 404 Not Found {"displayMessage":"Runtime Error RESTEASY003210: Could not find resource for full path: https://localhost:23443/candlepin/activation_keys//content_overrides at org.jboss.resteasy.core.registry.SegmentNode.match:153","requestUuid":"839515d5-2d49-4f94-bebd-9016d6af0857"} (GET /candlepin/activation_keys//content_overrides)

It kinda looks like there is some mismatch in data between katello and candlepin and data is missing in candlepin.

You might look in monitor > Tasks and search for ‘label = Actions::Katello::ActivationKey::Create’
You should find a create task for this new copied key. If its paused you might try resuming it or looking for an error for more info.

If this task is ‘complete’ or you can’t resume it, we can try manually deleting the key (i’ll provide more info when i hear back from you)

Hey @Justin_Sherrill ,

So it looks like the first attempt has Timed out… (Results is pending, State is stopped)
Katello::Resources::Candlepin::ActivationKey: Timed out reading data from server (POST /candlepin/owners/DSTO/activation_keys)

But I’ve clearly gone nuts and tried again…
There’s one task Named simply “Create”
Validation failed: Name has already been taken
Clearly I tried and failed to create it again.

I have been able to succesfully create another activation key but for the sake of tidiness and to tame my OCD I’d like to know how to delete this one.

You should be able to do something like this to clean up the bad activation key:

foreman-rake console

Katello::ActivationKey.find(ID).destroy

where ID is the id of the activation key. Only run this command on the one key that you are having this issue with.

I also opened Bug #32664: ignore 404 on activation key delete - Katello - Foreman about this issue to make the cleanup easier.

1 Like

Thanks @Justin_Sherrill