Bug 2066388 - Wrong Error generates when https is missing in the value of `regionEndpoint` in `configs.imageregistry.operator.openshift.io/cluster`
Summary: Wrong Error generates when https is missing in the value of `regionEndpoint` ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 4.8
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.13.0
Assignee: Oleg Bulatov
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-21 16:11 UTC by naygupta
Modified: 2023-05-17 22:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-17 22:46:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift api pull 1346 0 None open Bug 2066388: Add example for s3.regionEndpoint 2022-11-18 16:48:54 UTC
Github openshift cluster-image-registry-operator pull 815 0 None open Bug 2066388: Add example for s3.regionEndpoint 2022-11-22 10:31:23 UTC
Red Hat Product Errata RHSA-2023:1326 0 None None None 2023-05-17 22:47:39 UTC

Description naygupta 2022-03-21 16:11:55 UTC
Description of problem:

Openshift 4.8 
Storage : s3 bucket

`cluster-image-registry-operator` pod is stuck in crashloopbackoff
Upgrade get stuck due to the below error in Image-registry-operator pod logs:

Error:
E0318 12:39:22.582371       1 runtime.go:78] Observed a panic: 
runtime.boundsError{x:3, y:2, signed:true, code:0x3} (runtime error: slice 
bounds out of range [3:2])


$ oc edit configs.imageregistry.operator.openshift.io/cluster
 ...
 managementState: Managed
 s3:
   bucket: ocp-xxx-registry
   encrypt: true
   region: us-east-1
   regionEndpoint: netappsxxx.xxx.at:18x82 
     

image-registry-operator generates panic messages in logs :

~~~
2022-03-18T12:51:54.716112751Z E0318 12:51:54.715730       1 
runtime.go:78] Observed a panic: runtime.boundsError{x:3, y:2, 
signed:true, code:0x3} (runtime error: slice boun
ds out of range [3:2])
2022-03-18T12:51:54.716112751Z goroutine 466 [running]:
2022-03-18T12:51:54.716112751Z 
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x2af0d40, 
0xc001c62930)
2022-03-18T12:51:54.716112751Z  /go/src/github.com/openshift/cluster- 
image-registry- 
operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x95
2022-03-18T12:51:54.716112751Z k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
2022-03-18T12:51:54.716112751Z  /go/src/github.com/openshift/cluster-image-registry-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x86
2022-03-18T12:51:54.716112751Z panic(0x2af0d40, 0xc001c62930)
~~~

Solution:
- Add https:// and \ at the end of regionEndpoint URL:
  regionEndpoint: https://netappsxxx.xxx.at:18x82/ 


Expectation:
Error message should be relatable to storage URL or something( `regionEndpoint`  parameter). This panic error leads to nowhere to troubleshoot the issue

Comment 3 Oleg Bulatov 2022-11-18 16:51:04 UTC
We cannot add validation for this field as may cause even more problems for customers who already have invalid value in this field. Let's update the documentation for the field.

Comment 6 XiuJuan Wang 2022-12-13 09:36:14 UTC
$oc explain configs.imageregistry.operator.openshift.io.spec.storage.s3.regionEndpoint
KIND:     Config
VERSION:  imageregistry.operator.openshift.io/v1

FIELD:    regionEndpoint <string>

DESCRIPTION:
     regionEndpoint is the endpoint for S3 compatible storage services. It
     should be a valid URL with scheme, e.g. https://s3.example.com. Optional,
     defaults based on the Region that is provided.

$oc version
Client Version: 4.13.0-0.nightly-2022-12-02-011756
Kustomize Version: v4.5.7
Server Version: 4.13.0-0.nightly-2022-12-08-170038
Kubernetes Version: v1.25.2+5497c42


Move to verified

Comment 9 errata-xmlrpc 2023-05-17 22:46:32 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 (Important: OpenShift Container Platform 4.13.0 security update), 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/RHSA-2023:1326


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