Bug 1917759 - Console operator panics after setting plugin that does not exists to the console-operator config
Summary: Console operator panics after setting plugin that does not exists to the cons...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.7.0
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-19 11:00 UTC by Jakub Hadvig
Modified: 2021-02-24 15:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:54:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console-operator pull 499 0 None closed Bug 1917759: Dont panic after setting plugin that does not exists to the console-operator config 2021-01-25 13:45:28 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:54:56 UTC

Description Jakub Hadvig 2021-01-19 11:00:21 UTC
Description of problem:
Console operator panics after setting console plugin that does not exists to the console-operator config.

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


How reproducible:
Always

Steps to Reproduce:
1. Go to `/k8s/cluster/operator.openshift.io~v1~Console/cluster/yaml` and add to the `spec.plugins` list `missing-plugin` entry, eg.

```
spec:
  logLevel: Normal
  managementState: Managed
  operatorLogLevel: Normal
  plugins:
    - missing-plugin
```
2. Go to console-operator pod's log

Actual results:
Panic in to logs:
```
E0119 10:54:21.624187       1 sync_v400.go:513] failed to set service endpoint for "missing-plugin" plugin: consoleplugin.console.openshift.io "missing-plugin" not found
E0119 10:54:21.624790       1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 697 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x20a9cc0, 0x36cd830)
	/go/src/github.com/openshift/console-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x95
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
	/go/src/github.com/openshift/console-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x89
panic(0x20a9cc0, 0x36cd830)
	/usr/lib/golang/src/runtime/panic.go:969 +0x1b9
github.com/openshift/console-operator/pkg/console/operator.getServiceHostname(0x0, 0xc000000002, 0x0)
	/go/src/github.com/openshift/console-operator/pkg/console/operator/sync_v400.go:523 +0x49
github.com/openshift/console-operator/pkg/console/operator.(*consoleOperator).GetPluginsEndpointMap(0xc00017ab40, 0xc0019330d0, 0x1, 0x1, 0x7)
...
```

Expected results:
Panic should not occur. If the ConsolePlugins is missing on the cluster, it should be logged in the console-operator logs, and that plugin should not be added to the map of enabled console plugins in the `console-config` ConfigMap in the openshift-console namespace.


Additional info:

Comment 2 Yadan Pei 2021-01-22 06:24:06 UTC
1. patch console.operator/cluster with non-existing plugin name
$ oc get console.operator cluster -o json | jq '.spec.plugins'
[
  "missing-plugin"
]

2. Check console-operator pod log
$ oc logs -f console-operator-6688cd6b9f-jd5bp -n openshift-console-operator
 stream error: stream ID 375; INTERNAL_ERROR") has prevented the request from succeeding
E0122 06:19:31.268670       1 sync_v400.go:513] failed to get "missing-plugin" plugin: consoleplugin.console.openshift.io "missing-plugin" not found
E0122 06:19:33.654813       1 sync_v400.go:513] failed to get "missing-plugin" plugin: consoleplugin.console.openshift.io "missing-plugin" not found

Verified on 4.7.0-0.nightly-2021-01-21-215614

Comment 5 errata-xmlrpc 2021-02-24 15:54:35 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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-2020:5633


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