Bug 1858182 - The Compliance-Operator pod crashes at compliancescan.getPVCForScan()
Summary: The Compliance-Operator pod crashes at compliancescan.getPVCForScan()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Compliance Operator
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.6.0
Assignee: Jakub Hrozek
QA Contact: Prashant Dhamdhere
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-17 06:53 UTC by Prashant Dhamdhere
Modified: 2020-10-27 16:16 UTC (History)
4 users (show)

Fixed In Version: v0.1.11
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 16:15:30 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:16:01 UTC

Description Prashant Dhamdhere 2020-07-17 06:53:11 UTC
Description of problem:

The Compliance-Operator pod crashes with the following backtraces after the deletion of ComplianceSuite.


$ oc logs pod/compliance-operator-6bcbf66d5b-v2nzq 

E0716 11:29:35.420853       1 runtime.go:78] Observed a panic: &errors.errorString{s:"cannot parse '': quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'"} (cannot parse '': quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$') 
goroutine 3698 [running]: 
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x21d6040, 0xc000a48550) 
    /go/src/github.com/openshift/compliance-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0xc4    
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0) 
    /go/src/github.com/openshift/compliance-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0xbe 
panic(0x21d6040, 0xc000a48550) 
    /usr/lib/golang/src/runtime/panic.go:679 +0x1b2 
k8s.io/apimachinery/pkg/api/resource.MustParse(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) 
    /go/src/github.com/openshift/compliance-operator/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go:127 +0x23d 
github.com/openshift/compliance-operator/pkg/controller/compliancescan.getPVCForScan(0xc000383b00, 0x0)         <<------------ 
    /go/src/github.com/openshift/compliance-operator/pkg/controller/compliancescan/rawresults.go:80 +0x1a3 
github.com/openshift/compliance-operator/pkg/controller/compliancescan.(*ReconcileComplianceScan).deleteRawResultsForScan(0xc000518390, 0xc000383b00, 0x2753160, 0xc00106dac0) 

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

4.6.0-0.nightly-2020-07-16-005008

How reproducible:

Always 

Steps to Reproduce:

1  Create 'openshift-compliance' namespace 

$ oc create -f compliance-operator/deploy/ns.yaml   

2. Switch to 'openshift-compliance' namespace 

$ oc project openshift-compliance 

3. Deploy all CustomResourceDefinition. 

$ for f in $(ls -1 compliance-operator/deploy/crds/*crd.yaml); do oc create -f $f; done 

4. Deploy compliance-operator 

$ oc create -f compliance-operator/deploy/ 

5. Deploy compliancesuite CR  

$ oc create -f - <<EOF 
apiVersion: compliance.openshift.io/v1alpha1 
kind: ComplianceSuite 
metadata: 
  name: example-compliancesuite 
spec: 
  autoApplyRemediations: false 
  schedule: "0 1 * * *" 
  scans: 
    - name: workers-scan 
      profile: xccdf_org.ssgproject.content_profile_moderate 
      content: ssg-rhcos4-ds.xml 
      contentImage: quay.io/complianceascode/ocp4:latest 
      debug: true 
      nodeSelector: 
        node-role.kubernetes.io/worker: "" 
EOF 

6. Compliance scan will not perform on worker nodes 

$ oc get pods 
NAME                                   READY   STATUS    RESTARTS   AGE 
compliance-operator-6bcbf66d5b-pkddc   1/1     Running   0          3m49s 
compliance-operator-6bcbf66d5b-v2nzq   1/1     Running   0          3m49s 
compliance-operator-6bcbf66d5b-zphcg   1/1     Running   0          3m49s 
ocp4-pp-59466846fd-kr2gb               1/1     Running   0          3m6s 
rhcos4-pp-6845f5dcd-894j9              1/1     Running   0          3m6s 

7. ComplianceSuite result shows empty  

$ oc get compliancesuite 
NAME                      PHASE   RESULT 
example-compliancesuite            

8. Delete the ComplianceSuite  

$ oc delete compliancesuite example-compliancesuite 

9. Monitor pods status, one of the pod crashes in Error state 

$ oc get pods -w 
NAME                                   READY   STATUS    RESTARTS   AGE 
compliance-operator-6bcbf66d5b-pkddc   1/1     Running   0          6m42s 
compliance-operator-6bcbf66d5b-v2nzq   0/1     Error     3          6m42s 
compliance-operator-6bcbf66d5b-zphcg   1/1     Running   0          6m42s 
ocp4-pp-59466846fd-kr2gb               1/1     Running   0          5m59s 
rhcos4-pp-6845f5dcd-894j9              1/1     Running   0          5m59s 

10. Once the pod crashes, check the pod logs for backtraces 

$ oc logs pod/compliance-operator-6bcbf66d5b-v2nzq 

E0716 11:29:35.420853       1 runtime.go:78] Observed a panic: &errors.errorString{s:"cannot parse '': quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'"} (cannot parse '': quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$') 
goroutine 3698 [running]: 
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x21d6040, 0xc000a48550) 
    /go/src/github.com/openshift/compliance-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0xc4    
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0) 
    /go/src/github.com/openshift/compliance-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0xbe Share
panic(0x21d6040, 0xc000a48550) 
    /usr/lib/golang/src/runtime/panic.go:679 +0x1b2 
k8s.io/apimachinery/pkg/api/resource.MustParse(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) 
    /go/src/github.com/openshift/compliance-operator/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go:127 +0x23d 
github.com/openshift/compliance-operator/pkg/controller/compliancescan.getPVCForScan(0xc000383b00, 0x0)                 <<-------- 
    /go/src/github.com/openshift/compliance-operator/pkg/controller/compliancescan/rawresults.go:80 +0x1a3 
github.com/openshift/compliance-operator/pkg/controller/compliancescan.(*ReconcileComplianceScan).deleteRawResultsForScan(0xc000518390, 0xc000383b00, 0x2753160, 0xc00106dac0) 


Actual results:

The Compliance-Operator pod crashes at compliancescan.getPVCForScan() 

Expected results:

The Compliance-Operator pod should not crash after deleting of ComplianceSuite 

Additional info:

Comment 7 errata-xmlrpc 2020-10-27 16:15:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.