Bug 55086 - %instance% not replaced in config files after fresh install
%instance% not replaced in config files after fresh install
Status: NEW
Product: UCS
Classification: Unclassified
Component: UCS Dashboard
UCS 5.0
Other All
: P5 major (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-11 11:29 CEST by riess82
Modified: 2022-08-11 15:37 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 4: Will affect most installed domains
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description riess82 2022-08-11 11:29:58 CEST
Primary Server: 5.0-2 errata382
Replica Directory Node with Dashboard installed: 5.0-2 errata382

Dashboard Database: 2.35.0-4 installed

After a fresh install of the dashboard, the database app does not start, reporting several errors loading rules. For example:

level=error component="rule manager" msg="loading groups failed" err="/etc/prometheus/alert_UNIVENTION_SLAPD_MDB_MAXSIZE_METRIC_MISSING.yml: 8:11: group \"UNIVENTION_SLAPD_MDB_MAXSIZE_METRIC_MISSING\", rule 1, \"UNIVENTION_SLAPD_MDB_MAXSIZE_METRIC_MISSING\": could not parse expression: 1:45: parse error: unexpected character inside braces: '%'"

This is caused by the fact that the variable %instance% from the definition (or any other variable for that matter) has not been replaced in the config files.

Example, causing error:

groups:
- name: UNIVENTION_SLAPD_MDB_MAXSIZE_METRIC_MISSING
  rules:
  - alert: UNIVENTION_SLAPD_MDB_MAXSIZE_METRIC_MISSING
    annotations:
      description: metrics regarding slapd mdb database size are missing
      title: check if metrics regarding slapd mdb database size are missing
    expr: absent(univention_slapd_mdb_size_used_ratio{%instance%}) == 1 or absent(univention_slapd_translog_mdb_size_used_ratio{%instance%})
      == 1
    for: 1m
    labels:
      severity: critical



Workaround: manually adding a key / value pair to the alert definition on the primary server triggers a rewrite of the config file and the variables including %instance% are filled in.

Result:
groups:
- name: UNIVENTION_SLAPD_MDB_MAXSIZE_METRIC_MISSING
  rules:
  - alert: UNIVENTION_SLAPD_MDB_MAXSIZE_METRIC_MISSING
    annotations:
      description: metrics regarding slapd mdb database size are missing
      title: check if metrics regarding slapd mdb database size are missing
    expr: absent(univention_slapd_mdb_size_used_ratio{instance=~"(SERVER_NAMES_CORRECTLY_INSERTED_HERE)"})
      == 1 or absent(univention_slapd_translog_mdb_size_used_ratio{instance=~"(SERVER_NAMES_CORRECTLY_INSERTED_HERE)"})
      == 1
    for: 1m
    labels:
      severity: critical
Comment 1 Florian Best univentionstaff 2022-08-11 11:36:28 CEST
Does it get fixed after executing:
univention-directory-listener-ctrl resync monitoring-client
Comment 2 riess82 2022-08-11 15:37:26 CEST
that solved the problem, thank you