How to clear locked dynflow tasks?

In working on testing users and roles, I managed to dynflow block all the users on my server. The dynflow console, even if I wanted to click through several hundred locked tasks, does not have a way to unlock these tasks.

28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update planned pending 2014-05-17 08:27:32 -0400

Clicking through the Show link has a blank page for "Run" so there is nothing to skip or resume.

How do I unlock my server? The only hammer command I see is to check progress (perpetually at 0%).

Suggestions?

··· -- @thomasmckay


“The leader must aim high, see big, judge widely, thus setting himself apart form the ordinary people who debate in narrow confines.” ~ Charles De Gaulle

“Leadership is about making others better as a result of your presence and making sure that impact lasts in your absence.” ~ Harvard Business School

Do you think this is a DB deadlock?

– bk

··· On 05/17/2014 08:45 AM, Tom McKay wrote: > > In working on testing users and roles, I managed to dynflow block all the users on my server. The dynflow console, even if I wanted to click through several hundred locked tasks, does not have a way to unlock these tasks. > > 28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update planned pending 2014-05-17 08:27:32 -0400 > > Clicking through the Show link has a blank page for "Run" so there is nothing to skip or resume. > > How do I unlock my server? The only hammer command I see is to check progress (perpetually at 0%). > > Suggestions? > >

I've gotten back into servers in this state by clearing all the
entries from the foreman_tasks_tasks and foreman_tasks_locks tables in
the database when the server is stopped and then restarting it.

su -s /sbin/bash - postgres
psql
\c foreman;
delete from foreman_tasks_tasks;
delete from foreman_tasks_locks;
\q
exit

You could probably at least be less heavy handed by deleting just the
offending entries. That said I don't know if this is a really bad idea
either way or if there is actually a better way around it.

··· On Sat, May 17, 2014 at 2:26 PM, Bryan Kearney wrote: > On 05/17/2014 08:45 AM, Tom McKay wrote: >> >> >> In working on testing users and roles, I managed to dynflow block all the >> users on my server. The dynflow console, even if I wanted to click through >> several hundred locked tasks, does not have a way to unlock these tasks. >> >> 28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update >> planned pending 2014-05-17 08:27:32 -0400 >> >> Clicking through the Show link has a blank page for "Run" so there is >> nothing to skip or resume. >> >> How do I unlock my server? The only hammer command I see is to check >> progress (perpetually at 0%). >> >> Suggestions? >> >> > Do you think this is a DB deadlock? > > -- bk > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.

Perfect!

katello=# delete from foreman_tasks_tasks;
DELETE 1812
katello=# delete from foreman_tasks_locks;
DELETE 5574

··· ----- Original Message ----- > I've gotten back into servers in this state by clearing all the > entries from the foreman_tasks_tasks and foreman_tasks_locks tables in > the database when the server is stopped and then restarting it. > > su -s /sbin/bash - postgres > psql > \c foreman; > delete from foreman_tasks_tasks; > delete from foreman_tasks_locks; > \q > exit > > You could probably at least be less heavy handed by deleting just the > offending entries. That said I don't know if this is a really bad idea > either way or if there is actually a better way around it. > > On Sat, May 17, 2014 at 2:26 PM, Bryan Kearney > wrote: > > On 05/17/2014 08:45 AM, Tom McKay wrote: > >> > >> > >> In working on testing users and roles, I managed to dynflow block all the > >> users on my server. The dynflow console, even if I wanted to click through > >> several hundred locked tasks, does not have a way to unlock these tasks. > >> > >> 28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update > >> planned pending 2014-05-17 08:27:32 -0400 > >> > >> Clicking through the Show link has a blank page for "Run" so there is > >> nothing to skip or resume. > >> > >> How do I unlock my server? The only hammer command I see is to check > >> progress (perpetually at 0%). > >> > >> Suggestions? > >> > >> > > Do you think this is a DB deadlock? > > > > -- bk > > > > -- > > You received this message because you are subscribed to the Google Groups > > "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to foreman-dev+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

In case anyone out there was wondering, this still works and is still very
much helpful. With the current versions of foreman 1.10.3 & katello 2.4.

My daily syncs and content views had come to a standstill due to locked
tasks I couldn't cancel.

Thank you!

··· On Saturday, May 17, 2014 at 2:43:09 PM UTC-4, Jason Montleon wrote: > > I've gotten back into servers in this state by clearing all the > entries from the foreman_tasks_tasks and foreman_tasks_locks tables in > the database when the server is stopped and then restarting it. > > su -s /sbin/bash - postgres > psql > \c foreman; > delete from foreman_tasks_tasks; > delete from foreman_tasks_locks; > \q > exit > > You could probably at least be less heavy handed by deleting just the > offending entries. That said I don't know if this is a really bad idea > either way or if there is actually a better way around it. > > On Sat, May 17, 2014 at 2:26 PM, Bryan Kearney > wrote: > > On 05/17/2014 08:45 AM, Tom McKay wrote: > >> > >> > >> In working on testing users and roles, I managed to dynflow block all > the > >> users on my server. The dynflow console, even if I wanted to click > through > >> several hundred locked tasks, does not have a way to unlock these > tasks. > >> > >> 28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update > >> planned pending 2014-05-17 08:27:32 -0400 > >> > >> Clicking through the Show link has a blank page for "Run" so there is > >> nothing to skip or resume. > >> > >> How do I unlock my server? The only hammer command I see is to check > >> progress (perpetually at 0%). > >> > >> Suggestions? > >> > >> > > Do you think this is a DB deadlock? > > > > -- bk > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to foreman-dev...@googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. >

I assume we need a cli for this?

– bk

··· Sent with thumbs

On May 17, 2014, at 2:50 PM, Tom McKay thomasmckay@redhat.com wrote:

----- Original Message -----

I’ve gotten back into servers in this state by clearing all the
entries from the foreman_tasks_tasks and foreman_tasks_locks tables in
the database when the server is stopped and then restarting it.

su -s /sbin/bash - postgres
psql
\c foreman;
delete from foreman_tasks_tasks;
delete from foreman_tasks_locks;
\q
exit

You could probably at least be less heavy handed by deleting just the
offending entries. That said I don’t know if this is a really bad idea
either way or if there is actually a better way around it.

On Sat, May 17, 2014 at 2:26 PM, Bryan Kearney bryan.kearney@gmail.com >> wrote:

On 05/17/2014 08:45 AM, Tom McKay wrote:

In working on testing users and roles, I managed to dynflow block all the
users on my server. The dynflow console, even if I wanted to click through
several hundred locked tasks, does not have a way to unlock these tasks.

28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update
planned pending 2014-05-17 08:27:32 -0400

Clicking through the Show link has a blank page for “Run” so there is
nothing to skip or resume.

How do I unlock my server? The only hammer command I see is to check
progress (perpetually at 0%).

Suggestions?
Do you think this is a DB deadlock?

– bk


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


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

Perfect!

katello=# delete from foreman_tasks_tasks;
DELETE 1812
katello=# delete from foreman_tasks_locks;
DELETE 5574


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

Yes, please consider this a +1 for this functionality being included in the
UI or CLI. Saved me today!

Thanks,
Taylor

··· On Friday, April 22, 2016 at 8:26:35 AM UTC-4, Tatenda Mupaso wrote: > > In case anyone out there was wondering, this still works and is still very > much helpful. With the current versions of foreman 1.10.3 & katello 2.4. > > My daily syncs and content views had come to a standstill due to locked > tasks I couldn't cancel. > > Thank you! > > On Saturday, May 17, 2014 at 2:43:09 PM UTC-4, Jason Montleon wrote: >> >> I've gotten back into servers in this state by clearing all the >> entries from the foreman_tasks_tasks and foreman_tasks_locks tables in >> the database when the server is stopped and then restarting it. >> >> su -s /sbin/bash - postgres >> psql >> \c foreman; >> delete from foreman_tasks_tasks; >> delete from foreman_tasks_locks; >> \q >> exit >> >> You could probably at least be less heavy handed by deleting just the >> offending entries. That said I don't know if this is a really bad idea >> either way or if there is actually a better way around it. >> >> On Sat, May 17, 2014 at 2:26 PM, Bryan Kearney >> wrote: >> > On 05/17/2014 08:45 AM, Tom McKay wrote: >> >> >> >> >> >> In working on testing users and roles, I managed to dynflow block all >> the >> >> users on my server. The dynflow console, even if I wanted to click >> through >> >> several hundred locked tasks, does not have a way to unlock these >> tasks. >> >> >> >> 28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update >> >> planned pending 2014-05-17 08:27:32 -0400 >> >> >> >> Clicking through the Show link has a blank page for "Run" so there is >> >> nothing to skip or resume. >> >> >> >> How do I unlock my server? The only hammer command I see is to check >> >> progress (perpetually at 0%). >> >> >> >> Suggestions? >> >> >> >> >> > Do you think this is a DB deadlock? >> > >> > -- bk >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "foreman-dev" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to foreman-dev...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. >> >

The locking is not implemented in Dynflow directly, but if foreman-tasks.

You might be interested in this one https://github.com/theforeman/foreman-tasks/pull/52.
There is the answer on how to unlock the tasks, as well as other useful commands (as resuming
paused task), from the details of the tasks (get to there from Monitoring -> Tasks).

– Ivan

··· ----- Original Message ----- > I assume we need a cli for this? > > -- bk > Sent with thumbs > > > On May 17, 2014, at 2:50 PM, Tom McKay wrote: > > > > > > > > ----- Original Message ----- > >> I've gotten back into servers in this state by clearing all the > >> entries from the foreman_tasks_tasks and foreman_tasks_locks tables in > >> the database when the server is stopped and then restarting it. > >> > >> su -s /sbin/bash - postgres > >> psql > >> \c foreman; > >> delete from foreman_tasks_tasks; > >> delete from foreman_tasks_locks; > >> \q > >> exit > >> > >> You could probably at least be less heavy handed by deleting just the > >> offending entries. That said I don't know if this is a really bad idea > >> either way or if there is actually a better way around it. > >> > >> On Sat, May 17, 2014 at 2:26 PM, Bryan Kearney > >> wrote: > >>> On 05/17/2014 08:45 AM, Tom McKay wrote: > >>>> > >>>> > >>>> In working on testing users and roles, I managed to dynflow block all > >>>> the > >>>> users on my server. The dynflow console, even if I wanted to click > >>>> through > >>>> several hundred locked tasks, does not have a way to unlock these tasks. > >>>> > >>>> 28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update > >>>> planned pending 2014-05-17 08:27:32 -0400 > >>>> > >>>> Clicking through the Show link has a blank page for "Run" so there is > >>>> nothing to skip or resume. > >>>> > >>>> How do I unlock my server? The only hammer command I see is to check > >>>> progress (perpetually at 0%). > >>>> > >>>> Suggestions? > >>> Do you think this is a DB deadlock? > >>> > >>> -- bk > >>> > >>> -- > >>> You received this message because you are subscribed to the Google Groups > >>> "foreman-dev" group. > >>> To unsubscribe from this group and stop receiving emails from it, send an > >>> email to foreman-dev+unsubscribe@googlegroups.com. > >>> For more options, visit https://groups.google.com/d/optout. > >> > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "foreman-dev" group. > >> To unsubscribe from this group and stop receiving emails from it, send an > >> email to foreman-dev+unsubscribe@googlegroups.com. > >> For more options, visit https://groups.google.com/d/optout. > > > > Perfect! > > > > katello=# delete from foreman_tasks_tasks; > > DELETE 1812 > > katello=# delete from foreman_tasks_locks; > > DELETE 5574 > > > > -- > > You received this message because you are subscribed to the Google Groups > > "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to foreman-dev+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

> The locking is not implemented in Dynflow directly, but if foreman-tasks.
>
> You might be interested in this one
> https://github.com/theforeman/foreman-tasks/pull/52.
> There is the answer on how to unlock the tasks, as well as other useful
> commands (as resuming
> paused task), from the details of the tasks (get to there from Monitoring ->
> Tasks).

A little explanation on the foreman-tasks locks: the task is locking the
resource just when it's in not-stopped state. We keep the locks info
there at the end, as they provide nice auditing information (as
the lock is association between task and a resource).

– Ivan

··· ----- Original Message -----

– Ivan

----- Original Message -----

I assume we need a cli for this?

– bk
Sent with thumbs

On May 17, 2014, at 2:50 PM, Tom McKay thomasmckay@redhat.com wrote:

----- Original Message -----

I’ve gotten back into servers in this state by clearing all the
entries from the foreman_tasks_tasks and foreman_tasks_locks tables in
the database when the server is stopped and then restarting it.

su -s /sbin/bash - postgres
psql
\c foreman;
delete from foreman_tasks_tasks;
delete from foreman_tasks_locks;
\q
exit

You could probably at least be less heavy handed by deleting just the
offending entries. That said I don’t know if this is a really bad idea
either way or if there is actually a better way around it.

On Sat, May 17, 2014 at 2:26 PM, Bryan Kearney bryan.kearney@gmail.com > > >> wrote:

On 05/17/2014 08:45 AM, Tom McKay wrote:

In working on testing users and roles, I managed to dynflow block all
the
users on my server. The dynflow console, even if I wanted to click
through
several hundred locked tasks, does not have a way to unlock these
tasks.

28d3f48f-822b-4cb7-8ff2-33486bc25df2 Actions::Katello::User::Update
planned pending 2014-05-17 08:27:32 -0400

Clicking through the Show link has a blank page for “Run” so there is
nothing to skip or resume.

How do I unlock my server? The only hammer command I see is to check
progress (perpetually at 0%).

Suggestions?
Do you think this is a DB deadlock?

– bk


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


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

Perfect!

katello=# delete from foreman_tasks_tasks;
DELETE 1812
katello=# delete from foreman_tasks_locks;
DELETE 5574


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


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


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