Bug 1797512

Summary: UnmarshalError appears when define invalid regionEndpoint for registry operator
Product: OpenShift Container Platform Reporter: Wenjing Zheng <wzheng>
Component: Image RegistryAssignee: Ricardo Maraschini <rmarasch>
Status: CLOSED NOTABUG QA Contact: Wenjing Zheng <wzheng>
Severity: low Docs Contact:
Priority: medium    
Version: 4.4CC: adam.kaplan, aos-bugs
Target Milestone: ---   
Target Release: 4.5.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-05-18 16:21:39 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 Flags
Errors in registry operator log none

Description Wenjing Zheng 2020-02-03 10:32:22 UTC
Description of problem:
Below error appears if define regionEndpoint in image registry config as below:
http://xiuwang-proxy-bs8zt-image-registry-us-east-2-pfhumfbsjgsqvyrep.s3-website.us-east-2.amazonaws.com

Spec:
Status:
  Conditions:
    Last Transition Time:  2020-02-03T04:20:55Z
    Message:               The registry is ready
    Reason:                Ready
    Status:                True
    Type:                  Available
    Last Transition Time:  2020-02-03T10:20:02Z
    Message:               Unable to apply resources: unable to sync storage configuration: SerializationError: failed to unmarshal error message
                           status code: 404, request id: 5CE86E737B1E3007, host id: qYDQ/O6c/tGUkvFMG8i9R3WRiwODLCyup+DjlqxDj9+uU5U1A8UTocPD2JsnOHccXwIJCQHH6kc=
caused by: UnmarshalError: failed to unmarshal error message
  00000000  3c 68 74 6d 6c 3e 0a 3c  68 65 61 64 3e 3c 74 69  |<html>.<head><ti|
00000010  74 6c 65 3e 34 30 34 20  4e 6f 74 20 46 6f 75 6e  |tle>404 Not Foun|
00000020  64 3c 2f 74 69 74 6c 65  3e 3c 2f 68 65 61 64 3e  |d</title></head>|
00000030  0a 3c 62 6f 64 79 3e 0a  3c 68 31 3e 34 30 34 20  |.<body>.<h1>404 |
00000040  4e 6f 74 20 46 6f 75 6e  64 3c 2f 68 31 3e 0a 3c  |Not Found</h1>.<|
00000050  75 6c 3e 0a 3c 6c 69 3e  43 6f 64 65 3a 20 4e 6f  |ul>.<li>Code: No|
00000060  53 75 63 68 57 65 62 73  69 74 65 43 6f 6e 66 69  |SuchWebsiteConfi|
00000070  67 75 72 61 74 69 6f 6e  3c 2f 6c 69 3e 0a 3c 6c  |guration</li>.<l|
00000080  69 3e 4d 65 73 73 61 67  65 3a 20 54 68 65 20 73  |i>Message: The s|
00000090  70 65 63 69 66 69 65 64  20 62 75 63 6b 65 74 20  |pecified bucket |
000000a0  64 6f 65 73 20 6e 6f 74  20 68 61 76 65 20 61 20  |does not have a |
000000b0  77 65 62 73 69 74 65 20  63 6f 6e 66 69 67 75 72  |website configur|
000000c0  61 74 69 6f 6e 3c 2f 6c  69 3e 0a 3c 6c 69 3e 42  |ation</li>.<li>B|
000000d0  75 63 6b 65 74 4e 61 6d  65 3a 20 78 69 75 77 61  |ucketName: xiuwa|
000000e0  6e 67 2d 70 72 6f 78 79  2d 62 73 38 7a 74 2d 69  |ng-proxy-bs8zt-i|
000000f0  6d 61 67 65 2d 72 65 67  69 73 74 72 79 2d 75 73  |mage-registry-us|
00000100  2d 65 61 73 74 2d 32 2d  70 66 68 75 6d 66 62 73  |-east-2-pfhumfbs|
00000110  6a 67 73 71 76 79 72 65  70 3c 2f 6c 69 3e 0a 3c  |jgsqvyrep</li>.<|
00000120  6c 69 3e 52 65 71 75 65  73 74 49 64 3a 20 35 43  |li>RequestId: 5C|
00000130  45 38 36 45 37 33 37 42  31 45 33 30 30 37 3c 2f  |E86E737B1E3007</|
00000140  6c 69 3e 0a 3c 6c 69 3e  48 6f 73 74 49 64 3a 20  |li>.<li>HostId: |
00000150  71 59 44 51 2f 4f 36 63  2f 74 47 55 6b 76 46 4d  |qYDQ/O6c/tGUkvFM|
00000160  47 38 69 39 52 33 57 52  69 77 4f 44 4c 43 79 75  |G8i9R3WRiwODLCyu|
00000170  70 2b 44 6a 6c 71 78 44  6a 39 2b 75 55 35 55 31  |p+DjlqxDj9+uU5U1|
00000180  41 38 55 54 6f 63 50 44  32 4a 73 6e 4f 48 63 63  |A8UTocPD2JsnOHcc|
00000190  58 77 49 4a 43 51 48 48  36 6b 63 3d 3c 2f 6c 69  |XwIJCQHH6kc=</li|
000001a0  3e 0a 3c 2f 75 6c 3e 0a  3c 68 72 2f 3e 0a 3c 2f  |>.</ul>.<hr/>.</|
000001b0  62 6f 64 79 3e 0a 3c 2f  68 74 6d 6c 3e 0a        |body>.</html>.|

caused by: expected element type <Error> but have <html>
    Reason:                Error
    Status:                True
    Type:                  Progressing
    Last Transition Time:  2020-02-03T04:10:17Z
    Status:                False
    Type:                  Degraded
  Extension:               <nil>


Version-Release number of selected component (if applicable):
4.4.0-0.nightly-2020-02-02-225006

How reproducible:
Always

Steps to Reproduce:
1.Add regionEndpoint in image registry config as below:
http://xiuwang-proxy-bs8zt-image-registry-us-east-2-pfhumfbsjgsqvyrep.s3-website.us-east-2.amazonaws.com
2.Describe image-registry cluster operator
3.

Actual results:
UnmarshalError appears.

Expected results:
Should have clear error with good format.

Additional info:

Comment 1 Wenjing Zheng 2020-02-03 10:33:30 UTC
Created attachment 1657323 [details]
Errors in registry operator log

Comment 2 Oleg Bulatov 2020-02-03 10:52:51 UTC
It's unclear how the operator can distinguish between a (temporarily) broken custom region and a typo. This behaviour exists since 4.0, so it's not a blocker for 4.4.

Comment 3 Oleg Bulatov 2020-02-04 17:06:34 UTC
Lowering the severity because it's an enhancement of error reporting.

Comment 4 Ricardo Maraschini 2020-05-18 16:21:39 UTC
An initial attempt was made on improving error messaging here but as insights operator collects conditions with messages(it doesn't collect logs) it is better to keep more information in the condition. Closing this as NOTABUG.