Bug 1786835
Summary: | oc is crashing while mirroring registry | |||
---|---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Arnab Ghosh <arghosh> | |
Component: | oc | Assignee: | Ross Peoples <rpeoples> | |
Status: | CLOSED ERRATA | QA Contact: | zhou ying <yinzhou> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 4.2.z | CC: | aos-bugs, cshepher, erich, jokerman, mfojtik | |
Target Milestone: | --- | Keywords: | Reopened | |
Target Release: | 4.9.0 | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: |
Cause: An unchecked index operation on a slice when using --max-components argument
Consequence: panic: runtime error: slice bounds out of range
Fix: Add check to ensure components check doesn't request a value for an index that is out of range
Result: When using --max-components argument, oc will no longer panic with an out of range message
|
Story Points: | --- | |
Clone Of: | ||||
: | 2004193 (view as bug list) | Environment: | ||
Last Closed: | 2021-10-18 17:28:52 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: | ||||
Bug Depends On: | ||||
Bug Blocks: | 2004193 |
Description
Arnab Ghosh
2019-12-28 07:07:05 UTC
Can you provide exact steps and full dump of the errors, the current one makes it hard to figure out where and how it failed. I haven't heard from the author, thus closing. Hi there, I believe I need to reopen this bug as I have a customer seeing the same error. # oc version Client Version: 4.6.7 Server Version: 4.7.21 Kubernetes Version: v1.20.0+558d959 # oc adm catalog mirror registry.redhat.io/redhat/redhat-operator-index:v4.7 example.com:5000 -a ${REG_CREDS} --insecure --filter-by-os="linux/amd64" --max-components=5 src image has index label for database path: /database/index.db using database path mapping: /database/index.db:/tmp/861519587 wrote database to /tmp/861519587 using database at: /tmp/861519587/index.db panic: runtime error: slice bounds out of range [:4] with capacity 2 goroutine 1 [running]: github.com/openshift/oc/pkg/cli/admin/catalog.mappingForImages(0xc001608390, 0x2fb3672, 0x6, 0x0, 0x0, 0x0, 0x0, 0x7ffc9a2f76ca, 0x1f, 0x7ffc9a2f76ea, ...) /go/src/github.com/openshift/oc/pkg/cli/admin/catalog/mirrorer.go:174 +0x12ad github.com/openshift/oc/pkg/cli/admin/catalog.(*IndexImageMirrorer).Mirror(0xc00049e1e0, 0x3, 0x3, 0xc00049e1e0) /go/src/github.com/openshift/oc/pkg/cli/admin/catalog/mirrorer.go:89 +0x148 github.com/openshift/oc/pkg/cli/admin/catalog.(*MirrorCatalogOptions).Run(0xc000f596c0, 0x0, 0x31c6048) /go/src/github.com/openshift/oc/pkg/cli/admin/catalog/mirror.go:355 +0x17a github.com/openshift/oc/pkg/cli/admin/catalog.NewMirrorCatalog.func1(0xc0010aadc0, 0xc000761880, 0x2, 0x7) /go/src/github.com/openshift/oc/pkg/cli/admin/catalog/mirror.go:115 +0xbf github.com/spf13/cobra.(*Command).execute(0xc0010aadc0, 0xc000761810, 0x7, 0x7, 0xc0010aadc0, 0xc000761810) /go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:846 +0x2c2 github.com/spf13/cobra.(*Command).ExecuteC(0xc0006cf080, 0x2, 0xc0006cf080, 0x2) /go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:950 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:887 main.main() /go/src/github.com/openshift/oc/cmd/oc/oc.go:110 +0x885 Please let me know what debugging I can provide to troubleshoot this. Thank you! can't reproduce with latest oc client: [root@localhost registry]# oc version --client Client Version: 4.9.0-202108192235.p0.git.5622598.assembly.stream-5622598 [root@localhost registry]# oc adm release mirror --from=quay.io/openshift-release-dev/ocp-release:4.8.6-x86_64 --to=localhost:5000/ocp-index --to-release-image=localhost:5000/ocp-index:48 --insecure ...... To use the new mirrored repository to install, add the following section to the install-config.yaml: imageContentSources: - mirrors: - localhost:5000/ocp-index source: quay.io/openshift-release-dev/ocp-release - mirrors: - localhost:5000/ocp-index source: quay.io/openshift-release-dev/ocp-v4.0-art-dev To use the new mirrored repository for upgrades, use the following to create an ImageContentSourcePolicy: apiVersion: operator.openshift.io/v1alpha1 kind: ImageContentSourcePolicy metadata: name: example spec: repositoryDigestMirrors: - mirrors: - localhost:5000/ocp-index source: quay.io/openshift-release-dev/ocp-release - mirrors: - localhost:5000/ocp-index source: quay.io/openshift-release-dev/ocp-v4.0-art-dev oc adm catalog mirror registry.redhat.io/redhat/redhat-operator-index:v4.7 localhost:5000 --insecure --filter-by-os="linux/amd64" --max-components=5 both run well. 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 (Moderate: OpenShift Container Platform 4.9.0 bug fix and 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-2021:3759 |