Bug 1873612
| Summary: | Monitoring: Alerts "after all" hook for "creates and expires a Silence" | ||||||
|---|---|---|---|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | David Taylor <dtaylor> | ||||
| Component: | Management Console | Assignee: | David Taylor <dtaylor> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Yadan Pei <yapei> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 4.6 | CC: | aos-bugs, jokerman, yapei | ||||
| Target Milestone: | --- | ||||||
| Target Release: | 4.6.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2020-10-27 16:35:38 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
David Taylor
2020-08-28 18:25:13 UTC
Created attachment 1713003 [details]
"Unexpected end of JSON input"
Note with Cypress retries enabled, each 'expire silence failure' actually fails 3 times: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_console/6340/pull-ci-openshift-console-master-e2e-gcp-console/1299344776004374528/artifacts/e2e-gcp-console/gui_test_screenshots/cypress/screenshots/monitoring/monitoring.spec.ts/ Traced down this flake.
When 'Expiring A Silence' in normal console, `response.headers.get('Content-Length')' = '0' is true and co-fetch code returns "promise that resolves with an empty object"
https://github.com/openshift/console/blob/cf7744e55f10bd7f05eafd57d8485254862faba8/frontend/public/co-fetch.js#L157
When 'Expiring A Silence' from Cypress, `response.headers.get('Content-Length')` = null! So co-fetch code continues on and eventually tries to return `response.json()`, which fails due to no json ("Unexpected end of JSON input"):
https://github.com/openshift/console/blob/cf7744e55f10bd7f05eafd57d8485254862faba8/frontend/public/co-fetch.js#L163
Wonder if this:
// If the response has no body, return promise that resolves with an empty object
if (response.headers.get('Content-Length') === '0') {
return Promise...
Should be changed to this:
// If the response has no body, return promise that resolves with an empty object
if (response.headers.get('Content-Length') === '0' ----> || response.headers.get('Content-Length') === null <-----) {
return Promise
Would like to understand why Cypress is returning null for `response.headers.get('Content-Length')` though.
Hi XiaochuanWang, the ''Content-Length'=null` was an error in the console code which was fixed via the associated github PR, so the issue has been fixed. If you can expire a silence, then all is good. Hi David, I checked the different ways of expire a silence, no empty length response header from the requests. Then the bug could be Verified. Thanks for your info. Verified on 4.6.0-0.nightly-2020-09-07-191134 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 |