Skip to main content
Solved

Cannot cancel Snapshot restore action. Force suspend possible ?


Hello,

 

I started a snapshot restore that doesn’t complete nor fail within few minutes.

I’ve tried to cancel it using “Cancel Action” button but the job continue running (not completing nor failling).

 

In the logs container, I’ve seen the following informations:

“Internal error occurred: {"message":"Failed to get jobs for manifest"}”

“Null action details returned to ActionCard for kasten-10-*****”

“Failed to get details for the Action”

 

Is it possible to force kill the job in some way to making it fail?

 

Thank you for your answer !

Best answer by FRubens

Hello @KastenJohn

Thank you for using our community and K10!

There is a way to cancel a K10 action from CLI (runaction, backupaction, restoreaction..), you must create a cancel action, you can find more details in our documentation.

https://docs.kasten.io/latest/api/actions.html?highlight=cancel%20action#cancelaction-api-type

I will describe how to do it and also how to check in more details about your restore action.

First check if the restore action is still running: (It can be also done for backup actions)

kubectl get restoreactions -A -o custom-columns=ACTION:.kind,NAMESPACE:.metadata.namespace,NAME:.metadata.name,'CREATED AT':.metadata.creationTimestamp,STATUS:.status.state,POLICY:.metadata.labels."k10\.kasten\.io\/policyName"

ACTION          NAMESPACE   NAME           CREATED AT             STATUS    POLICY
RestoreAction   test22      test22-6nr5v   2022-10-11T14:33:49Z   Running   <none>

Describe the restore action, it can help you identify what is happening:

#This case using the restore action from the command above:

kubectl describe restoreactions test22-6nr5v -n test22

...
  Exceptions:
    Cause:    {"errors":[{"cause":{"cause":{"cause":{"fields":[{"name":"pod","value":"kopia-debug"}],"file":"kasten.io/k10/kio/exec/phases/phase/kanister.go:855","function":"kasten.io/k10/kio/exec/phases/phase.waitForWorkloadReady","linenumber":855,"message":"Pod not in ready state"},"fields":[
....

With the name and namespace you can create a cancel action using the command bellow:

#Using restore action name "test22-6nr5v" and namespace "test22", please replace with your values

cat <<EOF | kubectl create -f -
apiVersion: actions.kio.kasten.io/v1alpha1
kind: CancelAction
metadata:
  name: cancel-action
  generateName: cancel-action-
  namespace: test22
spec:
  subject:
    kind: RestoreAction
    name: test22-6nr5v
    namespace: test22
EOF

cancelaction.actions.kio.kasten.io/cancel-action created

After that you can monitor using CLI checking the restore actions again or through K10 dashboard, but please keep in mind the cancel action can take some time depending in which kind of action is being performed, this same process can be used for BackupActions.

 

Please let us know if you have any other questions.

Fernando R.

View original
Did this topic help you find an answer to your question?

2 comments

Madi.Cristil
Forum|alt.badge.img+8
  • Community Manager
  • 617 comments
  • October 10, 2022

FRubens
Forum|alt.badge.img+2
  • Experienced User
  • 96 comments
  • Answer
  • October 11, 2022

Hello @KastenJohn

Thank you for using our community and K10!

There is a way to cancel a K10 action from CLI (runaction, backupaction, restoreaction..), you must create a cancel action, you can find more details in our documentation.

https://docs.kasten.io/latest/api/actions.html?highlight=cancel%20action#cancelaction-api-type

I will describe how to do it and also how to check in more details about your restore action.

First check if the restore action is still running: (It can be also done for backup actions)

kubectl get restoreactions -A -o custom-columns=ACTION:.kind,NAMESPACE:.metadata.namespace,NAME:.metadata.name,'CREATED AT':.metadata.creationTimestamp,STATUS:.status.state,POLICY:.metadata.labels."k10\.kasten\.io\/policyName"

ACTION          NAMESPACE   NAME           CREATED AT             STATUS    POLICY
RestoreAction   test22      test22-6nr5v   2022-10-11T14:33:49Z   Running   <none>

Describe the restore action, it can help you identify what is happening:

#This case using the restore action from the command above:

kubectl describe restoreactions test22-6nr5v -n test22

...
  Exceptions:
    Cause:    {"errors":[{"cause":{"cause":{"cause":{"fields":[{"name":"pod","value":"kopia-debug"}],"file":"kasten.io/k10/kio/exec/phases/phase/kanister.go:855","function":"kasten.io/k10/kio/exec/phases/phase.waitForWorkloadReady","linenumber":855,"message":"Pod not in ready state"},"fields":[
....

With the name and namespace you can create a cancel action using the command bellow:

#Using restore action name "test22-6nr5v" and namespace "test22", please replace with your values

cat <<EOF | kubectl create -f -
apiVersion: actions.kio.kasten.io/v1alpha1
kind: CancelAction
metadata:
  name: cancel-action
  generateName: cancel-action-
  namespace: test22
spec:
  subject:
    kind: RestoreAction
    name: test22-6nr5v
    namespace: test22
EOF

cancelaction.actions.kio.kasten.io/cancel-action created

After that you can monitor using CLI checking the restore actions again or through K10 dashboard, but please keep in mind the cancel action can take some time depending in which kind of action is being performed, this same process can be used for BackupActions.

 

Please let us know if you have any other questions.

Fernando R.