[Katello 2.4] Activation key deletion failed. now cannot view any activation keys

On Katello 2.4 I was trying to delete an activation key that had no clients
attached to it and wasn't in use anymore.

The delete failed and I could not resume the task. The only option to get
it to 'finish' was going into the dynflow console and skipping the
'destroy' step.

Now the task is 100% complete in state 'stopped' error

When I go to the activation keys menu and try to load the page it never
loads now. It just sits there with the spinning wheel that says
'Loading…'

I have restarted the service already.

Please help. I don't know how to get this page to load now.

The specific error when I tried to delete the key was :

Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey)

··· On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters wrote: > > On Katello 2.4 I was trying to delete an activation key that had no > clients attached to it and wasn't in use anymore. > > The delete failed and I could not resume the task. The only option to get > it to 'finish' was going into the dynflow console and skipping the > 'destroy' step. > > Now the task is 100% complete in state 'stopped' error > > When I go to the activation keys menu and try to load the page it never > loads now. It just sits there with the spinning wheel that says > 'Loading...' > > I have restarted the service already. > > Please help. I don't know how to get this page to load now. >

Hammer also fails.

[root@katello1 ~]# hammer activation-key list --organization "My Org"
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.","requestUuid":"4b9ba612-9e41-4f3b-941c-81d7f942e367"}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)

··· On Thursday, February 18, 2016 at 5:32:39 PM UTC-8, Nathan Peters wrote: > > The specific error when I tried to delete the key was : > > Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) > > > > On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters wrote: >> >> On Katello 2.4 I was trying to delete an activation key that had no >> clients attached to it and wasn't in use anymore. >> >> The delete failed and I could not resume the task. The only option to >> get it to 'finish' was going into the dynflow console and skipping the >> 'destroy' step. >> >> Now the task is 100% complete in state 'stopped' error >> >> When I go to the activation keys menu and try to load the page it never >> loads now. It just sits there with the spinning wheel that says >> 'Loading...' >> >> I have restarted the service already. >> >> Please help. I don't know how to get this page to load now. >> >

Nathan,

That is a known bug that is fixed upstream and will be released in
2.4.1. Its a small change to fix it, are you able to make this change[1]
here in app/models/katello/activation_key.rb? :inverse_of =>
:activation_keys shoud be :inverse_of => :activation_key Hope that
helps, let me know if you have any questions or are unable to make the
change in the code.

https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22

-John

··· On 02/18/2016 08:32 PM, Nathan Peters wrote: > The specific error when I tried to delete the key was : > Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) > > > On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters wrote: > > On Katello 2.4 I was trying to delete an activation key that had > no clients attached to it and wasn't in use anymore. > > The delete failed and I could not resume the task. The only > option to get it to 'finish' was going into the dynflow console > and skipping the 'destroy' step. > > Now the task is 100% complete in state 'stopped' error > > When I go to the activation keys menu and try to load the page it > never loads now. It just sits there with the spinning wheel that > says 'Loading...' > > I have restarted the service already. > > Please help. I don't know how to get this page to load now. > > -- > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to foreman-users+unsubscribe@googlegroups.com > . > To post to this group, send email to foreman-users@googlegroups.com > . > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering
860-967-7285
irc: jomitsch

hammer also fails to delete if i give it the activation key that it errored
out on trying to show the list.

[root@katello1 ~]# hammer activation-key delete --organization "My org"
–id 8a3280ee51ac0a000151aeafb68201a6
[Foreman] Password for admin:
Could not delete the activation key:
Task 1feaa053-084e-4f2f-b300-fba970ad2684:
ActiveRecord::InverseOfAssociationNotFoundError: Could not find the inverse
association for pool_activation_keys (:activation_keys in
Katello::PoolActivationKey)

··· On Thursday, February 18, 2016 at 5:36:41 PM UTC-8, Nathan Peters wrote: > > Hammer also fails. > > [root@katello1 ~]# hammer activation-key list --organization "My Org" > [Foreman] Password for admin: > Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found > {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 > could not be found.","requestUuid":"4b9ba612-9e41-4f3b-941c-81d7f942e367"} > (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) > > > On Thursday, February 18, 2016 at 5:32:39 PM UTC-8, Nathan Peters wrote: >> >> The specific error when I tried to delete the key was : >> >> Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) >> >> >> >> On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters wrote: >>> >>> On Katello 2.4 I was trying to delete an activation key that had no >>> clients attached to it and wasn't in use anymore. >>> >>> The delete failed and I could not resume the task. The only option to >>> get it to 'finish' was going into the dynflow console and skipping the >>> 'destroy' step. >>> >>> Now the task is 100% complete in state 'stopped' error >>> >>> When I go to the activation keys menu and try to load the page it never >>> loads now. It just sits there with the spinning wheel that says >>> 'Loading...' >>> >>> I have restarted the service already. >>> >>> Please help. I don't know how to get this page to load now. >>> >>

I followed the link to that fix from github and updated the file on line 22
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb

I noticed that in that git commit, there were changes to a 2nd file,
activation_keys_controller_test.rb. I noticed that file (along with the
test directory referenced) does not exist on my system.

After making the updates to the file that does exist on my system, I still
cannot get rid of the phantom key, but this time the error message is
different.

Listing keys still shows the error about the phantom key, but the delete
command now gives a different error "key not found" as opposed to the old
message about inverse key pools.

So the change worked… kind of. It got rid of one error, but I am still
blocked on this new error.

[root@katello1 /]# hammer activation-key list --organization "My Org"
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.","requestUuid":"afd0477b-8e78-446f-8c98-631121508836"}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)
[root@katello1 /]# hammer activation-key delete --organization "My Org"
–id 8a3280ee51ac0a000151aeafb68201a6
[Foreman] Password for admin:
Could not delete the activation key:
Couldn't find Katello::ActivationKey with
id=8a3280ee51ac0a000151aeafb68201a6
[root@katello /]# hammer activation-key list --organization "My Org"
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.","requestUuid":"ba00aedf-32bf-4109-b382-3b874ce36b8a"}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)

··· On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote: > > Nathan, > > That is a known bug that is fixed upstream and will be released in 2.4.1. > Its a small change to fix it, are you able to make this change[1] here in > app/models/katello/activation_key.rb? :inverse_of => :activation_keys shoud > be :inverse_of => :activation_key Hope that helps, let me know if you have > any questions or are unable to make the change in the code. > > 1. > https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22 > > -John > > On 02/18/2016 08:32 PM, Nathan Peters wrote: > > The specific error when I tried to delete the key was : > > Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) > > > > On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters wrote: >> >> On Katello 2.4 I was trying to delete an activation key that had no >> clients attached to it and wasn't in use anymore. >> >> The delete failed and I could not resume the task. The only option to >> get it to 'finish' was going into the dynflow console and skipping the >> 'destroy' step. >> >> Now the task is 100% complete in state 'stopped' error >> >> When I go to the activation keys menu and try to load the page it never >> loads now. It just sits there with the spinning wheel that says >> 'Loading...' >> >> I have restarted the service already. >> >> Please help. I don't know how to get this page to load now. >> > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-user...@googlegroups.com . > To post to this group, send email to forema...@googlegroups.com > . > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout. > > > -- > John Mitsch > Red Hat Engineering > 860-967-7285 > irc: jomitsch > > >

Nathan,

Glad to hear that got rid of the first error. The test files are just
for development purposes, so afaik it would be normal not to see them,
and they wouldn't require any changes from you.

Do you still see the original dynflow task where you tried to delete the
activation key? If so, your best course of action would be to try to
resume that task.

-John

··· On 02/19/2016 04:44 PM, Nathan Peters wrote: > I followed the link to that fix from github and updated the file on > line 22 > /opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb > > I noticed that in that git commit, there were changes to a 2nd file, > activation_keys_controller_test.rb. I noticed that file (along with > the test directory referenced) does not exist on my system. > > After making the updates to the file that does exist on my system, I > still cannot get rid of the phantom key, but this time the error > message is different. > > Listing keys still shows the error about the phantom key, but the > delete command now gives a different error "key not found" as opposed > to the old message about inverse key pools. > > So the change worked... kind of. It got rid of one error, but I am > still blocked on this new error. > > > [root@katello1 /]# hammer activation-key list --organization "My Org" > [Foreman] Password for admin: > Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found > {"displayMessage":"ActivationKey with id > 8a3280ee51ac0a000151aeafb68201a6 could not be > found.","requestUuid":"afd0477b-8e78-446f-8c98-631121508836"} (GET > /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) > [root@katello1 /]# hammer activation-key delete --organization "My > Org" --id 8a3280ee51ac0a000151aeafb68201a6 > [Foreman] Password for admin: > Could not delete the activation key: > Couldn't find Katello::ActivationKey with > id=8a3280ee51ac0a000151aeafb68201a6 > [root@katello /]# hammer activation-key list --organization "My Org" > [Foreman] Password for admin: > Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found > {"displayMessage":"ActivationKey with id > 8a3280ee51ac0a000151aeafb68201a6 could not be > found.","requestUuid":"ba00aedf-32bf-4109-b382-3b874ce36b8a"} (GET > /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) > > > On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote: > > Nathan, > > That is a known bug that is fixed upstream and will be released in > 2.4.1. Its a small change to fix it, are you able to make this > change[1] here in app/models/katello/activation_key.rb? > :inverse_of => :activation_keys shoud be :inverse_of => > :activation_key Hope that helps, let me know if you have any > questions or are unable to make the change in the code. > > 1. > https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22 > > > -John > > On 02/18/2016 08:32 PM, Nathan Peters wrote: >> The specific error when I tried to delete the key was : >> Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) >> >> >> On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters >> wrote: >> >> On Katello 2.4 I was trying to delete an activation key that >> had no clients attached to it and wasn't in use anymore. >> >> The delete failed and I could not resume the task. The only >> option to get it to 'finish' was going into the dynflow >> console and skipping the 'destroy' step. >> >> Now the task is 100% complete in state 'stopped' error >> >> When I go to the activation keys menu and try to load the >> page it never loads now. It just sits there with the >> spinning wheel that says 'Loading...' >> >> I have restarted the service already. >> >> Please help. I don't know how to get this page to load now. >> >> -- >> You received this message because you are subscribed to the >> Google Groups "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, >> send an email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/foreman-users >> . >> For more options, visit https://groups.google.com/d/optout >> . > > -- > John Mitsch > Red Hat Engineering > 860-967-7285 > irc: jomitsch > > -- > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to foreman-users+unsubscribe@googlegroups.com > . > To post to this group, send email to foreman-users@googlegroups.com > . > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering
860-967-7285
irc: jomitsch

This isn't possible because I had to "skip" on of the steps in the task to
get it to complete (before I knew about the code fix necessary) so it is
now at 100% and stopped.

Any other options to fix this since I cannot resume a task at 100%?

··· On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote: > > Nathan, > > Glad to hear that got rid of the first error. The test files are just for > development purposes, so afaik it would be normal not to see them, and they > wouldn't require any changes from you. > > Do you still see the original dynflow task where you tried to delete the > activation key? If so, your best course of action would be to try to resume > that task. > > -John > > On 02/19/2016 04:44 PM, Nathan Peters wrote: > > I followed the link to that fix from github and updated the file on line > 22 > /opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb > > I noticed that in that git commit, there were changes to a 2nd file, > activation_keys_controller_test.rb. I noticed that file (along with the > test directory referenced) does not exist on my system. > > After making the updates to the file that does exist on my system, I still > cannot get rid of the phantom key, but this time the error message is > different. > > Listing keys still shows the error about the phantom key, but the delete > command now gives a different error "key not found" as opposed to the old > message about inverse key pools. > > So the change worked... kind of. It got rid of one error, but I am still > blocked on this new error. > > > [root@katello1 /]# hammer activation-key list --organization "My Org" > [Foreman] Password for admin: > Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found > {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 > could not be found.","requestUuid":"afd0477b-8e78-446f-8c98-631121508836"} > (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) > [root@katello1 /]# hammer activation-key delete --organization "My Org" > --id 8a3280ee51ac0a000151aeafb68201a6 > [Foreman] Password for admin: > Could not delete the activation key: > Couldn't find Katello::ActivationKey with > id=8a3280ee51ac0a000151aeafb68201a6 > [root@katello /]# hammer activation-key list --organization "My Org" > [Foreman] Password for admin: > Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found > {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 > could not be found.","requestUuid":"ba00aedf-32bf-4109-b382-3b874ce36b8a"} > (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) > > > On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote: >> >> Nathan, >> >> That is a known bug that is fixed upstream and will be released in 2.4.1. >> Its a small change to fix it, are you able to make this change[1] here in >> app/models/katello/activation_key.rb? :inverse_of => :activation_keys shoud >> be :inverse_of => :activation_key Hope that helps, let me know if you have >> any questions or are unable to make the change in the code. >> >> 1. >> https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22 >> >> -John >> >> On 02/18/2016 08:32 PM, Nathan Peters wrote: >> >> The specific error when I tried to delete the key was : >> >> Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) >> >> >> >> On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters wrote: >>> >>> On Katello 2.4 I was trying to delete an activation key that had no >>> clients attached to it and wasn't in use anymore. >>> >>> The delete failed and I could not resume the task. The only option to >>> get it to 'finish' was going into the dynflow console and skipping the >>> 'destroy' step. >>> >>> Now the task is 100% complete in state 'stopped' error >>> >>> When I go to the activation keys menu and try to load the page it never >>> loads now. It just sits there with the spinning wheel that says >>> 'Loading...' >>> >>> I have restarted the service already. >>> >>> Please help. I don't know how to get this page to load now. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com. >> To post to this group, send email to forema...@googlegroups.com. >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> >> >> -- >> John Mitsch >> Red Hat Engineering >> 860-967-7285 >> irc: jomitsch >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-user...@googlegroups.com . > To post to this group, send email to forema...@googlegroups.com > . > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout. > > > -- > John Mitsch > Red Hat Engineering > 860-967-7285 > irc: jomitsch > > >

Nathan,

Can you get the Activation Key id from the dynflow task? It will be in the
input and won't be a string like the 8a3280ee51ac0a000151aeafb68201a6 you
saw before (that is the id in candlepin) but rather an integer. Once you
have that you can run

Katello::ActivationKey.find(ID).destroy!

from the console. Because some of the steps were skipped, It makes it a bit
harder to delete and there may be some errors that we will have to fix and
patch up, but unfortunately this is the only option I know of for a
situation like this.

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

··· On Mon, Feb 22, 2016 at 4:59 PM, Nathan Peters wrote:

This isn’t possible because I had to “skip” on of the steps in the task to
get it to complete (before I knew about the code fix necessary) so it is
now at 100% and stopped.

Any other options to fix this since I cannot resume a task at 100%?

On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote:

Nathan,

Glad to hear that got rid of the first error. The test files are just for
development purposes, so afaik it would be normal not to see them, and they
wouldn’t require any changes from you.

Do you still see the original dynflow task where you tried to delete the
activation key? If so, your best course of action would be to try to resume
that task.

-John

On 02/19/2016 04:44 PM, Nathan Peters wrote:

I followed the link to that fix from github and updated the file on line
22
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb

I noticed that in that git commit, there were changes to a 2nd file,
activation_keys_controller_test.rb. I noticed that file (along with the
test directory referenced) does not exist on my system.

After making the updates to the file that does exist on my system, I
still cannot get rid of the phantom key, but this time the error message is
different.

Listing keys still shows the error about the phantom key, but the delete
command now gives a different error “key not found” as opposed to the old
message about inverse key pools.

So the change worked… kind of. It got rid of one error, but I am still
blocked on this new error.

[root@katello1 /]# hammer activation-key list --organization “My Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{“displayMessage”:“ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.”,“requestUuid”:“afd0477b-8e78-446f-8c98-631121508836”}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)
[root@katello1 /]# hammer activation-key delete --organization “My Org”
–id 8a3280ee51ac0a000151aeafb68201a6
[Foreman] Password for admin:
Could not delete the activation key:
Couldn’t find Katello::ActivationKey with
id=8a3280ee51ac0a000151aeafb68201a6
[root@katello /]# hammer activation-key list --organization “My Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{“displayMessage”:“ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.”,“requestUuid”:“ba00aedf-32bf-4109-b382-3b874ce36b8a”}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)

On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote:

Nathan,

That is a known bug that is fixed upstream and will be released in
2.4.1. Its a small change to fix it, are you able to make this change[1]
here in app/models/katello/activation_key.rb? :inverse_of =>
:activation_keys shoud be :inverse_of => :activation_key Hope that helps,
let me know if you have any questions or are unable to make the change in
the code.

https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22

-John

On 02/18/2016 08:32 PM, Nathan Peters wrote:

The specific error when I tried to delete the key was :

Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey)

On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters wrote:

On Katello 2.4 I was trying to delete an activation key that had no
clients attached to it and wasn’t in use anymore.

The delete failed and I could not resume the task. The only option to
get it to ‘finish’ was going into the dynflow console and skipping the
’destroy’ step.

Now the task is 100% complete in state ‘stopped’ error

When I go to the activation keys menu and try to load the page it never
loads now. It just sits there with the spinning wheel that says
’Loading…’

I have restarted the service already.

Please help. I don’t know how to get this page to load now.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

I was able to find the tasks and get the activation key IDs.

But, which console are you referring to?

There is no place in the dynflow console in the katello website where I can
manually enter any commands. That console is only for monitoring and
stopping and resuming commands that the system created itself somehow.
There is no "run this command" box or anything.

Also, that command you gave is definitely not a command line command as it
is invalid bash syntax.

··· On Monday, February 22, 2016 at 2:55:23 PM UTC-8, John Mitsch wrote: > > Nathan, > > Can you get the Activation Key id from the dynflow task? It will be in the > input and won't be a string like the 8a3280ee51ac0a000151aeafb68201a6 you > saw before (that is the id in candlepin) but rather an integer. Once you > have that you can run > > Katello::ActivationKey.find(ID).destroy! > > from the console. Because some of the steps were skipped, It makes it a > bit harder to delete and there may be some errors that we will have to fix > and patch up, but unfortunately this is the only option I know of for a > situation like this. > > John Mitsch > Red Hat Engineering > (860)-967-7285 > irc: jomitsch > > On Mon, Feb 22, 2016 at 4:59 PM, Nathan Peters > wrote: > >> This isn't possible because I had to "skip" on of the steps in the task >> to get it to complete (before I knew about the code fix necessary) so it is >> now at 100% and stopped. >> >> Any other options to fix this since I cannot resume a task at 100%? >> >> >> On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote: >>> >>> Nathan, >>> >>> Glad to hear that got rid of the first error. The test files are just >>> for development purposes, so afaik it would be normal not to see them, and >>> they wouldn't require any changes from you. >>> >>> Do you still see the original dynflow task where you tried to delete the >>> activation key? If so, your best course of action would be to try to resume >>> that task. >>> >>> -John >>> >>> On 02/19/2016 04:44 PM, Nathan Peters wrote: >>> >>> I followed the link to that fix from github and updated the file on line >>> 22 >>> /opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb >>> >>> I noticed that in that git commit, there were changes to a 2nd file, >>> activation_keys_controller_test.rb. I noticed that file (along with the >>> test directory referenced) does not exist on my system. >>> >>> After making the updates to the file that does exist on my system, I >>> still cannot get rid of the phantom key, but this time the error message is >>> different. >>> >>> Listing keys still shows the error about the phantom key, but the delete >>> command now gives a different error "key not found" as opposed to the old >>> message about inverse key pools. >>> >>> So the change worked... kind of. It got rid of one error, but I am >>> still blocked on this new error. >>> >>> >>> [root@katello1 /]# hammer activation-key list --organization "My Org" >>> [Foreman] Password for admin: >>> Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found >>> {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 >>> could not be found.","requestUuid":"afd0477b-8e78-446f-8c98-631121508836"} >>> (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) >>> [root@katello1 /]# hammer activation-key delete --organization "My Org" >>> --id 8a3280ee51ac0a000151aeafb68201a6 >>> [Foreman] Password for admin: >>> Could not delete the activation key: >>> Couldn't find Katello::ActivationKey with >>> id=8a3280ee51ac0a000151aeafb68201a6 >>> [root@katello /]# hammer activation-key list --organization "My Org" >>> [Foreman] Password for admin: >>> Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found >>> {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 >>> could not be found.","requestUuid":"ba00aedf-32bf-4109-b382-3b874ce36b8a"} >>> (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) >>> >>> >>> On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote: >>>> >>>> Nathan, >>>> >>>> That is a known bug that is fixed upstream and will be released in >>>> 2.4.1. Its a small change to fix it, are you able to make this change[1] >>>> here in app/models/katello/activation_key.rb? :inverse_of => >>>> :activation_keys shoud be :inverse_of => :activation_key Hope that helps, >>>> let me know if you have any questions or are unable to make the change in >>>> the code. >>>> >>>> 1. >>>> https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22 >>>> >>>> -John >>>> >>>> On 02/18/2016 08:32 PM, Nathan Peters wrote: >>>> >>>> The specific error when I tried to delete the key was : >>>> >>>> Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) >>>> >>>> >>>> >>>> On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters >>>> wrote: >>>>> >>>>> On Katello 2.4 I was trying to delete an activation key that had no >>>>> clients attached to it and wasn't in use anymore. >>>>> >>>>> The delete failed and I could not resume the task. The only option to >>>>> get it to 'finish' was going into the dynflow console and skipping the >>>>> 'destroy' step. >>>>> >>>>> Now the task is 100% complete in state 'stopped' error >>>>> >>>>> When I go to the activation keys menu and try to load the page it >>>>> never loads now. It just sits there with the spinning wheel that says >>>>> 'Loading...' >>>>> >>>>> I have restarted the service already. >>>>> >>>>> Please help. I don't know how to get this page to load now. >>>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Foreman users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to foreman-user...@googlegroups.com. >>>> To post to this group, send email to forema...@googlegroups.com. >>>> Visit this group at https://groups.google.com/group/foreman-users. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>>> >>>> -- >>>> John Mitsch >>>> Red Hat Engineering860-967-7285 >>>> irc: jomitsch >>>> >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Foreman users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to foreman-user...@googlegroups.com. >>> To post to this group, send email to forema...@googlegroups.com. >>> Visit this group at https://groups.google.com/group/foreman-users. >>> For more options, visit https://groups.google.com/d/optout. >>> >>> >>> -- >>> John Mitsch >>> Red Hat Engineering860-967-7285 >>> irc: jomitsch >>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

Nathan,

My apologies for not being specific, if you run foreman-rake console that
will give you access to the rails console for where you can run the command
I gave you.

-John

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

··· On Tue, Feb 23, 2016 at 5:37 PM, Nathan Peters wrote:

I was able to find the tasks and get the activation key IDs.

But, which console are you referring to?

There is no place in the dynflow console in the katello website where I
can manually enter any commands. That console is only for monitoring and
stopping and resuming commands that the system created itself somehow.
There is no “run this command” box or anything.

Also, that command you gave is definitely not a command line command as it
is invalid bash syntax.

On Monday, February 22, 2016 at 2:55:23 PM UTC-8, John Mitsch wrote:

Nathan,

Can you get the Activation Key id from the dynflow task? It will be in
the input and won’t be a string like the 8a3280ee51ac0a000151aeafb68201a6
you saw before (that is the id in candlepin) but rather an integer. Once
you have that you can run

Katello::ActivationKey.find(ID).destroy!

from the console. Because some of the steps were skipped, It makes it a
bit harder to delete and there may be some errors that we will have to fix
and patch up, but unfortunately this is the only option I know of for a
situation like this.

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Mon, Feb 22, 2016 at 4:59 PM, Nathan Peters nathanp...@gmail.com >> wrote:

This isn’t possible because I had to “skip” on of the steps in the task
to get it to complete (before I knew about the code fix necessary) so it is
now at 100% and stopped.

Any other options to fix this since I cannot resume a task at 100%?

On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote:

Nathan,

Glad to hear that got rid of the first error. The test files are just
for development purposes, so afaik it would be normal not to see them, and
they wouldn’t require any changes from you.

Do you still see the original dynflow task where you tried to delete
the activation key? If so, your best course of action would be to try to
resume that task.

-John

On 02/19/2016 04:44 PM, Nathan Peters wrote:

I followed the link to that fix from github and updated the file on
line 22
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb

I noticed that in that git commit, there were changes to a 2nd file,
activation_keys_controller_test.rb. I noticed that file (along with the
test directory referenced) does not exist on my system.

After making the updates to the file that does exist on my system, I
still cannot get rid of the phantom key, but this time the error message is
different.

Listing keys still shows the error about the phantom key, but the
delete command now gives a different error “key not found” as opposed to
the old message about inverse key pools.

So the change worked… kind of. It got rid of one error, but I am
still blocked on this new error.

[root@katello1 /]# hammer activation-key list --organization “My Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{“displayMessage”:“ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.”,“requestUuid”:“afd0477b-8e78-446f-8c98-631121508836”}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)
[root@katello1 /]# hammer activation-key delete --organization “My
Org” --id 8a3280ee51ac0a000151aeafb68201a6
[Foreman] Password for admin:
Could not delete the activation key:
Couldn’t find Katello::ActivationKey with
id=8a3280ee51ac0a000151aeafb68201a6
[root@katello /]# hammer activation-key list --organization “My Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{“displayMessage”:“ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.”,“requestUuid”:“ba00aedf-32bf-4109-b382-3b874ce36b8a”}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)

On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote:

Nathan,

That is a known bug that is fixed upstream and will be released in
2.4.1. Its a small change to fix it, are you able to make this change[1]
here in app/models/katello/activation_key.rb? :inverse_of =>
:activation_keys shoud be :inverse_of => :activation_key Hope that helps,
let me know if you have any questions or are unable to make the change in
the code.

https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22

-John

On 02/18/2016 08:32 PM, Nathan Peters wrote:

The specific error when I tried to delete the key was :

Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey)

On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters >>>>> wrote:

On Katello 2.4 I was trying to delete an activation key that had no
clients attached to it and wasn’t in use anymore.

The delete failed and I could not resume the task. The only option
to get it to ‘finish’ was going into the dynflow console and skipping the
’destroy’ step.

Now the task is 100% complete in state ‘stopped’ error

When I go to the activation keys menu and try to load the page it
never loads now. It just sits there with the spinning wheel that says
’Loading…’

I have restarted the service already.

Please help. I don’t know how to get this page to load now.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Maybe I'm not understanding how this thing works but foreman-rake --help
and "man foreman-rake" both seemed pretty useless.

[root@katello1 ~]# foreman-rake -e "Katello::ActivationKey.find(4).destroy!"
-bash: !": event not found
[root@katello1 ~]# foreman-rake -e "Katello::ActivationKey.find(4).destroy"
rake aborted!
uninitialized constant Rake::Application::Katello

(See full trace by running task with --trace)
[root@katello1 ~]# foreman-rake "Katello::ActivationKey.find(4).destroy"
rake aborted!
Don't know how to build task 'Katello::ActivationKey.find(4).destroy'

(See full trace by running task with --trace)
[root@katello1 ~]# foreman-rake "Katello::ActivationKey.find(4).destroy!"
-bash: !": event not found
[root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy
-bash: syntax error near unexpected token (' [root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy! -bash: syntax error near unexpected token('

··· On Tuesday, February 23, 2016 at 2:56:33 PM UTC-8, John Mitsch wrote: > > Nathan, > > My apologies for not being specific, if you run foreman-rake console that > will give you access to the rails console for where you can run the command > I gave you. > > -John > > John Mitsch > Red Hat Engineering > (860)-967-7285 > irc: jomitsch > > On Tue, Feb 23, 2016 at 5:37 PM, Nathan Peters > wrote: > >> I was able to find the tasks and get the activation key IDs. >> >> But, which console are you referring to? >> >> There is no place in the dynflow console in the katello website where I >> can manually enter any commands. That console is only for monitoring and >> stopping and resuming commands that the system created itself somehow. >> There is no "run this command" box or anything. >> >> Also, that command you gave is definitely not a command line command as >> it is invalid bash syntax. >> >> On Monday, February 22, 2016 at 2:55:23 PM UTC-8, John Mitsch wrote: >>> >>> Nathan, >>> >>> Can you get the Activation Key id from the dynflow task? It will be in >>> the input and won't be a string like the 8a3280ee51ac0a000151aeafb68201a6 >>> you saw before (that is the id in candlepin) but rather an integer. Once >>> you have that you can run >>> >>> Katello::ActivationKey.find(ID).destroy! >>> >>> from the console. Because some of the steps were skipped, It makes it a >>> bit harder to delete and there may be some errors that we will have to fix >>> and patch up, but unfortunately this is the only option I know of for a >>> situation like this. >>> >>> John Mitsch >>> Red Hat Engineering >>> (860)-967-7285 >>> irc: jomitsch >>> >>> On Mon, Feb 22, 2016 at 4:59 PM, Nathan Peters >>> wrote: >>> >>>> This isn't possible because I had to "skip" on of the steps in the task >>>> to get it to complete (before I knew about the code fix necessary) so it is >>>> now at 100% and stopped. >>>> >>>> Any other options to fix this since I cannot resume a task at 100%? >>>> >>>> >>>> On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote: >>>>> >>>>> Nathan, >>>>> >>>>> Glad to hear that got rid of the first error. The test files are just >>>>> for development purposes, so afaik it would be normal not to see them, and >>>>> they wouldn't require any changes from you. >>>>> >>>>> Do you still see the original dynflow task where you tried to delete >>>>> the activation key? If so, your best course of action would be to try to >>>>> resume that task. >>>>> >>>>> -John >>>>> >>>>> On 02/19/2016 04:44 PM, Nathan Peters wrote: >>>>> >>>>> I followed the link to that fix from github and updated the file on >>>>> line 22 >>>>> /opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb >>>>> >>>>> I noticed that in that git commit, there were changes to a 2nd file, >>>>> activation_keys_controller_test.rb. I noticed that file (along with the >>>>> test directory referenced) does not exist on my system. >>>>> >>>>> After making the updates to the file that does exist on my system, I >>>>> still cannot get rid of the phantom key, but this time the error message is >>>>> different. >>>>> >>>>> Listing keys still shows the error about the phantom key, but the >>>>> delete command now gives a different error "key not found" as opposed to >>>>> the old message about inverse key pools. >>>>> >>>>> So the change worked... kind of. It got rid of one error, but I am >>>>> still blocked on this new error. >>>>> >>>>> >>>>> [root@katello1 /]# hammer activation-key list --organization "My Org" >>>>> [Foreman] Password for admin: >>>>> Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found >>>>> {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 >>>>> could not be found.","requestUuid":"afd0477b-8e78-446f-8c98-631121508836"} >>>>> (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) >>>>> [root@katello1 /]# hammer activation-key delete --organization "My >>>>> Org" --id 8a3280ee51ac0a000151aeafb68201a6 >>>>> [Foreman] Password for admin: >>>>> Could not delete the activation key: >>>>> Couldn't find Katello::ActivationKey with >>>>> id=8a3280ee51ac0a000151aeafb68201a6 >>>>> [root@katello /]# hammer activation-key list --organization "My Org" >>>>> [Foreman] Password for admin: >>>>> Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found >>>>> {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 >>>>> could not be found.","requestUuid":"ba00aedf-32bf-4109-b382-3b874ce36b8a"} >>>>> (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) >>>>> >>>>> >>>>> On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote: >>>>>> >>>>>> Nathan, >>>>>> >>>>>> That is a known bug that is fixed upstream and will be released in >>>>>> 2.4.1. Its a small change to fix it, are you able to make this change[1] >>>>>> here in app/models/katello/activation_key.rb? :inverse_of => >>>>>> :activation_keys shoud be :inverse_of => :activation_key Hope that helps, >>>>>> let me know if you have any questions or are unable to make the change in >>>>>> the code. >>>>>> >>>>>> 1. >>>>>> https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22 >>>>>> >>>>>> -John >>>>>> >>>>>> On 02/18/2016 08:32 PM, Nathan Peters wrote: >>>>>> >>>>>> The specific error when I tried to delete the key was : >>>>>> >>>>>> Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) >>>>>> >>>>>> >>>>>> >>>>>> On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters >>>>>> wrote: >>>>>>> >>>>>>> On Katello 2.4 I was trying to delete an activation key that had no >>>>>>> clients attached to it and wasn't in use anymore. >>>>>>> >>>>>>> The delete failed and I could not resume the task. The only option >>>>>>> to get it to 'finish' was going into the dynflow console and skipping the >>>>>>> 'destroy' step. >>>>>>> >>>>>>> Now the task is 100% complete in state 'stopped' error >>>>>>> >>>>>>> When I go to the activation keys menu and try to load the page it >>>>>>> never loads now. It just sits there with the spinning wheel that says >>>>>>> 'Loading...' >>>>>>> >>>>>>> I have restarted the service already. >>>>>>> >>>>>>> Please help. I don't know how to get this page to load now. >>>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Foreman users" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to foreman-user...@googlegroups.com. >>>>>> To post to this group, send email to forema...@googlegroups.com. >>>>>> Visit this group at https://groups.google.com/group/foreman-users. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>>> >>>>>> -- >>>>>> John Mitsch >>>>>> Red Hat Engineering860-967-7285 >>>>>> irc: jomitsch >>>>>> >>>>>> >>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Foreman users" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to foreman-user...@googlegroups.com. >>>>> To post to this group, send email to forema...@googlegroups.com. >>>>> Visit this group at https://groups.google.com/group/foreman-users. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>>> >>>>> -- >>>>> John Mitsch >>>>> Red Hat Engineering860-967-7285 >>>>> irc: jomitsch >>>>> >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Foreman users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to foreman-user...@googlegroups.com. >>>> To post to this group, send email to forema...@googlegroups.com. >>>> Visit this group at https://groups.google.com/group/foreman-users. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

Nathan,

You are going to want to specify console after foreman-rake. Its a separate
console that brings up the foreman/katello rails environment. Here is an
example to better understand

[root@katello1 ~]# foreman-rake console

then the prompt for the console should appear and that is when you can enter

> Katello::ActivationKey.find(4).destroy!

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

··· On Tue, Feb 23, 2016 at 6:06 PM, Nathan Peters wrote:

Maybe I’m not understanding how this thing works but foreman-rake --help
and “man foreman-rake” both seemed pretty useless.

[root@katello1 ~]# foreman-rake -e
"Katello::ActivationKey.find(4).destroy!"
-bash: !": event not found
[root@katello1 ~]# foreman-rake -e
"Katello::ActivationKey.find(4).destroy"
rake aborted!
uninitialized constant Rake::Application::Katello

(See full trace by running task with --trace)
[root@katello1 ~]# foreman-rake "Katello::ActivationKey.find(4).destroy"
rake aborted!
Don’t know how to build task ‘Katello::ActivationKey.find(4).destroy’

(See full trace by running task with --trace)
[root@katello1 ~]# foreman-rake “Katello::ActivationKey.find(4).destroy!”
-bash: !": event not found
[root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy
-bash: syntax error near unexpected token (' [root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy! -bash: syntax error near unexpected token(’

On Tuesday, February 23, 2016 at 2:56:33 PM UTC-8, John Mitsch wrote:

Nathan,

My apologies for not being specific, if you run foreman-rake console
that will give you access to the rails console for where you can run the
command I gave you.

-John

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Tue, Feb 23, 2016 at 5:37 PM, Nathan Peters nathanp...@gmail.com >> wrote:

I was able to find the tasks and get the activation key IDs.

But, which console are you referring to?

There is no place in the dynflow console in the katello website where I
can manually enter any commands. That console is only for monitoring and
stopping and resuming commands that the system created itself somehow.
There is no “run this command” box or anything.

Also, that command you gave is definitely not a command line command as
it is invalid bash syntax.

On Monday, February 22, 2016 at 2:55:23 PM UTC-8, John Mitsch wrote:

Nathan,

Can you get the Activation Key id from the dynflow task? It will be in
the input and won’t be a string like the 8a3280ee51ac0a000151aeafb68201a6
you saw before (that is the id in candlepin) but rather an integer. Once
you have that you can run

Katello::ActivationKey.find(ID).destroy!

from the console. Because some of the steps were skipped, It makes it a
bit harder to delete and there may be some errors that we will have to fix
and patch up, but unfortunately this is the only option I know of for a
situation like this.

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Mon, Feb 22, 2016 at 4:59 PM, Nathan Peters nathanp...@gmail.com >>>> wrote:

This isn’t possible because I had to “skip” on of the steps in the
task to get it to complete (before I knew about the code fix necessary) so
it is now at 100% and stopped.

Any other options to fix this since I cannot resume a task at 100%?

On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote:

Nathan,

Glad to hear that got rid of the first error. The test files are just
for development purposes, so afaik it would be normal not to see them, and
they wouldn’t require any changes from you.

Do you still see the original dynflow task where you tried to delete
the activation key? If so, your best course of action would be to try to
resume that task.

-John

On 02/19/2016 04:44 PM, Nathan Peters wrote:

I followed the link to that fix from github and updated the file on
line 22
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb

I noticed that in that git commit, there were changes to a 2nd file,
activation_keys_controller_test.rb. I noticed that file (along with the
test directory referenced) does not exist on my system.

After making the updates to the file that does exist on my system, I
still cannot get rid of the phantom key, but this time the error message is
different.

Listing keys still shows the error about the phantom key, but the
delete command now gives a different error “key not found” as opposed to
the old message about inverse key pools.

So the change worked… kind of. It got rid of one error, but I am
still blocked on this new error.

[root@katello1 /]# hammer activation-key list --organization “My Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{“displayMessage”:“ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.”,“requestUuid”:“afd0477b-8e78-446f-8c98-631121508836”}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)
[root@katello1 /]# hammer activation-key delete --organization “My
Org” --id 8a3280ee51ac0a000151aeafb68201a6
[Foreman] Password for admin:
Could not delete the activation key:
Couldn’t find Katello::ActivationKey with
id=8a3280ee51ac0a000151aeafb68201a6
[root@katello /]# hammer activation-key list --organization “My Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found
{“displayMessage”:“ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6
could not be found.”,“requestUuid”:“ba00aedf-32bf-4109-b382-3b874ce36b8a”}
(GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)

On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch wrote:

Nathan,

That is a known bug that is fixed upstream and will be released in
2.4.1. Its a small change to fix it, are you able to make this change[1]
here in app/models/katello/activation_key.rb? :inverse_of =>
:activation_keys shoud be :inverse_of => :activation_key Hope that helps,
let me know if you have any questions or are unable to make the change in
the code.

https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22

-John

On 02/18/2016 08:32 PM, Nathan Peters wrote:

The specific error when I tried to delete the key was :

Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey)

On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters >>>>>>> wrote:

On Katello 2.4 I was trying to delete an activation key that had no
clients attached to it and wasn’t in use anymore.

The delete failed and I could not resume the task. The only option
to get it to ‘finish’ was going into the dynflow console and skipping the
’destroy’ step.

Now the task is 100% complete in state ‘stopped’ error

When I go to the activation keys menu and try to load the page it
never loads now. It just sits there with the spinning wheel that says
’Loading…’

I have restarted the service already.

Please help. I don’t know how to get this page to load now.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

It appears to have worked. It ran the following SQL and then I was once
again able to view my list of keys.

Thank you!

Katello::ActivationKey Load (1.9ms) SELECT "katello_activation_keys".*
FROM "katello_activation_keys" WHERE "katello_activation_keys"."id" = $1
LIMIT 1 [["id", 4]]
(0.1ms) BEGIN
Katello::KeyHostCollection Load (2.7ms) SELECT
"katello_key_host_collections".* FROM "katello_key_host_collections" WHERE
"katello_key_host_collections"."activation_key_id" = 4
SQL (0.6ms) DELETE FROM "katello_key_host_collections" WHERE
"katello_key_host_collections"."id" = $1 [["id", 1]]
Katello::SystemActivationKey Load (1.6ms) SELECT
"katello_system_activation_keys".* FROM "katello_system_activation_keys"
WHERE "katello_system_activation_keys"."activation_key_id" = 4
Katello::PoolActivationKey Load (2.3ms) SELECT
"katello_pool_activation_keys".* FROM "katello_pool_activation_keys" WHERE
"katello_pool_activation_keys"."activation_key_id" = 4
SQL (1.2ms) DELETE FROM "katello_pool_activation_keys" WHERE
"katello_pool_activation_keys"."id" = $1 [["id", 5]]
SQL (1.8ms) DELETE FROM "katello_activation_keys" WHERE
"katello_activation_keys"."id" = $1 [["id", 4]]
(0.9ms) COMMIT

··· On Wednesday, February 24, 2016 at 5:00:04 AM UTC-8, John Mitsch wrote: > > Nathan, > > You are going to want to specify console after foreman-rake. Its a > separate console that brings up the foreman/katello rails environment. Here > is an example to better understand > > [root@katello1 ~]# foreman-rake console > > then the prompt for the console should appear and that is when you can > enter > > > Katello::ActivationKey.find(4).destroy! > > > John Mitsch > Red Hat Engineering > (860)-967-7285 > irc: jomitsch > > On Tue, Feb 23, 2016 at 6:06 PM, Nathan Peters > wrote: > >> Maybe I'm not understanding how this thing works but foreman-rake --help >> and "man foreman-rake" both seemed pretty useless. >> >> [root@katello1 ~]# foreman-rake -e >> "Katello::ActivationKey.find(4).destroy!" >> -bash: !": event not found >> [root@katello1 ~]# foreman-rake -e >> "Katello::ActivationKey.find(4).destroy" >> rake aborted! >> uninitialized constant Rake::Application::Katello >> >> (See full trace by running task with --trace) >> [root@katello1 ~]# foreman-rake "Katello::ActivationKey.find(4).destroy" >> rake aborted! >> Don't know how to build task 'Katello::ActivationKey.find(4).destroy' >> >> (See full trace by running task with --trace) >> [root@katello1 ~]# foreman-rake "Katello::ActivationKey.find(4).destroy!" >> -bash: !": event not found >> [root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy >> -bash: syntax error near unexpected token `(' >> [root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy! >> -bash: syntax error near unexpected token `(' >> >> >> On Tuesday, February 23, 2016 at 2:56:33 PM UTC-8, John Mitsch wrote: >>> >>> Nathan, >>> >>> My apologies for not being specific, if you run foreman-rake console >>> that will give you access to the rails console for where you can run the >>> command I gave you. >>> >>> -John >>> >>> John Mitsch >>> Red Hat Engineering >>> (860)-967-7285 >>> irc: jomitsch >>> >>> On Tue, Feb 23, 2016 at 5:37 PM, Nathan Peters >>> wrote: >>> >>>> I was able to find the tasks and get the activation key IDs. >>>> >>>> But, which console are you referring to? >>>> >>>> There is no place in the dynflow console in the katello website where I >>>> can manually enter any commands. That console is only for monitoring and >>>> stopping and resuming commands that the system created itself somehow. >>>> There is no "run this command" box or anything. >>>> >>>> Also, that command you gave is definitely not a command line command as >>>> it is invalid bash syntax. >>>> >>>> On Monday, February 22, 2016 at 2:55:23 PM UTC-8, John Mitsch wrote: >>>>> >>>>> Nathan, >>>>> >>>>> Can you get the Activation Key id from the dynflow task? It will be in >>>>> the input and won't be a string like the 8a3280ee51ac0a000151aeafb68201a6 >>>>> you saw before (that is the id in candlepin) but rather an integer. Once >>>>> you have that you can run >>>>> >>>>> Katello::ActivationKey.find(ID).destroy! >>>>> >>>>> from the console. Because some of the steps were skipped, It makes it >>>>> a bit harder to delete and there may be some errors that we will have to >>>>> fix and patch up, but unfortunately this is the only option I know of for a >>>>> situation like this. >>>>> >>>>> John Mitsch >>>>> Red Hat Engineering >>>>> (860)-967-7285 >>>>> irc: jomitsch >>>>> >>>>> On Mon, Feb 22, 2016 at 4:59 PM, Nathan Peters >>>>> wrote: >>>>> >>>>>> This isn't possible because I had to "skip" on of the steps in the >>>>>> task to get it to complete (before I knew about the code fix necessary) so >>>>>> it is now at 100% and stopped. >>>>>> >>>>>> Any other options to fix this since I cannot resume a task at 100%? >>>>>> >>>>>> >>>>>> On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote: >>>>>>> >>>>>>> Nathan, >>>>>>> >>>>>>> Glad to hear that got rid of the first error. The test files are >>>>>>> just for development purposes, so afaik it would be normal not to see them, >>>>>>> and they wouldn't require any changes from you. >>>>>>> >>>>>>> Do you still see the original dynflow task where you tried to delete >>>>>>> the activation key? If so, your best course of action would be to try to >>>>>>> resume that task. >>>>>>> >>>>>>> -John >>>>>>> >>>>>>> On 02/19/2016 04:44 PM, Nathan Peters wrote: >>>>>>> >>>>>>> I followed the link to that fix from github and updated the file on >>>>>>> line 22 >>>>>>> /opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb >>>>>>> >>>>>>> I noticed that in that git commit, there were changes to a 2nd file, >>>>>>> activation_keys_controller_test.rb. I noticed that file (along with the >>>>>>> test directory referenced) does not exist on my system. >>>>>>> >>>>>>> After making the updates to the file that does exist on my system, I >>>>>>> still cannot get rid of the phantom key, but this time the error message is >>>>>>> different. >>>>>>> >>>>>>> Listing keys still shows the error about the phantom key, but the >>>>>>> delete command now gives a different error "key not found" as opposed to >>>>>>> the old message about inverse key pools. >>>>>>> >>>>>>> So the change worked... kind of. It got rid of one error, but I am >>>>>>> still blocked on this new error. >>>>>>> >>>>>>> >>>>>>> [root@katello1 /]# hammer activation-key list --organization "My Org" >>>>>>> [Foreman] Password for admin: >>>>>>> Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found >>>>>>> {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 >>>>>>> could not be found.","requestUuid":"afd0477b-8e78-446f-8c98-631121508836"} >>>>>>> (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) >>>>>>> [root@katello1 /]# hammer activation-key delete --organization "My >>>>>>> Org" --id 8a3280ee51ac0a000151aeafb68201a6 >>>>>>> [Foreman] Password for admin: >>>>>>> Could not delete the activation key: >>>>>>> Couldn't find Katello::ActivationKey with >>>>>>> id=8a3280ee51ac0a000151aeafb68201a6 >>>>>>> [root@katello /]# hammer activation-key list --organization "My Org" >>>>>>> [Foreman] Password for admin: >>>>>>> Katello::Resources::Candlepin::ActivationKey: 404 Resource Not Found >>>>>>> {"displayMessage":"ActivationKey with id 8a3280ee51ac0a000151aeafb68201a6 >>>>>>> could not be found.","requestUuid":"ba00aedf-32bf-4109-b382-3b874ce36b8a"} >>>>>>> (GET /candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6) >>>>>>> >>>>>>> >>>>>>> On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch >>>>>>> wrote: >>>>>>>> >>>>>>>> Nathan, >>>>>>>> >>>>>>>> That is a known bug that is fixed upstream and will be released in >>>>>>>> 2.4.1. Its a small change to fix it, are you able to make this change[1] >>>>>>>> here in app/models/katello/activation_key.rb? :inverse_of => >>>>>>>> :activation_keys shoud be :inverse_of => :activation_key Hope that helps, >>>>>>>> let me know if you have any questions or are unable to make the change in >>>>>>>> the code. >>>>>>>> >>>>>>>> 1. >>>>>>>> https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22 >>>>>>>> >>>>>>>> -John >>>>>>>> >>>>>>>> On 02/18/2016 08:32 PM, Nathan Peters wrote: >>>>>>>> >>>>>>>> The specific error when I tried to delete the key was : >>>>>>>> >>>>>>>> Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> On Katello 2.4 I was trying to delete an activation key that had >>>>>>>>> no clients attached to it and wasn't in use anymore. >>>>>>>>> >>>>>>>>> The delete failed and I could not resume the task. The only >>>>>>>>> option to get it to 'finish' was going into the dynflow console and >>>>>>>>> skipping the 'destroy' step. >>>>>>>>> >>>>>>>>> Now the task is 100% complete in state 'stopped' error >>>>>>>>> >>>>>>>>> When I go to the activation keys menu and try to load the page it >>>>>>>>> never loads now. It just sits there with the spinning wheel that says >>>>>>>>> 'Loading...' >>>>>>>>> >>>>>>>>> I have restarted the service already. >>>>>>>>> >>>>>>>>> Please help. I don't know how to get this page to load now. >>>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "Foreman users" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to foreman-user...@googlegroups.com. >>>>>>>> To post to this group, send email to forema...@googlegroups.com. >>>>>>>> Visit this group at https://groups.google.com/group/foreman-users. >>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> John Mitsch >>>>>>>> Red Hat Engineering860-967-7285 >>>>>>>> irc: jomitsch >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Foreman users" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to foreman-user...@googlegroups.com. >>>>>>> To post to this group, send email to forema...@googlegroups.com. >>>>>>> Visit this group at https://groups.google.com/group/foreman-users. >>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> John Mitsch >>>>>>> Red Hat Engineering860-967-7285 >>>>>>> irc: jomitsch >>>>>>> >>>>>>> >>>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Foreman users" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to foreman-user...@googlegroups.com. >>>>>> To post to this group, send email to forema...@googlegroups.com. >>>>>> Visit this group at https://groups.google.com/group/foreman-users. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Foreman users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to foreman-user...@googlegroups.com. >>>> To post to this group, send email to forema...@googlegroups.com. >>>> Visit this group at https://groups.google.com/group/foreman-users. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

Glad to hear it. Post back if you see any related issues as things may be
leftover from that incomplete task.

-John

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

··· On Wed, Feb 24, 2016 at 1:48 PM, Nathan Peters wrote:

It appears to have worked. It ran the following SQL and then I was once
again able to view my list of keys.

Thank you!

Katello::ActivationKey Load (1.9ms) SELECT “katello_activation_keys”.*
FROM “katello_activation_keys” WHERE “katello_activation_keys”.“id” = $1
LIMIT 1 [[“id”, 4]]
(0.1ms) BEGIN
Katello::KeyHostCollection Load (2.7ms) SELECT
"katello_key_host_collections".* FROM “katello_key_host_collections” WHERE
"katello_key_host_collections".“activation_key_id” = 4
SQL (0.6ms) DELETE FROM “katello_key_host_collections” WHERE
"katello_key_host_collections".“id” = $1 [[“id”, 1]]
Katello::SystemActivationKey Load (1.6ms) SELECT
"katello_system_activation_keys".* FROM “katello_system_activation_keys"
WHERE “katello_system_activation_keys”.“activation_key_id” = 4
Katello::PoolActivationKey Load (2.3ms) SELECT
"katello_pool_activation_keys”.* FROM “katello_pool_activation_keys” WHERE
"katello_pool_activation_keys".“activation_key_id” = 4
SQL (1.2ms) DELETE FROM “katello_pool_activation_keys” WHERE
"katello_pool_activation_keys".“id” = $1 [[“id”, 5]]
SQL (1.8ms) DELETE FROM “katello_activation_keys” WHERE
"katello_activation_keys".“id” = $1 [[“id”, 4]]
(0.9ms) COMMIT

On Wednesday, February 24, 2016 at 5:00:04 AM UTC-8, John Mitsch wrote:

Nathan,

You are going to want to specify console after foreman-rake. Its a
separate console that brings up the foreman/katello rails environment. Here
is an example to better understand

[root@katello1 ~]# foreman-rake console

then the prompt for the console should appear and that is when you can
enter

Katello::ActivationKey.find(4).destroy!

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Tue, Feb 23, 2016 at 6:06 PM, Nathan Peters nathanp...@gmail.com >> wrote:

Maybe I’m not understanding how this thing works but foreman-rake --help
and “man foreman-rake” both seemed pretty useless.

[root@katello1 ~]# foreman-rake -e
"Katello::ActivationKey.find(4).destroy!"
-bash: !": event not found
[root@katello1 ~]# foreman-rake -e
"Katello::ActivationKey.find(4).destroy"
rake aborted!
uninitialized constant Rake::Application::Katello

(See full trace by running task with --trace)
[root@katello1 ~]# foreman-rake "Katello::ActivationKey.find(4).destroy"
rake aborted!
Don’t know how to build task ‘Katello::ActivationKey.find(4).destroy’

(See full trace by running task with --trace)
[root@katello1 ~]# foreman-rake
"Katello::ActivationKey.find(4).destroy!"
-bash: !": event not found
[root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy
-bash: syntax error near unexpected token (' [root@katello1 ~]# foreman-rake Katello::ActivationKey.find(4).destroy! -bash: syntax error near unexpected token(’

On Tuesday, February 23, 2016 at 2:56:33 PM UTC-8, John Mitsch wrote:

Nathan,

My apologies for not being specific, if you run foreman-rake console
that will give you access to the rails console for where you can run the
command I gave you.

-John

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Tue, Feb 23, 2016 at 5:37 PM, Nathan Peters nathanp...@gmail.com >>>> wrote:

I was able to find the tasks and get the activation key IDs.

But, which console are you referring to?

There is no place in the dynflow console in the katello website where
I can manually enter any commands. That console is only for monitoring and
stopping and resuming commands that the system created itself somehow.
There is no “run this command” box or anything.

Also, that command you gave is definitely not a command line command
as it is invalid bash syntax.

On Monday, February 22, 2016 at 2:55:23 PM UTC-8, John Mitsch wrote:

Nathan,

Can you get the Activation Key id from the dynflow task? It will be
in the input and won’t be a string like the
8a3280ee51ac0a000151aeafb68201a6 you saw before (that is the id in
candlepin) but rather an integer. Once you have that you can run

Katello::ActivationKey.find(ID).destroy!

from the console. Because some of the steps were skipped, It makes it
a bit harder to delete and there may be some errors that we will have to
fix and patch up, but unfortunately this is the only option I know of for a
situation like this.

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Mon, Feb 22, 2016 at 4:59 PM, Nathan Peters nathanp...@gmail.com >>>>>> wrote:

This isn’t possible because I had to “skip” on of the steps in the
task to get it to complete (before I knew about the code fix necessary) so
it is now at 100% and stopped.

Any other options to fix this since I cannot resume a task at 100%?

On Monday, February 22, 2016 at 5:42:17 AM UTC-8, John Mitsch wrote:

Nathan,

Glad to hear that got rid of the first error. The test files are
just for development purposes, so afaik it would be normal not to see them,
and they wouldn’t require any changes from you.

Do you still see the original dynflow task where you tried to
delete the activation key? If so, your best course of action would be to
try to resume that task.

-John

On 02/19/2016 04:44 PM, Nathan Peters wrote:

I followed the link to that fix from github and updated the file on
line 22
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-2.4.0/app/models/katello/activation_key.rb

I noticed that in that git commit, there were changes to a 2nd
file, activation_keys_controller_test.rb. I noticed that file (along with
the test directory referenced) does not exist on my system.

After making the updates to the file that does exist on my system,
I still cannot get rid of the phantom key, but this time the error message
is different.

Listing keys still shows the error about the phantom key, but the
delete command now gives a different error “key not found” as opposed to
the old message about inverse key pools.

So the change worked… kind of. It got rid of one error, but I am
still blocked on this new error.

[root@katello1 /]# hammer activation-key list --organization “My
Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not
Found {“displayMessage”:“ActivationKey with id
8a3280ee51ac0a000151aeafb68201a6 could not be
found.”,“requestUuid”:“afd0477b-8e78-446f-8c98-631121508836”} (GET
/candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)
[root@katello1 /]# hammer activation-key delete --organization “My
Org” --id 8a3280ee51ac0a000151aeafb68201a6
[Foreman] Password for admin:
Could not delete the activation key:
Couldn’t find Katello::ActivationKey with
id=8a3280ee51ac0a000151aeafb68201a6
[root@katello /]# hammer activation-key list --organization “My
Org”
[Foreman] Password for admin:
Katello::Resources::Candlepin::ActivationKey: 404 Resource Not
Found {“displayMessage”:“ActivationKey with id
8a3280ee51ac0a000151aeafb68201a6 could not be
found.”,“requestUuid”:“ba00aedf-32bf-4109-b382-3b874ce36b8a”} (GET
/candlepin/activation_keys/8a3280ee51ac0a000151aeafb68201a6)

On Friday, February 19, 2016 at 11:16:19 AM UTC-8, John Mitsch >>>>>>>> wrote:

Nathan,

That is a known bug that is fixed upstream and will be released in
2.4.1. Its a small change to fix it, are you able to make this change[1]
here in app/models/katello/activation_key.rb? :inverse_of =>
:activation_keys shoud be :inverse_of => :activation_key Hope that helps,
let me know if you have any questions or are unable to make the change in
the code.

https://github.com/Katello/katello/pull/5689/files#diff-cd7b4776d8397db5195dd814e05744bbR22

-John

On 02/18/2016 08:32 PM, Nathan Peters wrote:

The specific error when I tried to delete the key was :

Could not find the inverse association for pool_activation_keys (:activation_keys in Katello::PoolActivationKey)

On Thursday, February 18, 2016 at 5:31:23 PM UTC-8, Nathan Peters >>>>>>>>> wrote:

On Katello 2.4 I was trying to delete an activation key that had
no clients attached to it and wasn’t in use anymore.

The delete failed and I could not resume the task. The only
option to get it to ‘finish’ was going into the dynflow console and
skipping the ‘destroy’ step.

Now the task is 100% complete in state ‘stopped’ error

When I go to the activation keys menu and try to load the page it
never loads now. It just sits there with the spinning wheel that says
’Loading…’

I have restarted the service already.

Please help. I don’t know how to get this page to load now.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


John Mitsch
Red Hat Engineering860-967-7285
irc: jomitsch


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.