Bug 1640704

Summary: Unexpected error encountered when trying to cancel SSA scan task
Product: Red Hat CloudForms Management Engine Reporter: juwatts
Component: ApplianceAssignee: Yuri Rudman <yrudman>
Status: CLOSED CURRENTRELEASE QA Contact: juwatts
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.9.5CC: abellott, hsong, jprause, juwatts, lavenel, mfeifer, obarenbo, roliveri, simaishi
Target Milestone: GAKeywords: Regression, TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1645198 (view as bug list) Environment:
Last Closed: 2019-02-12 16:52:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1645198    

Description juwatts 2018-10-18 14:44:00 UTC
Description of problem:
When trying to cancel a SSA task, received the following error:

Unexpected error encountered

Errors in Management Engine can be caused by:

① Accessing Management Engine from multiple tabs or windows of the same browser on a single machine. Close any duplicate browser sessions, then select an option from the menu.
② Pressing the back button during a session. 
      Close any duplicate browser sessions, then select an option from the menu.
③ An internal system error. 
      Please contact your administrator for assistance.


Error text:

finish is not permitted at state waiting_to_scan [miq_task/button]


Version-Release number of selected component (if applicable):
5.9.5.2.20181015201954_5f1530c

How reproducible:
Always

Steps to Reproduce:
1. Start a smart state analysis scan on a container image
2. Navigate to Administrator->Tasks->All->Tasks
3. When the state is in "Waiting To Scan", select the task and click "Cancel Job"

Actual results:
Unexpected error encountered page displayed

Expected results:
Task is cancelled


Additional info:
I configured the image inspector to pull from registry.reg-aws.openshift.com:443 which resulted in a failed image pull

Comment 5 Rich Oliveri 2018-10-24 21:13:59 UTC
Right, the container team should handle this.

Comment 16 CFME Bot 2018-10-30 21:46:48 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/16ff62f74906a6736f12e47dddaf627817f36570
commit 16ff62f74906a6736f12e47dddaf627817f36570
Author:     Yuri Rudman <yrudman>
AuthorDate: Tue Oct 30 15:36:40 2018 -0400
Commit:     Yuri Rudman <yrudman>
CommitDate: Tue Oct 30 15:36:40 2018 -0400

    rescue error when not permitted signal sent. This bug introduced in https://github.com/ManageIQ/manageiq-ui-classic/pull/242
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1640704

 app/controllers/miq_task_controller.rb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comment 19 CFME Bot 2018-11-02 14:14:37 UTC
New commit detected on ManageIQ/manageiq-ui-classic/hammer:

https://github.com/ManageIQ/manageiq-ui-classic/commit/5646ad4c759846ce4f718d5b384d71bf5d85bd50
commit 5646ad4c759846ce4f718d5b384d71bf5d85bd50
Author:     Harpreet Kataria <hkataria>
AuthorDate: Tue Oct 30 17:44:07 2018 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Tue Oct 30 17:44:07 2018 -0400

    Merge pull request #4855 from yrudman/rescue-error-when-canceling-job

    Rescue error when canceling job

    (cherry picked from commit bccb10ed9becf2322955ac99de0490c518a2bda8)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1640704

 app/controllers/miq_task_controller.rb | 6 +-
 spec/controllers/miq_task_controller_spec.rb | 16 +
 2 files changed, 21 insertions(+), 1 deletion(-)

Comment 20 CFME Bot 2018-11-02 14:15:37 UTC
New commit detected on ManageIQ/manageiq-ui-classic/hammer:

https://github.com/ManageIQ/manageiq-ui-classic/commit/5646ad4c759846ce4f718d5b384d71bf5d85bd50
commit 5646ad4c759846ce4f718d5b384d71bf5d85bd50
Author:     Harpreet Kataria <hkataria>
AuthorDate: Tue Oct 30 17:44:07 2018 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Tue Oct 30 17:44:07 2018 -0400

    Merge pull request #4855 from yrudman/rescue-error-when-canceling-job

    Rescue error when canceling job

    (cherry picked from commit bccb10ed9becf2322955ac99de0490c518a2bda8)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1640704

 app/controllers/miq_task_controller.rb | 6 +-
 spec/controllers/miq_task_controller_spec.rb | 16 +
 2 files changed, 21 insertions(+), 1 deletion(-)

Comment 21 juwatts 2018-11-07 20:42:32 UTC
Verified in 5.10.0.23.20181106165157_92dd189

Steps to Reproduce:
1. Started a smart state analysis scan on a container image
2. Navigated to Administrator->Tasks->All->Tasks
3. When the state is in "Waiting To Scan", select the task and click "Cancel Job"
4. Verified the following error displayed: finish is not permitted at state waiting_to_scan

Comment 22 Yuri Rudman 2018-11-09 15:23:46 UTC
PR which is fixing issue with scanning job and allow to cancel (instead of raising error "finish is not permitted at state waiting_to_scan") was merged on master: 
 https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/299

Comment 23 CFME Bot 2018-11-19 18:02:25 UTC
New commit detected on ManageIQ/manageiq-providers-kubernetes/hammer:

https://github.com/ManageIQ/manageiq-providers-kubernetes/commit/38207909649af0ff3f672932976a08f0df759aeb
commit 38207909649af0ff3f672932976a08f0df759aeb
Author:     Adam Grare <agrare>
AuthorDate: Thu Nov  8 14:17:12 2018 -0500
Commit:     Adam Grare <agrare>
CommitDate: Thu Nov  8 14:17:12 2018 -0500

    Merge pull request #299 from yrudman/override-process_cancel

    Override Job#process_cancel to send :cancel signal

    (cherry picked from commit a80386e1a47e1374d4b28ec08bf0e92d5d2dbbe3)

    https://bugzilla.redhat.com/show_bug.cgi?id=1640704

 app/models/manageiq/providers/kubernetes/container_manager/scanning/job.rb | 27 +-
 1 file changed, 18 insertions(+), 9 deletions(-)

Comment 24 juwatts 2018-11-29 19:37:38 UTC
Verified in 5.10.0.27.20181128170555_43ed8cb

Steps to Reproduce:
1. Started a smart state analysis scan on a container image
2. Navigated to Administrator->Tasks->All->Tasks
3. When the state is in "Waiting To Scan", select the task and clicked "Cancel Job"
4. Verified the following error displayed: The selected Task was cancelled
5. Restarted the scan and waited for it to finish
6. Selected the task and clicked "Cancel Job"
7. Verified the following error displayed: Finished Task cannot be cancelled