Bug 2091595 - Alertmanager configuration can't use OpsGenie's entity field when AlertmanagerConfig is enabled
Summary: Alertmanager configuration can't use OpsGenie's entity field when Alertmanage...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.11
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.11.0
Assignee: Simon Pasquier
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-30 12:32 UTC by Simon Pasquier
Modified: 2022-08-10 11:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:14:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift prometheus-operator pull 185 0 None open Bug 2091595: Bump openshift/prometheus-operator to v0.56.3 2022-05-30 12:36:46 UTC
Github openshift prometheus-operator pull 190 0 None open Bug 2091595: bump to Prometheus operator v0.57.0 2022-06-03 15:15:28 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:14:57 UTC

Description Simon Pasquier 2022-05-30 12:32:20 UTC
Description of problem:
When 

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

How reproducible:
Always

Steps to Reproduce:
1. Enable user-defined AlertmanagerConfig in CMO config
kind: ConfigMap
apiVersion: v1
metadata:
  name: cluster-monitoring-config
  namespace: openshift-monitoring
data:
  config.yaml: |-
    alertmanagerMain:
      enableUserAlertmanagerConfig: true
2. Edit the alertmanager-main secret in the openshift-monitoring namespace with an OpsGenie receiver using the new entity field
receivers:
- name: opsgenie
  opsgenie_configs:
  - api_key: foo
    entity: bar
route:
  receiver: "opsgenie"


Actual results:
The PrometheusOperatorReconcileErrors alert is pending and there are errors in the prometheus-operator logs:

level=error ts=2022-05-30T12:29:27.451003887Z caller=klog.go:116 component=k8s_client_runtime func=ErrorDepth msg="Sync \"openshift-monitoring/main\" failed: provision alertmanager configuration: base config from Secret could not be parsed: yaml: unmarshal errors:\n line 32: field entity not found in type config.plain"


Expected results:
No error

Additional info:
The error doesn't happen when enableUserAlertmanagerConfig isn't true.

Comment 2 Simon Pasquier 2022-06-01 13:30:58 UTC
The change had to be reverted.

Comment 6 Junqi Zhao 2022-06-06 10:00:10 UTC
verified with 4.11.0-0.nightly-2022-06-04-014713, followed the steps in comment 0, no PrometheusOperatorReconcileErrors alert and no errors in the prometheus-operator logs.
# oc -n openshift-monitoring get secret alertmanager-main -o jsonpath="{.data.alertmanager\.yaml}" | base64 -d
"global":
  "resolve_timeout": "5m"
"receivers":
- name: opsgenie
  opsgenie_configs:
  - api_key: foo
    entity: bar
route:
  receiver: "opsgenie"

# oc -n openshift-monitoring logs -c prometheus-operator prometheus-operator-646b99c978-hmlh7 | grep "field entity not found in type"
no result

find other issues, tracked in bug 2093892

Comment 10 errata-xmlrpc 2022-08-10 11:14:45 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.11.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-2022:5069


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